2011-08-22 6 views
1

VS2010을 사용하는 C# 솔루션에서 명령 줄을 사용하여 빌드/컴파일 할 수 있도록 현재 빌드/컴파일 설정을 어떻게 내보낼 수 있습니까?VS2010 명령 줄 빌드/컴파일 매개 변수를 내보내는 방법

+0

질문은 명령 줄을 사용하여 빌드하는 방법입니다. 그에 따르면, 대답은 다를 수 있다고 생각합니다. –

+0

"csc"를 통해 의미하는 경우; IDE에서이 코드를 내보낼 수는 있지만 (여전히 방법을 파헤 치려고합니다.) 흰색 거짓말입니다. http://blogs.msdn.com/b/ed_maurer/archive/2008/06/11 /a-tale-of-two-compilers.aspx –

+0

출력 창에서 복사 : –

답변

4

빌드 옵션을 사용자 정의 했습니까? Visual Studio 2010 명령 프롬프트에서 msbuild를 사용할 수 있습니다.

msbuild YourSolution.sln 

구성과 같은 다양한 솔루션 속성을 지정할 수도 있습니다.

msbuild YourSolution.sln /p:Configuration=Release 
2

"csc"를 통해 의미하는 경우; 출력 창을 띄웁니다. 빌드하고 빌드로 변경하십시오. 이제 해당 창에서 csc을 찾으십시오. 예를 들어

Task "Csc" (TaskId:21) 
    C:\Windows\Microsoft.NET\Framework\v4.0.30319\Csc.exe /noconfig /nowarn:1701,1702 /nostdlib+ /platform:x86 /errorreport:prompt /warn:4 /define:DEBUG;TRACE /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\Microsoft.CSharp.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\mscorlib.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\System.Core.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\System.Data.DataSetExtensions.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\System.Data.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\System.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\System.Xml.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\System.Xml.Linq.dll" /debug+ /debug:full /filealign:512 /optimize- /out:obj\x86\Debug\ConsoleApplication26.exe /target:exe Program.cs Properties\AssemblyInfo.cs "C:\Users\mgravell\AppData\Local\Temp\.NETFramework,Version=v4.0,Profile=Client.AssemblyAttributes.cs" (TaskId:21) 

또는 (다른 출력 레벨에서)

CoreCompile: 
    C:\Windows\Microsoft.NET\Framework\v4.0.30319\Csc.exe /noconfig /nowarn:1701,1702 /nostdlib+ /platform:x86 /errorreport:prompt /warn:4 /define:DEBUG;TRACE /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\Microsoft.CSharp.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\mscorlib.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\System.Core.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\System.Data.DataSetExtensions.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\System.Data.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\System.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\System.Xml.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\System.Xml.Linq.dll" /debug+ /debug:full /filealign:512 /optimize- /out:obj\x86\Debug\ConsoleApplication26.exe /target:exe Program.cs Properties\AssemblyInfo.cs "C:\Users\mgravell\AppData\Local\Temp\.NETFramework,Version=v4.0,Profile=Client.AssemblyAttributes.cs" 

enter image description here

하지만 the command it displays is a white lie 것을 유의.

+0

빌드 창이 보이지 않습니다. – q0987

+0

@ q0987 출력 ** 창에서 "빌드"옵션을 선택하십시오. * 해당 창에서 –

관련 문제