none
problem loading Microsoft.interop.Security.AzRoles Version 2.0.0.0 RRS feed

  • Question

  • Could not load file or assembly 'Microsoft.Interop.Security.AzRoles, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

    I am using the AuthorizationStoreprovider in ASP.NET 2.0 and am calling Roles.UserIsInRole method, and I get the error message above.....

     

    But this is a Vista file and I only have 1.2.0.0 version installed on my xp developer machine.

    Why is it looking for this file instead of the version 1.2.0.0 one? It worked a few weeks ago, and the only thing I can think of having installed is WSE 3.0, but the other developers in my group has also done this without getting this problem.

    //jonas

    Tuesday, August 21, 2007 1:37 PM

Answers

  • Afaik AzMan has been "upgraded" on vista.. So if the project was developed on Vista i would expect the developer added a reference to the assembly he had overthere....

    In case you are sure that he didn't use 2.0.0.0 specific functionality you might want to read Redirecting Assemblies so that you can configure the runtime that it loads 1.2.0.0 instead...
    Thursday, August 23, 2007 3:55 PM
  • Hi Jonas,

     

    I agree with timvw.

     

    As with any publisher policy, in cases where you may not want to redirect code to call the new PIA, you can override the policy by using the following tag in an application configuration file shipped with your managed assembly.

     

    <publisherPolicy apply="no"/>

     

    Visit here for more details: http://msdn2.microsoft.com/en-us/library/cf9025zt.aspx

     

    Hope this helps!

     

    Thanks!

    Friday, August 24, 2007 8:29 AM

