views:

218

answers:

3

Hi!

i currently programming a program in visual studio using the .net 3.5 framework and the microsoft interops to interact with the office products. I have an issue with the app.config file. everytime i compile my solution, rebuilt or build it a warning occurs in the error list witch says

Found conflicts between different versions of the same dependent assembly.

when i double click this message visual studio tries to solve the problem, but with the next built the warning occurs again. i checked in the app.config file what visual studio tries to fix the problem and it seems, that it inserts these lines

<runtime>
 <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
  <dependentAssembly>
   <assemblyIdentity name="office" publicKeyToken="71E9BCE111E9429C" culture="neutral"/>
   <bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0"/>
  </dependentAssembly>
  <dependentAssembly>
   <assemblyIdentity name="Microsoft.Vbe.Interop" publicKeyToken="71E9BCE111E9429C" culture="neutral"/>
   <bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0"/>
  </dependentAssembly>
 </assemblyBinding>
</runtime>

i think that the bindingRedirect fails because of the version numbers but i can't edit them, because of the already "solve problem - build - problem occurs" thingy.

does anybody has any idea what might go wrong. i do not have any clue.

thanks for every idea!

A: 

Is this any help?

http://social.msdn.microsoft.com/Forums/en-US/netfxcompact/thread/73d1b418-0b2d-4649-b491-21b39a468457

CodeByMoonlight
hi!!this looks quiet interesting. funny, i googled days and days but never found this post! thank you !!
Sheldon
A: 

Jinx. I'm on SO researching a similar issue with dependencies to Office assemblies. In my case, I need to support older Office versions that I don't have installed on my DEV box (but are installed on a build server).

I decided to try the MS Office Wrapper for .Net open source project I discovered on one of the posts here. It claims to support all versions of Office from 97 to 2007 (as long as you limit yourself to API calls that are available in the oldest version you need to remain compatible with).

Perhaps using that wrapper would solve/simplify your Office version dependency as well.

Eric J.
Hi!Thanks you very much for mentioning the wrapper. The problem is, that my program is already completed. I don't want to rewrite all commands using this wrapper. But i will have a look at it and maybe for further versions migrate on this! thank you anyway!!
Sheldon
I'm in pretty much the same boat... program is done and considering whether to refactor. I ended up writing a little parser that runs on the build machine that looks in the .csproj file for version references and changes them to the version installed on that build server. If you don't have a separate server, a virtual PC works great as well.
Eric J.
A: 

hi !

i checked the link at msdn but the solution

My solution to the same problem was the following:

  • Double click in the Solution Explorer on 'My Project'
  • Click the 'References'-tab at the left
  • Click the 'Unused references...'-button (right top), a list of unused references appears in a new box that opens
  • Click the 'Remove'-button.

Now rebuild your project and your problem is gone.

did not work out. any other ideas?

thank you

Sheldon