Click here to Skip to main content
15,923,789 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Sorry, if I have been asking a lot of questions lately,
This time I want to know "How can I add reference programmatically in C#,
I am creating a Custom C# compiler using CS Code Provider (experienced users would know this) & Code-Dom, I want the user to be able to add references and use them in my custom compiler.
References mean the "DLLS" that can be added using the GUI of Visual Studio, by right-clicking the references folder and selecting "Add References", This is done through the GUI, but I want the same thing to be done Programmatically.
Any Suggestions???
Posted
Updated 12-Jul-13 5:17am
v4
Comments
[no name] 12-Jul-13 11:17am    
http://www.bing.com/search?q=How+can+I+add+reference+programmatically+in+C%23
sid2x 12-Jul-13 11:20am    
I already searched it but most of them tell me to modify the XML, file but it is not visible in the release version, or the compiled application.

1 solution

You'll want to use Reflection in C#. There is an Assembly class you can use. A good example is at http://social.msdn.microsoft.com/Forums/vstudio/en-US/054f9b1e-dcbf-410d-9e92-b4fc65a85ded/dynamic-dll-reference-in-c[^].
 
Share this answer
 
Comments
sid2x 12-Jul-13 20:32pm    
Great You are awesome. Thanks!

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