1

How can I create makefile for a c# project? Or, how can I compile my project from the command line?

The project name is Ex6-Assembler and the cs files are: main.cs, code.cs, SymbolTable.cs, parser.cs

1

3 Answers 3

4

For 'make'-alternative you can use MSBuild, you can read about it here Or if you want, you can just compile files, calling csc.exe as described here

Sign up to request clarification or add additional context in comments.

2 Comments

csc.exe? where should i write it? in what folder should i be (in commnand prompt) whem i try it it shows error message "command is not recognizable...
Go to your Visual Studio Bin folder, on my machine it's "c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\" and run VCVARS32.bat file. It will pop up Command Prompt with appropriate folders added to PATH.
3

look there for build your application via commandline: https://msmvps.com/blogs/luisabreu/archive/2007/08/31/compiling-c-code-from-de-code-line.aspx

here is the offical msdn page to this topic: http://msdn.microsoft.com/en-us/library/78f4aasd%28v=vs.80%29.aspx

you can find more details on the msdn:

http://msdn.microsoft.com/en-us/library/1700bbwd%28v=vs.71%29.aspx

Comments

2

i am use run_built.bat file there are code

C:\windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe /target:Build build.msbuild
PAUSE

and build.msbuild:

<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <Target Name="Build">
        <MSBuild Projects="MyProject.sln" Targets="Rebuild" Properties="Configuration=Release;" />
    </Target>
</Project>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.