1

I don't have MS Visual Studio installed and can't install it due to financial/legal reasons. I've inherited an executable file built with Visual Studio using C#. It isn't working as planned. I can fix the problem by changing 1 line of code. I have done so, but now I don't know how to re-build the project into an executable without Visual Studio.

I've tried running the following code from the command prompt:

>C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe /t:exe 
/out:exchange.exe exchange.csproj

Am I on the right track?

Edit: This question is different from this question because here I ask about building and compiling a whole project... not just a .cs file.

Community
  • 1
  • 1
j_code_3
  • 37
  • 5
  • 1
    You should look to see if you qualify to use the Visual Studio Community edition ([Free under certain conditions](https://www.visualstudio.com/support/legal/mt171547), and if you *don't* qualify then someone should be able to pay for it or deal with whatever legal problems...) – crashmstr Nov 23 '15 at 15:06
  • 1
    Possible duplicate of [Compiling/Executing a C# Source File in Command Prompt](http://stackoverflow.com/questions/553143/compiling-executing-a-c-sharp-source-file-in-command-prompt) – Sinatr Nov 23 '15 at 15:07
  • Crash - I work for a large corporation and our legal department believes that use of the free version could violate Microsoft's usage agreement, so I've been instructed not to install any Visual Studio software since I will not be a regular user. Sinatr - I tried the solution from that post, but it did not work for me. The solution from Iris below worked great. – j_code_3 Nov 23 '15 at 16:09

2 Answers2

2

I would suggest installing Visual Studio Community edition (free)

But, if you just want to build using msbuild through the commandline the simplest way would be (assuming you navigated to where msbuild is or have the env path set):

msbuild "C:\Users\Something\Documents\Visual Studio 2015\Blah path\Hello.csproj"

Building (then running) a simple console app that prints hello with the above:

enter image description here

Iris Classon
  • 5,752
  • 3
  • 33
  • 52
1

You can use MonoDevelop for compiling your C# project.

Adeel
  • 21
  • 3
  • Thanks for responding, but due to my user privileges I cannot install software like this. This may work for others though. – j_code_3 Nov 23 '15 at 16:06