Wrox Programmer Forums
|
.NET 4 and Visual Studio 2010 General Discussions For discussing anything about .NET 4, WPF, WCF, the rest of the .NET 4 Framework, and Visual Studio 2010 that isn't about a specific Wrox book. Please post code questions about a specific language (C#, VB, ASP.NET, etc) in the correct language forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the .NET 4 and Visual Studio 2010 General Discussions section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 30th, 2012, 11:26 AM
Registered User
 
Join Date: Jan 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Create .NET DLL without Copy Local

I'm attempting to write a DLL to keep in common among all of my applications in the spirit of Microsoft and Adobe who use this practice. I seem to have an issue with the DLL not registering correctly. After reading chapter 28 in this book (Visual Basic 2010 and .NET 4) I have tried every avenue. [Again I don't need any of them if I copy local but that defeats the purpose.] I have Selected the "Make assembly COM-Visible" the "Register for COM interop" and the "regasm" command prompt and my other .NET Apps still say they cannot find the DLL. I have all the files in a central "Microsoft Standard Practice Approved" location with correct permission. This is .NET to .NET so you’d think it would be easier. They are all in the same solution (again per Microsoft Standard Practice). Any help beyond what is in the "Visual Basic 2010 and .NET 4" book would be greatly appreciated.
 
Old February 3rd, 2012, 10:59 PM
Friend of Wrox
 
Join Date: Sep 2005
Posts: 812
Thanks: 1
Thanked 53 Times in 49 Posts
Default

Hi Brandon

I'm not sure if I had got your question completely. One thing I would suggest is to have it in the Global Assembly Cache (http://support.microsoft.com/kb/315682). If you have tried this earlier, let us wait for suggestions from others too

Cheers
Shasur
__________________
C# Code Snippets (http://www.dotnetdud.blogspot.com)

VBA Tips & Tricks (http://www.vbadud.blogspot.com)
 
Old March 6th, 2012, 11:37 AM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 109
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to anubhav.kumar
Lightbulb

Hi,

If you do not want to put it in GAC and still want to share it acroos multiple applications, you may need to do the following:
  1. Create a folder which is outside the solution folders, say c:\MySharedAssembly
  2. In the post build event [ accessible through project proerties], of the class library, write a script to copy your output [.dll file] to the folder created in #1.
  3. Also, you need to sign your assembly during compilation, to make it strongly typed. This is the most important step. This is doable through project properties page.
  4. In the config files of all applications you will need to add a <runtime> section and provide the path for the referenced assembly [c:\MySharedAssembly]. Make sure that copy local is false in your class library.
For example:
Code:
 
<runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="MySharedAsm"
                          culture="neutral" publicKeyToken="08960b9f06749624"  />
        <codeBase version="2.0.0.0"
                  href="C:\MySharedAsm.dll"/>
      </dependentAssembly>
    </assemblyBinding>
</runtime>
Please refer to the following article on MSDN and dwelve a bit , you will get it working:
http://msdn.microsoft.com/en-us/library/7wd6ex19.aspx

Thanks.

P.S.: My current project runs in similar fashion. , but couldn't share those details on public forum.
__________________
Anubhav Kumar
http://anubhavtimepass.blogspot.com/





Similar Threads
Thread Thread Starter Forum Replies Last Post
Create a reference to a .net dll from MS Access waltkrueger Pro VB.NET 2002/2003 1 November 20th, 2006 05:46 PM
Copy Files and Folders on Local Network rupakroy5 VB.NET 2002/2003 Basics 1 May 22nd, 2006 10:09 AM
Copy Local, Reference property ps2goat .NET Framework 1.x 1 October 24th, 2005 03:13 PM
Getting the a local copy of the Server DB Sappu SQL Server ASP 2 March 21st, 2005 12:27 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.