publish program in Visual c#

Discussion in 'Programmer's Corner' started by harrison_c, Aug 5, 2010.

  1. harrison_c

    Thread Starter New Member

    Aug 5, 2010
    5
    0
    Hi all,

    I am learning visual C# and I am using visual C# 2008 Express edition. I am trying to publish my program and install on other computer which has not visual C# installed. But I am asked to install .NET framework in order to use my program. Is it possible to do without installing .NET on the computer?

    thanks.
     
  2. cheezewizz

    Active Member

    Apr 16, 2009
    82
    10
    In a word .... No. In order to run your program the computer needs the .NET framework installed.
     
    harrison_c likes this.
  3. harrison_c

    Thread Starter New Member

    Aug 5, 2010
    5
    0
    Is it because of c#? How about if I use visual c++, basic, etc. Or it is because of express edition?
     
  4. BMorse

    Senior Member

    Sep 26, 2009
    2,675
    234
    It is because of file dependencies of your application and runtime files.... without those on the PC that you are running the application on, it will not run, or you can just create an installer package and include all file dependencies in it, so when the installer is run on the other PC, it will also install all necessary files for your app to run....


    B. Morse
     
    harrison_c likes this.
  5. harrison_c

    Thread Starter New Member

    Aug 5, 2010
    5
    0

    Ok! but how? Can you show me how or where i can learn from?
     
  6. BMorse

    Senior Member

    Sep 26, 2009
    2,675
    234
    You can watch this to learn how >> http://www.youtube.com/watch?v=_HUrzRowdec


    You should have another application that was installed as a separate program on your PC when you installed Visual Studio, that is called Setup And Deployment Wizard, use this or similar application to create a setup package for your program.


    B. Morse
     
    Last edited: Aug 6, 2010
    harrison_c likes this.
  7. harrison_c

    Thread Starter New Member

    Aug 5, 2010
    5
    0

    Hi, where I can find my file dependencies of application and runtime files? .dll? I only find these files after I published. Please see Attachment.
     
  8. BMorse

    Senior Member

    Sep 26, 2009
    2,675
    234
    They will be in the Setup package, which will deploy once you run it on the other computer....

    B. Morse
     
  9. debjit625

    Well-Known Member

    Apr 17, 2010
    790
    186
    You will have to install .Net framework on the system where you want to install your application.Just giving the dependencies files will not make your program run.
    Why? The programs compiled in C# is called a .Net based program these code targets the common language runtime (CLR), i.e.. these program are compiled in a different language known as MSIL (Micro Soft Intermediate Language).Its different from native language which our processor understand like in C or C++ if you write a program the exe file will contain Native binary code that is understood by our processor.But MSIL is not understood by our processor so it need some thing to convert the codes into native codes before it can be executed by the processor,and this is done by .Net.Its kind of java type where in java programs you need javaruntime.Another thing not only C# is .Net based but their are other language also like C++.Net,VB.Net.The file dependencies are the files which the program needs from .Net to run, but these files will only run under .Net.

    When you create A Setup from "Setup And Deployment Wizard" it includes .Net in the package or it will do a web install of .Net if its not found on targeted system.

    .Net is a very vast topic it cant be explained in one post for now just think .Net as a virtual processor,Google on .net to know more

    Good Luck
     
  10. harrison_c

    Thread Starter New Member

    Aug 5, 2010
    5
    0

    So it is because of C# or because I am using visual C# 2008 express edition? How about if I use VB, VC++ 6.0? Or I can use visual basic/c++ 2008 Express edition but not C#?
     
  11. BMorse

    Senior Member

    Sep 26, 2009
    2,675
    234
    If you want to get away from using the .net, you will have to use an older version of Visual Studio, possibly use VB 6.0 or Visual C# that is not based on the .net structure...


    B. Morse
     
    harrison_c likes this.
  12. debjit625

    Well-Known Member

    Apr 17, 2010
    790
    186
    When Microsoft built .Net they built a language for it and that is C# so any C# compiler will compile code which target CLR .i.e.. it needs .Net at any cost.

    Now if somebody dont like to be their application .Net based.The will use native ,in Visual Studio every edition from 2003 onwards i.e version 7.0 i think their is two part Manage and another is Unmanaged .The managed stuff is for .Net based application i.e CLR type application and the unmanaged part is for Win32 Applications which is native.

    Using VB the older one used its own VB runtime dll if this dll is not found in the current system then the application will not run.It will be much better to use .Net
    so if you use VB use current VB.Net which is a CLR application.

    Yes C++ 6.0 compiles codes into native which dont needs .Net and same for New C++ editions.In current Visual Studio package you will find their are two type of application can be created by C++ 1)CLR which is a .Net based 2)Win32 which is native.

    In VisualStudio if you want to create native applications just open a new project and select win32 node and select Win32 Console Application.

    Good Luck
     
Loading...