Click here to Skip to main content
15,888,116 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hii...

anybody please give some suggestion that am writing C# .net code in my own editor and now i want to compile that code and if that code not had any errors then i want to save that code into a .cs file
Posted

1 solution

This is easily done using CodeDOM:
http://msdn.microsoft.com/en-us/library/system.codedom%28v=vs.110%29.aspx[^],
http://msdn.microsoft.com/en-us/library/y2k85ax6%28v=vs.110%29.aspx[^].

You can also load the compiled assemblies in your application, but it would be a considerable complication. The problem here is the inability of .NET to unload once loaded assemblies (for a good reason), so the solution would be using AppDomain. For further detail, please see my past answer: code generating using CodeDom[^].

—SA
 
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