Click here to Skip to main content
15,892,005 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
How to run c# form code on Win7

without instalation of Visual Studio
Posted
Comments
Sergey Alexandrovich Kryukov 31-Dec-11 3:00am    
Not "form code" but application.
--SA

You don't have to install Visual Studio. Net framework is adequate. Net framework 3.5 is included with Windows 7 so if you're targeting it (or previous) then everything should be fine. If you're using a newer framework, then it should be installed first. If you're using a setup program, this can be done by making it a prerequisite.

The key thing is that you take the compiled binaries from your debug or release directory and distribute them either by copying or with some more advanced techique (for example ClickOnce).

If you have developed the program with credentials with lots of privileges you must take the UAC into account. For more information, see: http://msdn.microsoft.com/en-us/library/bb756973.aspx[^]. Even though the topic is for Vista the ideas apply also to Windows 7.
 
Share this answer
 
Comments
[no name] 30-Dec-11 18:22pm    
so it is 5 ;)
Wendelius 30-Dec-11 18:29pm    
Thanks :)
Sergey Alexandrovich Kryukov 31-Dec-11 3:00am    
Voted 5 and credited in my answer? Why my answer? Because there is one important detail...
--SA
Wendelius 31-Dec-11 3:43am    
Thanks SA :)
In addition to the correct answer by Mika: Visual Studio is not even needed to build the assemblies from the source code. All you need to build it is included in (freely redistributable) .NET Framework: C# and VB.NET compilers, MSBuild, etc. You can either build it all using just a compiler command line, or build by a project or solution file using MSBuild.EXE. For more detail, see the help on each of those tools.

[EDIT]

It's good to understand that Visual Studio does not build any .NET projects; instead, it runs MSBuild found in .NET Framework (maybe indirectly, via Code DOM) and redirects outputs to IDE. You also can create application using Code DOM which would make a project out of C# or VB.NET source code, compile and run it. This application would not require any prerequisites except .NET Framework redistributable package.

See http://msdn.microsoft.com/en-us/library/y2k85ax6.aspx[^].

—SA
 
Share this answer
 
v2
Comments
Wendelius 31-Dec-11 3:43am    
So true. 5'd
Sergey Alexandrovich Kryukov 31-Dec-11 12:11pm    
Thank you, Mika.
--SA
make setup file of your project and install it to any PC having .NET Framework. You can run it without having Visual Studio.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900