Specify which assembly to load

S

Sanjin

I have assembly A.dll installed in the global assembly cache. I have also
the source code for assembly A.dll and assembly is included in the one of my
project.



I can not debug my application and step into functions and classes in the
assembly A. I can step into only when I remove assembly A.dll from the
global assembly cache.



I tried to use codeBase configuration element in the app.config but seems
that runtime always load one from cache.



Here is my codeBase element:





<?xml version="1.0" encoding="utf-8" ?>

<configuration>


<runtime>


<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">


<dependentAssembly>


<assemblyIdentity name="A.dll" version="2.0.0.0"

publicKeyToken="rzu13872c919c214" culture="neutral"/>


<codeBase version="2.0.0.0" href="file:///D:/MyProject
/bin/Debug/A.dll"/>


</dependentAssembly>

</assemblyBinding>


</runtime>

</configuration>



Thanks in advance



Sanjin
 
M

Michael Nemtsev, MVP

Hello Sanjin,

I recommend to read this article to understand how the CLR locates assemblies
http://msdn2.microsoft.com/en-us/library/yx7xezcf(vs.71).aspx

---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo


S> I have assembly A.dll installed in the global assembly cache. I have
S> also the source code for assembly A.dll and assembly is included in
S> the one of my project.
S>
S> I can not debug my application and step into functions and classes in
S> the assembly A. I can step into only when I remove assembly A.dll
S> from the global assembly cache.
S>
S> I tried to use codeBase configuration element in the app.config but
S> seems that runtime always load one from cache.
S>
S> Here is my codeBase element:
S>
S> <?xml version="1.0" encoding="utf-8" ?>
S>
S> <configuration>
S>
S> <runtime>
S>
S> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
S>
S> <dependentAssembly>
S>
S> <assemblyIdentity name="A.dll" version="2.0.0.0"
S>
S> publicKeyToken="rzu13872c919c214" culture="neutral"/>
S>
S> <codeBase version="2.0.0.0" href="file:///D:/MyProject
S> /bin/Debug/A.dll"/>
S>
S> </dependentAssembly>
S>
S> </assemblyBinding>
S>
S> </runtime>
S>
S> </configuration>
S>
S> Thanks in advance
S>
S> Sanjin
S>
 
M

Michael Nemtsev, MVP

Hello Sanjin,

And I strongly recommend to read this one http://damon.agilefactor.com/2005/11/fun-with-assembly-probing.html

---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo


S> I have assembly A.dll installed in the global assembly cache. I have
S> also the source code for assembly A.dll and assembly is included in
S> the one of my project.
S>
S> I can not debug my application and step into functions and classes in
S> the assembly A. I can step into only when I remove assembly A.dll
S> from the global assembly cache.
S>
S> I tried to use codeBase configuration element in the app.config but
S> seems that runtime always load one from cache.
S>
S> Here is my codeBase element:
S>
S> <?xml version="1.0" encoding="utf-8" ?>
S>
S> <configuration>
S>
S> <runtime>
S>
S> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
S>
S> <dependentAssembly>
S>
S> <assemblyIdentity name="A.dll" version="2.0.0.0"
S>
S> publicKeyToken="rzu13872c919c214" culture="neutral"/>
S>
S> <codeBase version="2.0.0.0" href="file:///D:/MyProject
S> /bin/Debug/A.dll"/>
S>
S> </dependentAssembly>
S>
S> </assemblyBinding>
S>
S> </runtime>
S>
S> </configuration>
S>
S> Thanks in advance
S>
S> Sanjin
S>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top