Symptoms
Server Error in '/Identity' Application.
There is an error presented in the Event Logs
Could not load file or assembly 'Microsoft.Web.Infrastructure,
Diagnoses
Could not load file or assembly 'Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
bFileNotFoundException: Could not load file or assembly 'Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.]
System.Web.Http.WebHost.SuppressFormsAuthRedirectModule.Register() 0
bInvalidOperationException: The pre-application start initialization method Start on type System.Web.Http.WebHost.PreApplicationStartCode threw an exception with the following error message: Could not load file or assembly 'Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified..]
System.Web.Compilation.BuildManager.InvokePreStartInitMethodsCore(ICollection`1 methods, Func`1 setHostingEnvironmentCultures) 12618627
System.Web.Compilation.BuildManager.InvokePreStartInitMethods(ICollection`1 methods) 12618348
System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Booleanandamp isRefAssemblyLoaded) 280
System.Web.Compilation.BuildManager.ExecutePreAppStart() 172
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) 1151
bHttpException (0x80004005): The pre-application start initialization method Start on type System.Web.Http.WebHost.PreApplicationStartCode threw an exception with the following error message: Could not load file or assembly 'Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified..]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) 12617668
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) 159
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) 12457285
Resolution
This seems to be a .Net assemblies not installed correctly and is not related to K2.
So for this particular ticket it seems to be related to .Net 4.0 /4.5
http://stackoverflow.com/questions/12669206/error-microsoft-web-infrastructure-version-1-0-0-0-culture-neutral-publickeyt
It appears that Microsoft.Web.Infrastructure.dll is not being installed in the GAC, even if .net (4.0 or 4.5 or other) are installed successfully on Windows Server. On localhost (typically Windows client), it seems like it is being in the GAC when the tools/platform (Visual Studio etc.) are installed.
As one possible fix, please try the following:
1.Run the following command in the Package Manager Console. (If you are using Visual Studio, this can be reached via menu options "Tools --> Library Package Manager --> Package Manager Console:)
PM> Install-Package Microsoft.Web.Infrastructure
You will see the following messages if it is successfully installed.
Successfully installed 'Microsoft.Web.Infrastructure 1.0.0.0'.
Successfully added 'Microsoft.Web.Infrastructure 1.0.0.0' to Web.
2.You will notice that Microsoft.Web.Infrastructure.dll has now been added as a Reference (can be seen in the references folder of your project in in Solution Explorer)
3.If you look at the properties of this reference you will notice that "Copy Local" has been set to "True" by default.
4.Now when you "Publish " your project, Microsoft.Web.Infrastructure.dll will be deployed.
Other Links
http://www.nopcommerce.com/boards/t/20521/could-not-load-file-or-assembly-microsoftwebinfrastructure.aspx