Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / September 2004

Tip: Looking for answers? Try searching our database.

Publisher Policy not working in .NET 1.1

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
gimpy - 15 Jul 2004 01:01 GMT
I have a .NET 1.0 component in the GAC that I want to re-compile with .NET 1.1 so that I can use it on machines that have only the 1.1 runtime.  So I compiled in 1.1 with a new version number and created a publisher policy assembly which I also added to the GAC as policy.1.0.MyAssembly.  I remove the old assembly and add the new assembly and policy to the GAC.  

But when I run the ASP.NET application compiled for the old component, it says assembly not found even though it also says the Publisher policy file is found.  Does this mean publisher policy files are broken in .NET 1.1?  If I go into the Framework Configuration MMC and configure the assembly it works fine.  Anyone have any suggestions?

Here is what the log shows on the error:
=== Pre-bind state information ===
LOG: DisplayName = MyAssembly, Version=1.0.1027.19127, Culture=neutral, PublicKeyToken=133297ceedec1c0d
(Fully-specified)
LOG: Appbase = file:///c:/inetpub/wwwroot/MyApp
LOG: Initial PrivatePath = bin
Calling assembly : (Unknown).
===

LOG: Publisher policy file is found at C:\WINDOWS\assembly\GAC\policy.1.0.MyAssembly\1.1.0.0__133297ceedec1c0d\policy.1.0.MyAssembly.config.
LOG: No redirect found in host configuration file (C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\aspnet.config).
LOG: Using machine configuration file from C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\config\machine.config.
LOG: Post-policy reference: MyAssembly, Version=1.0.1027.19127, Culture=neutral, PublicKeyToken=133297ceedec1c0d
LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET Files/custtraxii/d69cd8e8/47ae0587/MyAssembly.DLL.
LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET Files/custtraxii/d69cd8e8/47ae0587/MyAssembly/MyAssembly.DLL.
LOG: Attempting download of new URL file:///c:/inetpub/wwwroot/CustTraxII/bin/MyAssembly.DLL.
LOG: Attempting download of new URL file:///c:/inetpub/wwwroot/CustTraxII/bin/MyAssembly/MyAssembly.DLL.
LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET Files/custtraxii/d69cd8e8/47ae0587/MyAssembly.EXE.
LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET Files/custtraxii/d69cd8e8/47ae0587/MyAssembly/MyAssembly.EXE.
LOG: Attempting download of new URL file:///c:/inetpub/wwwroot/CustTraxII/bin/MyAssembly.EXE.
LOG: Attempting download of new URL file:///c:/inetpub/wwwroot/CustTraxII/bin/MyAssembly/MyAssembly.EXE.

Here is the policy file:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <runtime>
     <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="MyAssembly" publicKeyToken="133297ceedec1c0d" culture="nuetral" />
       
        <bindingRedirect oldVersion="1.0.0.0 - 65535.65535.65535.65535" newVersion="1.1.0.0" />
      </dependentAssembly>
     </assemblyBinding>
  </runtime>
</configuration
Richard Blewett [DevelopMentor] - 12 Sep 2004 08:27 GMT
It suggests to me that the config file that you created to generate your publisher policy is incorrect. If it has syntax issues it will be ignored (rather than report an error). Or you may have got the oldVersion wrong

Regards

Richard Blewett - DevelopMentor
http://staff.develop.com/richardb/weblog
?
nntp://news.microsoft.com/microsoft.public.dotnet.framework/
I have a .NET 1.0 component in the GAC that I want to re-compile with .NET 1.1 so that I can use it on machines that have only the 1.1 runtime. So I compiled in 1.1 with a new version number and created a publisher policy assembly which I also added to the GAC as policy.1.0.MyAssembly. I remove the old assembly and add the new assembly and policy to the GAC.

But when I run the ASP.NET application compiled for the old component, it says assembly not found even though it also says the Publisher policy file is found. Does this mean publisher policy files are broken in .NET 1.1? If I go into the Framework Configuration MMC and configure the assembly it works fine. Anyone have any suggestions?

Here is what the log shows on the error:
=== Pre-bind state information ===
LOG: DisplayName = MyAssembly, Version=1.0.1027.19127, Culture=neutral, PublicKeyToken=133297ceedec1c0d
(Fully-specified)
LOG: Appbase = file:///c:/inetpub/wwwroot/MyApp
LOG: Initial PrivatePath = bin
Calling assembly : (Unknown).
===

