PC Review


Reply
Thread Tools Rate Thread

Assembly Redirection does not work

 
 
=?Utf-8?B?TWlrZSBMb2dhbg==?=
Guest
Posts: n/a
 
      25th Jan 2005
Hello,

I am having a hard time redirecting a VB.Net assembly. The old and new
assemblies are version major 1 and minor 0. The build and revision number
are different.
1.0.1519.15373 to 1.0.9.9

I tried creating binding policy using the same keyfile as the original and
new assembly and a config file. I named the new policy assembly
Policy.1.0.MyAssembly.dll. That didn't work. I looked in the .Net
Configuration tool under configured assemblies, and their was a binding
redirect to the new version. That also updated my machine.config

That didn't work. Private web application assemblies on my machine are
still referencing the old assembly.

I also tried adding the new assembly to the GAC, and inserting something
into the machine.config manually and that didn't work.

What am I doing wrong?

Also, If I change an assembly redirection, do I have to restart my machine?
or what should I do.

Thanks for your help.
--
Mike Logan
 
Reply With Quote
 
 
 
 
Steven Cheng[MSFT]
Guest
Posts: n/a
 
      26th Jan 2005
Hi Mike,

As for the redrection problem you mentioned, I'm thinking whether there is
something incorrect with the Redirection config. Have you tried test the
redirection in a simple winform or console app and use a app.config to
specify the redirction. Based on my local test , I can correctly get the
redirection work in both a winform and asp.net app. The <bindingRedirect>
is specified in app.conifg (and web.config). Also, I didn't use
PublisherPolicy assembly and didn't put the assembly in GAC yet, my config
file is like below;

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="MyLib"
publicKeyToken="0558bab96e18ec01"
culture="neutral" />

<bindingRedirect oldVersion="1.0.1519.15373"
newVersion="1.0.9.9"/>

<codeBase version="1.0.9.9"

href="file:///D:\workspace\dotnet\CS\AsmVersionApp\MyLib\asms\V1.0.9.9\MyLib
..dll"/>

</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

================================

I use codeBase here to specify the location of the "1.0.9.0" assembly( no
need to do this is put in GAC).

You can have a try and let me know if you have any further problem.
BTW, though I put the strong-named assembly in private bin when testing in
asp.net, it is recommend that all the strong-named assembles put into GAC
when used in asp.net web app.

Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
programmatic assembly redirection (late binding?) Ralf Steinstraesser Microsoft Dot NET 2 5th Nov 2009 10:46 PM
Assembly redirection problems... Sinex Microsoft Dot NET Framework 1 22nd Feb 2007 05:35 PM
Assembly redirection: Publisher Policy =?Utf-8?B?Tm9ubmll?= Microsoft Dot NET Framework 0 5th Jun 2006 01:28 PM
Assembly version redirection in web.onfig =?Utf-8?B?Sm9zZSBBbnRvbmlv?= Microsoft ASP .NET 2 6th Feb 2006 07:41 AM
Assembly Redirection =?Utf-8?B?U3RhdnJvcyBNZW5lZ29z?= Microsoft Dot NET Framework 0 14th Apr 2004 01:06 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:14 PM.