Including my namespace in a C# project


  • 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. 



    יום חמישי 12 אפריל 2012 20:36


  • 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

    • הוצע כתשובה על-ידי gungan37 יום חמישי 12 אפריל 2012 23:24
    • סומן כתשובה על-ידי hcw03 יום שישי 13 אפריל 2012 12:18
    יום חמישי 12 אפריל 2012 20:41
    מנחה דיון