LOG: Publisher policy file is found at C:\WINDOWS\assembly\GAC\policy.1.0.MyAssembly\1.1.0.0__133297ceedec1c0d\policy.1.0.MyAssembly.config.
LOG: No redirect found in host configuration file (C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\aspnet.config).
LOG: Using machine configuration file from C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\config\machine.config.
LOG: Post-policy reference: MyAssembly, Version=1.0.1027.19127, Culture=neutral, PublicKeyToken=133297ceedec1c0d
LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET Files/custtraxii/d69cd8e8/47ae0587/MyAssembly.DLL.
LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET Files/custtraxii/d69cd8e8/47ae0587/MyAssembly/MyAssembly.DLL.
LOG: Attempting download of new URL file:///c:/inetpub/wwwroot/CustTraxII/bin/MyAssembly.DLL.
LOG: Attempting download of new URL file:///c:/inetpub/wwwroot/CustTraxII/bin/MyAssembly/MyAssembly.DLL.
LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET Files/custtraxii/d69cd8e8/47ae0587/MyAssembly.EXE.
LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET Files/custtraxii/d69cd8e8/47ae0587/MyAssembly/MyAssembly.EXE.
LOG: Attempting download of new URL file:///c:/inetpub/wwwroot/CustTraxII/bin/MyAssembly.EXE.
LOG: Attempting download of new URL file:///c:/inetpub/wwwroot/CustTraxII/bin/MyAssembly/MyAssembly.EXE.

Here is the policy file:

   

[microsoft.public.dotnet.framework]
gimpy - 21 Sep 2004 01:05 GMT
As far as I could tell there was nothing wrong with the config.  I was in the
original post but I also included it below.
FYI I tried several different variants of the version number with the same
result.

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
 <runtime>
     <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
     <dependentAssembly>
       <assemblyIdentity name="MyAssembly"
publicKeyToken="133297ceedec1c0d" culture="nuetral" />
       
       <bindingRedirect oldVersion="1.0.0.0 - 65535.65535.65535.65535"
newVersion="1.1.0.0" />
     </dependentAssembly>
     </assemblyBinding>
 </runtime>
</configuration>

> It suggests to me that the config file that you created to generate your publisher policy is incorrect. If it has syntax issues it will be ignored (rather than report an error). Or you may have got the oldVersion wrong
>
[quoted text clipped - 40 lines]
>
> [microsoft.public.dotnet.framework]
Richard Blewett [DevelopMentor] - 21 Sep 2004 07:34 GMT
You've spelled neutral wrong, is that a straight cat and paste of the file?

Regards

Richard Blewett - DevelopMentor

http://staff.develop.com/richardb/weblog

  nntp://news.microsoft.com/microsoft.public.dotnet.framework/<0785A515-FF73-4942-8086-57CCA33B5550@microsoft.com>

As far as I could tell there was nothing wrong with the config. I was in the
original post but I also included it below.
FYI I tried several different variants of the version number with the same
result.

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="MyAssembly"
publicKeyToken="133297ceedec1c0d" culture="nuetral" />

<bindingRedirect oldVersion="1.0.0.0 - 65535.65535.65535.65535"
newVersion="1.1.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>



"Richard Blewett [DevelopMentor]" wrote:

> It suggests to me that the config file that you created to generate your publisher policy is incorrect. If it has syntax issues it will be ignored (rather than report an error). Or you may have got the oldVersion wrong
>
[quoted text clipped - 38 lines]
>
> [microsoft.public.dotnet.framework]




[microsoft.public.dotnet.framework]
gimpy - 21 Sep 2004 15:17 GMT
Man, do I feel stupid!  I have a rule that I forgot in this case: When all
else fails, look for a typo.  Thanks!

> You've spelled neutral wrong, is that a straight cat and paste of the file?
>
[quoted text clipped - 93 lines]
>  
>  [microsoft.public.dotnet.framework]
Ravichandran J.V. - 21 Sep 2004 12:51 GMT
I believe you are using the app.config file. Copy/paste the
assemblyBinding tag to the web.config and it will work. In Asp.Net, the
config file that the CLR looks for is web.config not app.config.

with regards,

J.V.Ravichandran
Signature

- http://www.geocities.com/
 jvravichandran
- http://www.411asp.net/func/search?
 qry=Ravichandran+J.V.&cob=aspnetpro
- http://www.southasianoutlook.com 
- http://www.MSDNAA.Net 
- http://www.csharphelp.com
- http://www.poetry.com/Publications/
 display.asp?ID=P3966388&BN=999&PN=2
- Or, just search on "J.V.Ravichandran"
 at http://www.Google.com


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.