Click here to Skip to main content
16,013,581 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi!

I am tring to debug my application, but I always get error 500.
I've checked windows log, and it says:

Exception message: Could not load file or assembly 'System.Web.WebPages.Deployment, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. Either a required impersonation level was not provided, or the provided impersonation level is invalid. (Exception from HRESULT: 0x80070542)

I've tried many things from the web, but they didn't work.

My webconfig:


C#
<configuration>
  <configsections>
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirepermission="false" />
  </configsections>
    <connectionstrings>
      <add name="xxx" connectionstring="Data Source=xxx;Initial Catalog=HayEvaluation;Integrated Security=True;MultipleActiveResultSets=True" providername="System.Data.SqlClient" />
    </connectionstrings>
  <system.web>
    <sessionstate timeout="4800"></sessionstate>
    <identity impersonate="true">
          userName="xxx" 
          password="xxx" ;
    <authentication mode="Windows";
    <globalization uiculture="hu-HU" culture="hu-HU" />
    <compilation debug="true" targetframework="4.0">
      <assemblies>
        <add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
        <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
      </assemblies>
    </compilation>
    <pages>
      <controls>
        <add tagprefix="ajaxToolkit" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" />
      </controls>
    </pages>
  </identity></system.web>
  <system.webserver>
    <modules runallmanagedmodulesforallrequests="true" />
  </system.webserver>
  <runtime>
    <assemblybinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentassembly>
        <assemblyidentity name="Microsoft.WindowsAzure.Storage" publickeytoken="31bf3856ad364e35" culture="neutral" />
        <bindingredirect oldversion="0.0.0.0-4.0.0.0" newversion="4.0.0.0" />
          <assemblyidentity name="System.Web.WebPages" publickeytoken="31BF3856AD364E35" culture="neutral" />
          <bindingredirect oldversion="0.0.0.0-2.0.0.0" newversion="2.0.0.0" />
      </dependentassembly>
    </assemblybinding>
  </runtime>
</configuration>
Posted
Updated 16-Feb-15 0:48am
v3
Comments
ZurdoDev 16-Feb-15 9:39am    
The error says the impersonation is invalid.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900