All replies

  • Hi Jonas,

     

    You can first try to install the Windows Server 2003 Administration Tools Pack which included the necessary libraries for your application. And see if the problem still exists.

     

    Thanks!

    Thursday, August 23, 2007 8:13 AM
  • I have tried this a number of times, but unfortunately no change. Somehow the setting which tells the AuthorizationStoreprovider which version to load has been changed from 1.2.0.0 to 2.0.0.0 and I just can't understand why. And I would really like to change the setting back. Is there somekind of registry key or some kind of config file where you can change this perhaps?

     

    Thursday, August 23, 2007 8:43 AM
  • Afaik AzMan has been "upgraded" on vista.. So if the project was developed on Vista i would expect the developer added a reference to the assembly he had overthere....

    In case you are sure that he didn't use 2.0.0.0 specific functionality you might want to read Redirecting Assemblies so that you can configure the runtime that it loads 1.2.0.0 instead...
    Thursday, August 23, 2007 3:55 PM
  •  

    Yes, I am very sure I didn't use 2.0.0.0 functionality and no developer use vista in our company. I have checked all references in my project and they are allto azman 1.2.0.0. Its not my project that has an incorrect reference, it is the system.web assembly, its AuthorizationStoreProvider which I have set as rolemanager is the culprit. Thats the class that calls the interop assembly. I have no power over which assembly it calls, unless I find out where to set the version. I do not understand how all of a sudden it starts trying to load 2.0.0.0 on just my machine. I have only installed WSE 3.0, but so have all the other developers also and they dont have the same problem. I will read the suggested article to see if I can change which assembly version the system.web calls. Thank you for your suggestion, any help is much appreciated.
    Thursday, August 23, 2007 5:18 PM
  • Hi Jonas,

     

    I agree with timvw.

     

    As with any publisher policy, in cases where you may not want to redirect code to call the new PIA, you can override the policy by using the following tag in an application configuration file shipped with your managed assembly.

     

    <publisherPolicy apply="no"/>

     

    Visit here for more details: http://msdn2.microsoft.com/en-us/library/cf9025zt.aspx

     

    Hope this helps!

     

    Thanks!

    Friday, August 24, 2007 8:29 AM
  • I really dont see how this can affect which version the AuthorizationStoreProvider tries to load? You do understand that it is NOT my application loading the wrong version? The AuthorizationStoreProvider is in the System.Web namespace shipped with .NET framework? It is loading the wrong version when used. Somehow something has changed and instead of loading the 1.2.0.0 version (like it does on all other developers machines) it tries to load the vista version. I dont understand how this is possible since this is an XP machine. Do you know where the configuration for the System.Web.dll are located? Since there is no Version 2.0.0.0 ever installed on this machine only some configuration must have been changed. Does installing WSE 3.0 change the configuration on some machines or could it be some other software? I have gone through every configuration files I can find and nowhere I can find a directive to use Version 2.0.0.0. I DONT want to load version 2.0.0.0 since this has never and never will be used on this XP Machine. I want the AuthorizationStoreProvider to load the 1.2.0.0 version like its supposed to. At least im learning a bit more about publisher policies, and I thank you for trying to help me. Any help is greatly appreciated. 

     

    Friday, August 24, 2007 3:08 PM
  • I use a Windows 2003 server 64 bits and after an update I ran into the same problem.

    The current configuration is Windows 2003 server 64 bits with Service Pack 2.

     

    Did you guys solved this ?

    Thanks.
    Monday, September 10, 2007 9:43 AM
  • We have solved the problem. When loading the assembly from the AuthorizationStoreProvider the provider first tries to find the version 2.0.0.0 and if it can't find it it tries to find 1.2.0.0 (and lastly 1.0.0.0) If there is any version in the bin folder It will try to load it and check it against the version 2.0.0.0 first which throws an exception. This exception is not handled properly by the AuthorizationStoreProvider (which I think is a bug in this component). To get this to work keep the Microsoft.Interop.Security.AzRoles 1.2.0.0 out of the bin folder of the web project. We will have to see if microsoft fixes this bug eventually..
    Friday, September 14, 2007 1:51 PM
  • Did you have to strong-name the Microsoft.Interop.Security.AzRoles dll and add it to the GAC? When I removed the interop from the bin directory of the web app I get the following error:

     

    The authorization store component is not installed

     

    But I have uninstalled and re-installed the windows server 2003 sp1 admin tools pack multiple times. The interop is not added to the GAC by the install (and it is not strong named)

    Monday, December 17, 2007 2:49 PM
  • No, I just removed it from the bin dir.

     

    Tuesday, December 18, 2007 1:21 AM
  • I haven't found one that answers it to the point, but here it is:

    <runtime>
          <assemblyBinding>
                <dependentAssembly>
                    <assemblyIdentity name="Microsoft.Interop.Security.AzRoles" publicKeyToken="31bf3856ad364e35"
                        culture="neutral" />
                    <bindingRedirect oldVersion="2.0.0.0" newVersion="1.2.0.0"/>
                </dependentAssembly>
            </assemblyBinding>
    </runtime>

    Force binding to look for v1.2
    http://msdn.microsoft.com/en-us/library/7wd6ex19(VS.80).aspx


    Hope it helps.

    kreigh
    NCR-SDE
    • Edited by kreigh Friday, July 11, 2008 8:14 PM add reference link
    Friday, July 11, 2008 6:07 PM
  • Im experiencing the same problem with this. Tried all the solutions mentioned already but I am still receiving this error.
    I have re-installed the .net framework 2.0 also but to no avail.

    Can anyone suggest anything else I try?

    Tuesday, August 12, 2008 10:08 AM
  • Hi,

    I have the same problem. Executed the install of WS2003 and added the 1.2.0.0 version of Microsoft.Interop.SecurityAzRoles.dll in the GAC, my service still want the version 2.0.0.0 and if I use assembly version redirection, I got an error saying that  the assembly versions aer incompatible.

    I do not have the dll in my bin directory, only in the GAC I have .NET 3.5 on WinXP SP2

    My web.config for my WCF application

      <authentication mode="Windows"/>
      <
    roleManager enabled="true" defaultProvider="AzManRoleProvider">
        <
    providers>
          <
    add name="AzManRoleProvider"
            type="System.Web.Security.AuthorizationStoreRoleProvider, System.Web, Version=2.0.0.0,   Culture=neutral, publicKeyToken=b03f5f7f11d50a3a"
    connectionStringName="AzManPolicyStoreConnectionString" applicationName="MARServices"/><
        </
    providers>
      </
    roleManager>

    Like that, I want to decorate my service call with:

    [PrincipalPermission(SecurityAction.Demand, Role="Manager")]

    I hope it is possible!

    Thanks!

    Wednesday, November 12, 2008 9:35 PM
  • did anyone ever get a solution to this problem? as a recap, I have 1.2.0.0 installed in the gac, nothing in the bin.

    Rolemanager is using AuthorizationStoreProvider

    <roleManager enabled="true" cacheRolesInCookie="true" defaultProvider="RoleManagerAzManProvider"
    cookieName=".ASPXROLES" cookiePath="/" cookieTimeout="30" cookieRequireSSL="true"
    cookieSlidingExpiration
    ="true" createPersistentCookie="false" cookieProtection="All">
    <
    providers>
    <
    clear/>
    <
    add name="RoleManagerAzManProvider" type="System.Web.Security.AuthorizationStoreRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, publicKeyToken=b03f5f7f11d50a3a"
    connectionStringName="AzManConnectionString" applicationName="AzManDemo"/>
    </
    providers>
    </
    roleManager>

    <dependentAssembly>
    <
    assemblyIdentity name="Microsoft.Interop.Security.AzRoles" publicKeyToken="31bf3856ad364e35"
    culture="neutral" />
    <
    bindingRedirect oldVersion="2.0.0.0" newVersion="1.2.0.0"/>
    </
    dependentAssembly>

    Tuesday, December 2, 2008 7:57 PM
  • I'm also having same problem. I'm forcing to use version 1.2.0.0 not 2.0.0.0 by using above dependentassembly configuration, but I've getting error saying

    InnerException = {"The system cannot find the file specified. (Exception from HRESULT: 0x80070002)":null}

    Any advise further?

    Friday, June 24, 2011 6:02 AM