开发者

Determine Project References to mscorlib

开发者 https://www.devze.com 2022-12-17 06:12 出处:网络
Hey folks, I\'ve got an ASP.NET web site project that for some reason is insisting on referencing both mscorlib 1.0.5 and mscorlib 2.0, and I can\'t figure out why.

Hey folks, I've got an ASP.NET web site project that for some reason is insisting on referencing both mscorlib 1.0.5 and mscorlib 2.0, and I can't figure out why.

I've analyzed all the referenced DLLs using NDepend, and they all appear to only reference mscorlib 2.0. I've got a couple web references, but I can't imagine why that would create an additional reference to the 1.0 dll.

Anyone have any ideas why I'd be getting this additional reference, or what I can use to find out that information? NDe开发者_开发技巧pend is great, but just comes back and says "found 2 references, using the newer version", so it doesn't help me figure out why I have the extra reference...


I think at this point your best bet is to use ildasm. Using ildasm on the assembly will bring up a node named "Manifest". Double click on that node and it will dump out the IL representation of assembly references including the referenced version number. Repeat this for all of your DLL's until you find the one referencing the 1.0 version.

EDIT

Another possible solution would be to enumerate the Assembly values and there associated GetReferencedAssemblies method. This will return an array of AssemblyName values which have a corresponding Version member. This should contain the actual version of the referenced assembly vs. the one that was actually loaded.

I'm not 100% sure on this matter and don't have a convenient way to test it right now.


Try removing the reference and recompiling - that will tell you what (if anything) depends on the older version.


An errant refernence may be residing in your web.config file.

Kindness,

Dan

0

精彩评论

暂无评论...
验证码 换一张
取 消