Including my namespace in a C# project
-
12 Nisan 2012 Perşembe 20:36
I have created a namespace to hold a prebuilt class that that I would like to use in a new project. I compiled it in Visual Studio into a DLL, in a separate directory. I added an appropriate "using" statement in the new project, as in "using myclasses.mysubclass;". However, I imagine that I would need to tell the IDE which folder to look in for myclasses.dll. Do I need to copy this dll into one of the project folders so the ide will recognize it? If so, which one?. I assume that there is a way to do this, so that the methods and objects in the class will appear in intellisense.
Thanks,
Howard
Tüm Yanıtlar
-
12 Nisan 2012 Perşembe 20:41Moderatör
You need to add a reference to the assembly in your project via Add reference. This lets VS know where the assembly resides. By default the assembly will then be copied locally into the project and will run without issue. Refer to MSDN: http://msdn.microsoft.com/en-us/library/z6609kte.aspx
Michael Taylor - 4/12/2012
http://msmvps.com/blogs/p3net