1

I have an issue with a project finding multiple versions of the same assembly. System.Web.Mvc for example:

enter image description here

I want to make sure that our MVC projects will never find such an outdated dll from anywhere except out NuGet sources.

I realize it's not a good idea to go about removing the conflicting versions from system since a lot of applications may be depending on them. For example, this one was found in C:\Program Files (x86)

Update:

Since we use NuGet, I changed the:

Project > Properties > Build > Output > Output path: to C:\Temp\Drop

in every project (we have some portable area class library projects aswell) and then

Project > Properties > Reference Paths and added C:\Temp\Drop

And the problem went away.

Would this be the correct way of going about it or am I just opening another can on worms here?

5
  • Do you have resharper or some other similar plugin? Commented Oct 10, 2014 at 6:49
  • The GAC is used at runtime - it's not used at design/compile time by visual studio. However you're getting the reference to version 4.0.0.0, it's not coming from the GAC. Commented Oct 10, 2014 at 6:50
  • Yeah, I noticed, it was looking into different location. Somewhere C:\Program Files (x86) Commented Oct 10, 2014 at 6:52
  • I just edited and re-scoped the question since this has nothing to do with GAC in the first place. Commented Oct 10, 2014 at 6:58
  • If its not GAC then your fix would work, it is similar to system path for binary probing in windows, however you need to ensure the same / similar path on all the deployed systems Commented Oct 10, 2014 at 7:06

1 Answer 1

2

Check the following article related to assembly binding and probing, it's quite good:

MSDN - Assembly Probing

Check this Article too.

There's a complete hierarchy which is used to find an assembly, for strongly named assemblies GAC would be the first place, in your case you are using strongly named assembly. As explained in the article you should be able to direct your application to the correct assembly version at the runtime

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks, I'll definitely have a look at those :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.