Referencing assemblies in the GAC vs. a local appllication directory

I have a C# (I am using VS2012) project that, when I checked it out of TFS, seemed to already reference an assembly in the GAC, but the DLL version I found in the GAC is incorrect and older than what the application expects, so I cannot build. 
Another developer here told me that all the applications are "self-contained," which would imply that they do NOT reference assemblies in the GAC.
My question is, if a project has a reference to a DLL that is not in the project's bin folder (or elsewhere in the project folder structure), does Visual Studio look for and automatically "fix up" the reference for the same DLL if it finds it in
the GAC?  I did not think it did that, and have always had a lot of assembly reference headaches when anything changes, so I am a little confused as to how this project came out of TFS already pointing to an assembly in the GAC (albeit the wrong version.) 
Since the code expects classes, properties, and methods that do not exist in the older version of the assembly in the GAC, I cannot build.
Thanks in advance for any tips on this kind of problem.

Hello PeterH084,
>> if a project has a reference to a DLL that is not in the project's bin folder (or elsewhere in the project folder structure), does Visual Studio look for and automatically "fix up" the reference for the same DLL if it finds it in the GAC? 
Since you application would load assembly in GAC, it should be strong named assembly, for such kind assemblies, the CLR would search for below location in order:
1. the global assembly cache
2. If there is a defined codebase, search for codebase definition and if the codebase specified path not found, it throws an error
3. The program's root directory
4. In the root directory, and the name of the referenced assembly subdirectories
5. In the a private subdirectory of the root directory
So it would firstly check the GAC, usually, I would do not deploy my private assembly to GAC and deploy it to the application directory as bin folder.
Regards.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.

