Is it possible to load a class and create Instance of it from It’s .cs file?
I want to open a custom class in a .cs file and create instance of it in my application
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.
in theory yes – it mainly depends on whether you have all dependencies available…
IF so you can use the built-in
CSharpCodeProviderto compile the.cs– file to an assembly (can be purely in-memory if need be) and then use Reflection to create an instance/use a class from that assembly…Since don’t provide much detail I would suggest to checkout these links and come back with detail questions if some arrise: