csc

How to build a .NET website using Nant

跟風遠走 提交于 2019-12-07 14:06:37
问题 I usually use web applications in Visual Studio and the MSBUILD taks in Nant builds them without any problems: <msbuild project="MySolution.sln"> arg value="/property:Configuration=release" /> </msbuild> I now have a website (not a web application) in a VS Solution and it won't build - I get a lot of namespace errors. Should I be able to build the solution with MSBUILD even though it contains a website? Or do I need to use CSC? 回答1: You should try using the devenv.exe command if msbuild.exe

Why doesn't this recursion produce a StackOverFlowException?

喜你入骨 提交于 2019-12-06 21:59:42
问题 What is wrong with this code: using System; namespace app1 { static class Program { static int x = 0; static void Main() { fn1(); } static void fn1() { Console.WriteLine(x++); fn1(); } } } I compile this piece of code using this command: csc /warn:0 /out:app4noex.exe app4.cs When I double click on the exe, it doesn't seem to throw the exception (StackOverFlowException), and keep running forever. Using visual studio command prompt 2010, but I also have vs 2012 installed on the system, all up

Running the C# compiler from a C# program

左心房为你撑大大i 提交于 2019-12-06 13:57:34
问题 I am trying to build a C# program that converts a different language into C# code. I have the program working fine, converting the code and writing it to a .cs file. I want to have this file automatically be compiled, and run, however I cannot figure out how to do this with C#. I can do it manually by simply running a batch file I wrote, and I attempted to run this batch file from C# using the System.Diagnostics.Process class. When it ran it gave an error within the batch code itself, saying

How to build a .NET website using Nant

╄→尐↘猪︶ㄣ 提交于 2019-12-05 21:36:39
I usually use web applications in Visual Studio and the MSBUILD taks in Nant builds them without any problems: <msbuild project="MySolution.sln"> arg value="/property:Configuration=release" /> </msbuild> I now have a website (not a web application) in a VS Solution and it won't build - I get a lot of namespace errors. Should I be able to build the solution with MSBUILD even though it contains a website? Or do I need to use CSC? You should try using the devenv.exe command if msbuild.exe is failing for you. Also you may be interested in Web Deployment Projects . Sayed Ibrahim Hashimi My Book:

Why doesn't this recursion produce a StackOverFlowException?

夙愿已清 提交于 2019-12-05 01:23:50
What is wrong with this code: using System; namespace app1 { static class Program { static int x = 0; static void Main() { fn1(); } static void fn1() { Console.WriteLine(x++); fn1(); } } } I compile this piece of code using this command: csc /warn:0 /out:app4noex.exe app4.cs When I double click on the exe, it doesn't seem to throw the exception (StackOverFlowException), and keep running forever. Using visual studio command prompt 2010, but I also have vs 2012 installed on the system, all up to date. Because the optimizer unrolls the tail recursion call into: static void fn1() { START: Console

Running the C# compiler from a C# program

拜拜、爱过 提交于 2019-12-04 19:37:26
I am trying to build a C# program that converts a different language into C# code. I have the program working fine, converting the code and writing it to a .cs file. I want to have this file automatically be compiled, and run, however I cannot figure out how to do this with C#. I can do it manually by simply running a batch file I wrote, and I attempted to run this batch file from C# using the System.Diagnostics.Process class. When it ran it gave an error within the batch code itself, saying that none of the commands were found (the usual "not an executable, batch file etc"). I can't figure

Why does C# encounter this error as to the CSC file?

家住魔仙堡 提交于 2019-12-04 15:03:26
问题 I am pretty new in C# development and I have the following problem. When I try to build the application on which I am working I obtain the followings errors message: Error 2 Source file 'Log\LogUserManager.cs' could not be found C:\Develop\MyFramework4.0\MyManagerCSharp\CSC MyManagerCSharp Error 8 Source file 'AntiPhishing.cs' could not be found C:\Develop\EarlyWarning\public\Implementazione\Ver2\UnitTestProject\CSC UnitTestProject It seeams to me that these errors appeared after an SVN

For what reason would I choose a C# compiler file alignment setting other than 512?

↘锁芯ラ 提交于 2019-12-03 06:28:55
问题 I can see in MSDN how to change the file alignment for C# compilation (via project settings and the command line). I have googled and seen articles explaining that a file alignment of 512 Bytes reduces the size of the .dll. I have tested myself with different file alignments and seen that, yes, it does. My question is: Why would I ever want to use a different file alignement? There must be scenarios where this is required or there wouldn't be the option? Also, what does it do exactly? The

For what reason would I choose a C# compiler file alignment setting other than 512?

冷暖自知 提交于 2019-12-02 20:02:19
I can see in MSDN how to change the file alignment for C# compilation (via project settings and the command line). I have googled and seen articles explaining that a file alignment of 512 Bytes reduces the size of the .dll. I have tested myself with different file alignments and seen that, yes, it does. My question is: Why would I ever want to use a different file alignement? There must be scenarios where this is required or there wouldn't be the option? Also, what does it do exactly? The MSDN pages talk about sections? What are sections? http://msdn.microsoft.com/en-us/library/0s4tzdf2.aspx

Including FSharp.Core in a C# project: resolving type collisions

淺唱寂寞╮ 提交于 2019-12-01 16:36:06
I'm using some F# types ( Matrix et al) from C# and so I need to reference the FSharp.Core assembly in my C# project. So far, so good. However, there are apparently some types defined in mscorlib.dll (v4) which are "duplicated" in FSharp.Core (v2), like System.Tuple and System.IObservable . I can't understand why this is in .Net 4. Matt Ellis specifically said they would be removed in his MSDN article : One language suffering that [duplication] problem was F#, which previously had defined its own tuple type in FSharp.Core.dll but will now use the tuple added in Microsoft .NET Framework 4. I'm