alien7

Hello,

After creating a class to the same directory as my project with System.IO.StreamWriter at runtime, how do I add it to my project in code

Thanks!



Re: Visual C# General Add Class to Project Through Code

xsdevnet

You would have to compile it with the C# compiler and then load the generated assembly.

Programmatically compile code:
http://support.microsoft.com/kb/304655






Re: Visual C# General Add Class to Project Through Code

OmegaMan

MyEmailUserID wrote:

Hello,

After creating a class to the same directory as my project with System.IO.StreamWriter at runtime, how do I add it to my project in code

Thanks!



You don't have to do anything. The System.IO library is already referenced into the project by design and resides in the System assembly. To see open up the References folder which shows the System library included.

Note all System.XXXX libraries are not automatically inlcuded. For that scenario you will need to add a reference, to the project by going to the solutions explorer in the IDE, right click on the references folder and add select reference to the library which will have the object. Once done in the code you can then say Using System.XXXX;





Re: Visual C# General Add Class to Project Through Code

MyEmailUserID

I know this sounds strange but I'm creating an interface to create webpages. Is there a way to add the webpage to the project using C# It's kind of like making programming easier similar to CodeGen.

Thanks!