0

I have a class library, where i need to redirect an assembly version (http://msdn.microsoft.com/en-us/library/7wd6ex19.aspx). But everywhere it is stated to do this in a config file. But i do not have a config file to my disposal.

The error occurs during the nightly build on TeamFoundationServer for a particular Solution. So only for this solution (cq project) i want to set the right dependentAssembly.

How do i 'create' a config file for one class library project?

Dennis
  • 1,810
  • 3
  • 22
  • 42

2 Answers2

0

The main problem of the issue, was the CA0055 error i did get during the nightly build on TFS. Because it is a problem of a class library build by the build server of TFS, i do not have a 'calling' program like a .exe of a website. So I do not have any config file to set this.

Or i need to find the config file (or program) TFS uses to build the nightly builds. Becuase i could not find any file, i still got the error.

But... Finally i did find the solution. The problem occurred during code analysis, and did some searching on that. At one point i found the following post:

Code Analysis error Could not load file or assembly 'System.Net.Http, Version=2.0.0.0 in MVC4 Web API

The solution is to change the config file of FxCopCmd.exe in one or more places in the program files directory. I found two FxCopCmd.exe.config files, and changed the following setting to:

<add key="AssemblyReferenceResolveMode" value="StrongNameIgnoringVersion" />

And i did not get the error i got.

Community
  • 1
  • 1
Dennis
  • 1,810
  • 3
  • 22
  • 42
-1

You should do this in your original App.Config file, if the assembly is loaded as reference in an application.

<dependentAssembly>
        <assemblyIdentity name="YourAssemblyName"
          publicKeyToken="xxxxx"
          culture="en-us" />

        <bindingRedirect oldVersion="1.0.0.0" newVersion="2.0.0.0" />
      </dependentAssembly>
Piyush Parashar
  • 866
  • 8
  • 20
  • 1
    I know, but where is the app.config file for the Build server on TeamFoundationServer 2013? Becuase it is a class library, it does not have a config file. The Build is running from TeamFoundationServer 2013. – Dennis Nov 25 '14 at 09:47