Search code examples
.netvisual-studio-2012.net-assemblyassembly-resolution

Assembly un-identified loading behavior


I'm developing an asp.net website (solution type is website), and there is an assembly X.
The odd behavior here is that Visual Studio is not picking the version from the Bin folder, but another assembly with the same name but higher version from some temp location identified in object browser as below:

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\alahlibank\10cbb559_shadow\a12d1777\3960\

what's really getting on my nerve is that the assembly is not even in the GAC which cast away the possibility that it's been fetched from there (not strongly named)

whenever i try to compile the project it will fail as per it's referencing the wrong assembly

enter image description here

some other info about the situation is that the version being supplied in the bin folder is v1.0.0.0 and the one fetched (i don't know from where) is v3.0.0.0 but have the same name

enter image description here

enter image description here


Solution

  • just in case anyone is having this "weird" thing going on, signing and deploying to the GAC seems to solve this hell
    buffered.io/posts/net-fu-signing-an-unsigned-assembly-without-delay-signing/

    quoting from @stakx

    Perhaps you should look into what the "Temporary ASP.NET Files" folder is. Thinking about how that version 3.0.0.0 of your DLL got there in the first place might shed some light on your issue. (Perhaps through dynamic compilation done by ASP.NET; the mention of an assembly called App_Code… in one of your screenshots seems to hint at this.)