Similar Messages

  • RunState.Caller.Locals.ReportOptions.Directory unknown in Teststand 2013

    Hello,
    I have a problem due to migration between TestStand 4.1.2 and TestStand 2013.
    In previous sequences I used the variables: RunState.Caller.Locals.ReportOptions.Directory, RunState.Caller.Locals.StartDate.Text, RunState.Caller.Locals.UUT.SerialNumber, RunState.Caller.Locals.ReportFilePath and others... without problem.
    Now in TestStand 2013, the variables cannot be evaluated , generates an Teststand error and thus I cannot personnalize my report name and directory.
    Hereafter the complete expression that cause problems:
    RunState.Caller.Locals.ReportOptions.Directory=FileGlobals.Report_Directory + "\\" + RunState.Caller.Locals.StartDate.Text + "\\" + RunState.Caller.Locals.UUT.SerialNumber ,
    RunState.Caller.Locals.ReportFilePath=FileGlobals.Report_Directory + "\\" + RunState.Caller.Locals.StartDate.Text + "\\" + RunState.Caller.Locals.UUT.SerialNumber + "\\" + "Report ["+ RunState.Caller.Locals.UUT.SerialNumber +"][" + Str(RunState.Caller.Locals.StartTime.Hours) +" "+ Str(RunState.Caller.Locals.StartTime.Minutes) +" "+ Str(RunState.Caller.Locals.StartTime.Seconds) + "]" + ".html",
    FileGlobals.UUT_Time = "[" + RunState.Caller.Locals.UUT.SerialNumber+"][" + Str(RunState.Caller.Locals.StartTime.Hours) +" "+ Str(RunState.Caller.Locals.StartTime.Minutes) +" "+ Str(RunState.Caller.Locals.StartTime.Seconds) + "]" , FileGlobals.fileDir=RunState.Caller.Locals.ReportOptions.Directory 
    Thanks for your help.

    If you using these expressions to set the report path and directory, then, do consider using TestStand expression to specify the report path in Report Options dialog. Its lot easier to use compared to setting values to subproperties of Runstate.Caller.Locals.ReportOptions variable.
    You can get more information in the following links
    http://zone.ni.com/reference/en-XX/help/370052K-01/tsref/infotopics/specifyreportfilepath_byexpressi...
    http://zone.ni.com/reference/en-XX/help/370052K-01/tsfundamentals/infotopics/reports_expressions/
    http://digital.ni.com/public.nsf/allkb/78E88742D0F8C3C5862576D4006B8E44
    Coming to your error, please provide more information regarding which sequence file and sequence did you modify.
    Also note that, in TestStand 2012, process models had major change to support plug-in architecture. Process models without the plug-in architecture (like the one used in TestStand 4.1.2) is installed in "<TestStand>\Components\Models\TestStandModels\TestStand 2010 Process Models (Legacy)" directory. If you want to migrate your process model changes, it might be valid to update the legacy process models instead of new models.
    You can see brief description of TestStand 2012 process model changes in http://zone.ni.com/reference/en-XX/help/370052K-01/tshelp/infotopics/2012whatsnew/#plugin
    - Shashidhar

  • Referenced assembly vspbatchparser.dll targets a different processor than the application

    referenced assembly c:\program files\microsoft visual studio 9.0\common\ide\microsoft.visualstudio.vspBatchPaser.dll
    targets a different processor than the application

    The message is telling you that you're trying to use an x86 assembly in an x64 process or vice versa. Given that the assembly is in the IDE subfolder of VS and VS is x86 I assume you are either compiling your app for x64 or you are running an x64 OS and
    your app is compiling with AnyCPU. Change it to x86 and it should work.
    Michael Taylor
    http://blogs.msmvps.com/p3net

  • Unable to include report viewer web part. Error is, assembly has a higher version than referenced assembly

    I am making a web part in VS 2010 for SharePoint 2010. The web part uses Report Viewer control. The files I have referenced in my project with "Copy Local = True" option are:
    Microsoft.ReportViewer.Common.dll  
    Microsoft.ReportViewer.WebForms.dll
    Both are version 10 files.
    When I build the project it works fine. But when I add this web part in a page it shows following error.
    Compiler Error Message: CS1705: Assembly 'MySolution, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8acc41a360fa228d' uses 'Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' which has a higher version
    than referenced assembly 'Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
    I have already installed both Report Viewer 10 redistribute able and its SP1 but no luck. Also copied these DLLs to my SharePoint site bin folder. Did iisreset many times. .Net framework is 3.5 and OS is Windows Server 2008 R2.
    How to fix this issue?

    Fixed it by updating my web.config which was referencing version 9 instead of 10.

  • Higher version than referenced assembly

    Getting the following error:
    Assembly 'NationalInstruments.DAQmx, Version=14.1.45.13, Culture=neutral, PublicKeyToken=4febd62461bf11a4' uses 'NationalInstruments.Common, Version=13.0.40.190, Culture=neutral, PublicKeyToken=dc6ad606294fc298' which has a higher version than referenced assembly 'NationalInstruments.Common, Version=13.0.40.188, Culture=neutral, PublicKeyToken=dc6ad606294fc298' 
    NI 14.1; MeasurementStudio2013; VisualStudio2012; Windows 8.1
    Solved!
    Go to Solution.

    Hi Vibhav92,
    Could you verify if 13.0.40.190 version (or higher) of NationalInstruments.Common.dll is present on your system (i.e in the .NET GAC folder and Mesurement Studio 2010 folder).
    .NET GAC folder: C:\Windows\Microsoft.NET\assembly\GAC_MSIL
    Measurement Studio 2010 folder: C:\Program Files (x86)\National Instruments\MeasurementStudioVS2010\DotNET\Assemblies (on 64-bit machine)
    If yes, please delete the current reference to NationalInstruments.Common.dll in your Visual Studio 2012 project and re-add the reference to NationalInstruments.Common.dll reference using the Add Reference dialog of Visual Studio 2012 in your project. Make sure the reference to NationalInstruments.Common.dll in your Visual Studio 2012 project is 13.0.40.190 or higher.
    - Raghavendra

  • Referenced Assembly BihConsumerInterop could not be found

    We have a fairly big SharePoint project where we use TFS, kicking of a build runs some tests and everything works as expected, but we get a warning:
    CA0060 : The indirectly-referenced assembly 'BihConsumerInterop, Version=14.0.0.0, Culture=neutral, PublicKeyToken=48e046c834625a88' could not be found. This assembly is not required for analysis, however, analysis results could be incomplete. This assembly
    was referenced by: C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\ISAPI\Microsoft.Office.Server.Search.dll.
    Now the solution according to other blogposts is to add the referenced DLL to the project, but it seems i cannot find anything about the assembly BihConsumerInterop, so I was wondering if there was anyone that knows a bit more about this DLL :)

    We are trying to execute unit tests on our build server and running into the same problem.
    It seems that BihConsumerInterop cannot be found anywhere on the server.
    We've tried adding Microsoft.Office.Server.Search.dll to the GAC, but this error still persists.
    Would love to hear from Microsoft on this before installing SharePoint on our server.
    zaanglabs.com |
    charliedigital.com | linkedin.com/in/charlescchen

  • Access C# class within referenced assembly

    Hi
    I have the following scenario:
    I have one solution with a BizTalk project and a c# helper class project. In the biztalk project I got an Orchestration with XML Schemas. In the c# helper class I have a method that creates a biztalk message based on the xml schemas. So I have two different
    assemblies, one for biztalk and the other one for the c# class. I want to call the orchestration within other projects.
    My idea is, that I want to reference the c# class in my biztalk project, so when I reference the biztalk assembly that I also have access to the c# objects. I have the same namespace for my c# class and my biztalk project. However, when I reference the biztalk
    assembly within another biztalk project, where I want to call the orchestration, I cannot access the c# objects.
    Any idea how I can achieve that I can access the c# objects?
    Regards
    Jerome

    Hi Jerome,
    Simple answer –No. You will not get the dependent/referenced assemblies of BizTalk-Project-A in BizTalk-Project-B when you reference BizTalk-Project-A. You have to add them
    manually.
    Runtime can access the helper assembly from GAC but during development/during design time for accessing the members of helper project (which is referenced in BizTalk-Project-A)
    it need to reference it in BizTalk-Project B again. This assembly won’t be added into BizTalk-Project-B when you reference BizTalk-Project-A.
    You’re right, it pain and it’s nice to have feature. But currently you have to manually add the dependant assemblies in BizTalk-Project B.
    This is one of the criteria you have to consider when implementing the project structure. When you have created a helper class in a separate project, you have partitioned
    the helper project as its independent entity. You have to reference it manually for your development tool to access the members of this assembly even through you have referenced a project which already has dependency over the helper project.
    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

  • Error occured in deployment step 'Add Solution': Error: Cannot add the specified assembly to the global assembly cache

    hi,
    I have created a separate project which contains a class which has some generic methods- its a Utility class.[ its a  class library project ]
    I added this dll into my SharePoint project's wsp package [package--> advanced-->add assembly project from output ]  [ SP 2013/ VS 2012]
    So till yesterday everything was working fine, its has successfully deployed in the GAC.
    But today when I tried to deploy my solution I got this error
    "Error occured in deployment step 'Add Solution': Error: Cannot add the specified assembly to the global assembly cache" .
      I closed the  VS and did iisreset , and uninstalled dll using powershell . and i  went to package removed the dll from the wsp package and deployed again.
    Now when i added  the  dll into this package again, it failed to deploy.
    can anyone tell ,  why this is happening. i have not done any changes in the dll yesterday or today.
    suddenly , it  started behavin stranegly. 

    Use the power shell command to delete dll
    http://www.c-sharpcorner.com/uploadfile/anavijai/how-to-install-or-uninstall-dll-in-gac-using-powershell/

  • Assemblies missing from GAC following reboot.

    Hi folks,
    I've inheried the support of a C# .net application that uses Crystal Reports XI, and built using Visual Studio 2003.  My knowledge of Crystal Reports is limited at best so apologies for any missing info or inaccuracies.
    This problem has happened a few times, and previous times I've fixed it by reinstalling the application - this isn't ideal as the web server is hosting other applications that isn't easy to take down for any length of time while I restart IIS.  The server is Windows Server 2003 SP1 and IIS version 6.0.  The application was built using the .Net framework 1.1 but other applications on the server are running on .Net framework 2.0.  I have no control over the OS or infrastructure (its supported by another contractor) so reboots can happen without any warning!
    Basically anytime a reboot of the server occurs, the Crystal Report assemblies registered in the GAC seem to disappear, leading to the following error:
    System.TypeInitializationException: The type initializer for 'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an exception
    Is there a reasonable fix to this problem?  My client isn't satisfied with reinstalling the application anytime a reboot takes place (are they ever though!).
    Does crystal reports have to be installed to the GAC at all?  I understand the use of the merge modules, but I'd prefer not to be using the GAC or registry at all.
    Any help would be great.
    Stuart.

    Hi Ludek,
    The only non-windows services running on the server are two applications developed by my own development team and they don't use the GAC in any way - its company policy not to do so.
    From investigating on the web, the closest possible answer is that the assemblies are still listed in the GAC but when a server runs a reboot the Autoexec.bat deletes information held in the WINDOWS/temp folder.  According the the post in the forum, crystal reports installation infromation is held in the temp folder - which if true is shocking practise!
    I've tried deleting the temp folder on a VM to see what effect this would have on the application, and right enough the forms won't run anymore but the exception received is that it can't find the report.
    Do you know if installation information is held in the temp folder?
    Stuart.

  • Referenced assembly does not have a strong name

    I generated an app for a Lenovo fan blog (www.thinkscopes.com) using appstudio.windowsphone.com, then I downloaded the source code and made a few more changes.
    I can build my app without checking the box 'sign the assembly'. But as soon as I select a strong name key file, I am getting these errors (see screenshots below)
    Can someone point me in the right direction? I have been trying to find a solution for 12 hours now.
    Jonas
    Microsoft MVP: Windows Consumer Expert
    Yoga Tablet 2 10 || ThinkPad X1 Carbon (20A7007MPH) || ThinkPad Helix (3698-6EU) || IdeaCentre B540
    Twitter: @jonashendrickx
    Solved!
    Go to Solution.

    EDIT: Found the solution accidentally, I signed AppStudio.Common.dll, and now it's finally working!
    http://www.codeproject.com/Tips/341645/Referenced-assembly-does-not-have-a-strong-name
    Cheers!
    Jonas
    Microsoft MVP: Windows Consumer Expert
    Yoga Tablet 2 10 || ThinkPad X1 Carbon (20A7007MPH) || ThinkPad Helix (3698-6EU) || IdeaCentre B540
    Twitter: @jonashendrickx

  • I can't get my project to share. A pop up screen comes up saying, "This item can't be shared while it is still referencing media on the camera". Does anyone know what this means.

    I can't get my project to share. A pop up screen comes up saying, "This item can't be shared while it is still referencing media on the camera". Does anyone know what this means. I'm confused because I don't have a camera hooked up to my computer.

    may you have directly imported clip to timeline without copying it to local drive..
    update project for links and check if missing clips are there..
    reconnect it if you have it on local drive..

  • How to find referenced photos within the Photos app

    Problem:
    Upon instructing Photos to use iCloud Photo Library, the app informed me:
    "104 referenced files in your library will not upload to iCloud Photo Library. Select referenced files in your library and choose 'Consolidate' from the File menu to copy the original files into the library."
    I do not know which 104 images in my library are referenced, and therefore cannot use "Consolidate" to import the masters into the library.
    Can anyone tell me how to find referenced files, within the active library in the Photos app?
    I am not asking how to use the "Show Referenced File in Finder" menu command. I need to identify a file as referenced first, hence this post!

    Gotcha - came up with a workaround... since the photos were living in the Photo Library packaged itself, and not simply in another regular folder, I right clicked on the library and said show packaged content, then search for what folders the files lived in, then copied the files out of the packaged library into a folder. Then I was able to give the Photos Library access to the new folder with the files.
    With all my files now references, I enabled iCloud Photo Library and am uploading now.
    Hopefully my new local Photo Library will be smart enough to optimize local images and shrink to give me more space.
    Thanks.

  • Want to open a new browser window and display the html file in locale disk.

    Hi,
    I want to open a new browser window and display the html file in local drive. The below html applet work in local system successfully. But i deploy the same in web server (Tomcat) and try the same in client machine it does not work. Please help.
    Note:
    The class below fileopen.FileOpen.class i make it as a jar and put it in jre\ext folder at the client machine.
    ------------------------------------FileOpen.html(Tomcat)-----------------------------------------------------
    <html>
    <body >
    <applet code="OpenFile.class" archive="loadfile.jar" width="100" height="100">
    <param name="path" value="file://c:/open.html" />
    </applet>
    </body>
    </html>
    -------------OpenFile.java in server(Tomcat)--------------------------------------------
    public class OpenFile extends Applet implements ActionListener{
    String path = "";
    fileopen.FileOpen open = null;
    Button b = null;
    public void init(){
    path = getParameter("path");
    b = new Button("Open");
    b.addActionListener(this);
    add(b);
    public void actionPerformed(ActionEvent ae){
    try
    open = new fileopen.FileOpen(this,path);
    catch (Exception e){
    e.printStackTrace();
    -------------------------------------------FileOpen.java /Client JRE/ext----------------------------------------------------
    package fileopen;
    public class FileOpen
    AppletContext context = null;
    URL url = null;
    public FileOpen(Applet applet,String path)
    try
    if(null != applet){
    context = applet.getAppletContext();
    if (null != path)
    url = new URL(path);
    context.showDocument(url, "_blank");
    }catch(Exception ex)
    ex.printStackTrace();
    Please help to solve this issue very urgent.
    Thanks in advance.
    By,
    Saravanan.K.

    zzsara wrote:
    I want to open a new browser window and display the html file in local drive. ...Did you ever pause to consider how ridiculous that is?
    The best audience for applets is people off the internet. 'People off the internet' might be using a computer that has no (what was it?) 'open.html' in the root of the C: drive. In fact (shock horror) they may not even be running Windows, and would therefore probably have no 'C:' drive at all.
    If you do not intend to distribute this to people off the web, an application makes a lot more sense, but even then, you cannot rely on the document being there unless you 'put it there' (during installation, for instance).
    As the other poster intimated, applets can load documents off the local disk as long as they are trusted. Here is an example*, but note that it is not so rash as to presume any particular path or file, and instead leaves it to the user to choose the document to display.
    * The short code can be seen at SDNShare on the [Defensive Loading of Trusted Applets|http://sdnshare.sun.com/view.jsp?id=2315] post.
    On the other hand, a sandboxed applet can load any document coming from its own server via URL, or get showDocument(URL) to work. In that case, the JRE must recognize that the URL is from its own server, so the best way to form URLs for applet use is via the URL constructor
    new URL(getDocumentBase(), "path/to/open.html");That is how I form the URL in this [ sandboxed example of formatting source|http://pscode.org/fmt/sbx.html?url=/jh%2FHelpSetter.java&col=2&fnt=2&tab=2&ln=0]. Of course, in this case the applet loads the document, then parses the text to draw the formatted version, but the point is that an URL produced this way will work with showDocument(URL).
    I am pretty sure showDocument() in an applet off the internet will work with an URL pointing to a foreign (not its own) server, but it will not be able to load documents off the end user's local disks.
    I suggest a couple of things.
    - Try to express this problem in terms of what feature it is that you want to offer the end user. Your question jumps directly to a bad strategy for achieving ..who knows what? An example of a feature is "Shows the applet 'help' files on pressing F1".
    - A good way to indicate interest in a solution is to offer [Duke stars|http://wikis.sun.com/display/SunForums/Duke+Stars+Program+Overview] to match that interest.
    Edit 1:
    ..and please figure out how to use the CODE tags.
    Edited by: AndrewThompson64 on Sep 12, 2008 11:14 PM

  • I tried to update iTunes yesterday.  The update failed.  Now when I try to open iTunes it says that the version isn't localized and needs to be run in English.  It has never been in another language.

    I attempted to update iTunes yesterday.  The update failed.  iTunes now won't open and displays an error message that the program isn't localized and needs to be run in the English version.  I'm in the US and the computer and program has never been used in another language.  I tried reinstalling the full download for the new version and that failed as well.  I logged out; shut down; restarted; retried the update; etc.  Still no luck and the same message.  Thoughts?

    Solving MSVCR80 issue and Windows iTunes install issues.
    Thanks to user turingtest2 for this solution.
    Solving MSVCR80 issue and Windows iTunes install issues.
    If the above doesn’t do the trick entirely, then use the instructions in the following as it applies to the version of Windows you are using:
    HT1925: Removing and Reinstalling iTunes for Windows XP
    HT1923: Removing and reinstalling iTunes for Windows Vista, Windows 7, or Windows 8
    You may be required to boot into safe mode to complete the folder deletion process.

  • How can I see the PC on my local network

    How can I see the PC on my local network. With Leopard installed I see the others Mac on the network but ot the PC. But the PC see me. What happen and How I can resolve that.

    Have you tried connecting to the PC via the Finder's "Connect to Server…" and used the IP address?
    It would be smb://server.ip.address/sharename
    Do you have the workgroup set up in the network preferences for the service that you are connected to your LAN with.
    There is also a problem on Leopard where the workgroup doesn't stay set, so if that is the case, you need to duplicate the service (ethernet, airport, etc) and use the duplicate. You can then remove the original.

Maybe you are looking for

  • Problem in mail address

    Hi I want to enquire about an issue  in which when someone changes the sales order a E-mail has sent to customer notifying about the same .Initially the address from which the email is sent was "noreply @company.com" but now address from which the E-

  • After install Crystal Report Server 2011, can not access control tool

    After install Crystal Report Server 2011, can not access cntrol tool from web or from application. My server OS is Windows 2008 R2 SP1. I follow the fedault setting. How to fix it? Error message:

  • Link Problem with libgc_dbg

    Hi there, I'm using Forte6 on Sun SPARC Solaris 2.7. When trying to use the memory monitor tool from the Forte6 environment I get a link failure: <code> $ CC -v -library=gc_dbg -o memtest memtest.C ### CC: Note: LM_LICENSE_FILE = 1726@licserva:1726@l

  • FTXP Issue -Help me

    Hi, I am configuring out put tax and input tax in FTXP.I have to enter the tax percentage A/R Sales Tax 1  against MW1 under accrued head.but this field is in grey color mode and not able to enter the tax rate.it is open the field A/R Sales Tax 3  ag

  • MB1,1 builtin iSight only works for 2 days after disassembly

    macbook 1,1 running 10.6.4 Not showing up in profile. Researched extensively and tried everything (SMC+PRM reset, boot into safe mode, different user account, installed another isight camera, reconnected the usb cable on the back of the camera, insta