0

I want to programatically generate a file in one of the class library projects in my solution. Is there a way to do this? By programatically, I mean a method that can create a .cs file and add to the project or one of its folders.

1
  • You can generate C# source files, but what do you want exactly? C# is not a dynamic language so those files are just files and won't be part of your running app. Commented Jan 8, 2017 at 14:14

1 Answer 1

1

You can use System.Reflection.Emit to do this. Here is a tutorial.

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

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.