I have some class ( simple class ) and i want to compile in runtime this class and create ( in runtime ) some dll that will contain this class.
Is there some way to do it ?
Thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes, use CSharpCodeProvider.
You can read the sample code for “Snippy” that I used for C# in Depth – it does exactly this sort of thing.
You can ask
CSharpCodeProviderto write to a file or build the assembly in memmory.Sample code: