Results 1 to 5 of 5

Thread: [RESOLVED] [2005] Custom DLL's

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jun 2005
    Posts
    243

    Resolved [RESOLVED] [2005] Custom DLL's

    I would like to be able to have a single directory that holds custom dll's (for updating purposes), rather than having a copy in each project directory that uses that dll.
    On local computer .dll's are located in:
    C:\Data\Controls\

    On server .dll's are located in:
    C:\Data\Controls\

    I have referenced the dll from C:\Data\Controls\.

    The error I get when trying to debug the application:
    VB Code:
    1. System.InvalidOperationException was unhandled
    2.   Message="An error occurred creating the form. See Exception.InnerException for details.  The error is: Could not load file or assembly 'Email, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified."
    3.   Source="PACS_Upload"
    4.   StackTrace:
    5.        at PACS_Upload.My.MyProject.MyForms.Create__Instance__[T](T Instance) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 190
    6.        at PACS_Upload.My.MyProject.MyForms.get_frmMain()
    7.        at PACS_Upload.My.MyApplication.OnCreateMainForm() in C:\Work\VBNET\PACS_Upload\PACS_Upload\My Project\Application.Designer.vb:line 35
    8.        at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
    9.        at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
    10.        at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
    11.        at PACS_Upload.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
    12.        at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
    13.        at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
    14.        at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
    15.        at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
    16.        at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
    17.        at System.Threading.ThreadHelper.ThreadStart()

    Is there a way to not have a copy of the dll in my bin directory, and rather point to a specified location?

  2. #2

    Thread Starter
    Addicted Member
    Join Date
    Jun 2005
    Posts
    243

    Re: [2005] Custom DLL's

    I found this article, but is there an easier way of doing this?

    http://msdn2.microsoft.com/en-us/library/x66s8zcd.aspx

  3. #3
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339

    Re: [2005] Custom DLL's

    The GAC is the way you would do what you are asking.

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2005] Custom DLL's

    Assuming that your using a VS Setup project, when you create your installer you can choose the Global Assembly Cache (GAC) in the File System page instead of the program folder itself.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Jun 2005
    Posts
    243

    Re: [2005] Custom DLL's

    Thanks for the help. I created the object in the GAC. And can see it from the References window.

    Thanks for the help!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width