philiplaureano / LinFu

A framework that adds mixins, inversion of control, DbC, and other language features to the Common Language Runtime.
http://www.codeproject.com/KB/cs/LinFuPart1.aspx
206 stars 30 forks source link

ASP.NET MVC assembly cannot be loaded after weaving #19

Open ionoy opened 12 years ago

ionoy commented 12 years ago
  1. Created blank asp.net mvc 4 project
  2. Updated .csproj file, like in SampleLibrary.csproj

Build went normally as expected. But when I tried to start website, I got assembly loading error. This is the content of fusion log:

* Assembly Binder Log Entry (12/7/2011 @ 8:25:41 PM) *

The operation failed. Bind result: hr = 0x8013110e. No description available.

Assembly manager loaded from: D:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll Running under executable D:\Program Files (x86)\IIS Express\iisexpress.exe --- A detailed error log follows.

=== Pre-bind state information === LOG: User = Mihhail-PC\Mihhail LOG: DisplayName = MvcApplication1 (Partial) WRN: Partial binding information was supplied for an assembly: WRN: Assembly Name: MvcApplication1 | Domain ID: 2 WRN: A partial bind occurs when only part of the assembly display name is provided. WRN: This might result in the binder loading an incorrect assembly. WRN: It is recommended to provide a fully specified textual identity for the assembly, WRN: that consists of the simple name, version, culture, and public key token. WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue. LOG: Appbase = file:///D:/Users/Mihhail/Documents/Visual Studio 2010/Projects/MvcApplication1/MvcApplication1/ LOG: Initial PrivatePath = D:\Users\Mihhail\Documents\Visual Studio 2010\Projects\MvcApplication1\MvcApplication1\bin LOG: Dynamic Base = D:\Users\Mihhail\AppData\Local\Temp\Temporary ASP.NET Files\root\f5537734 LOG: Cache Base = D:\Users\Mihhail\AppData\Local\Temp\Temporary ASP.NET Files\root\f5537734 LOG: AppName = fc02e379 Calling assembly : (Unknown).

LOG: This bind starts in default load context. LOG: Using application configuration file: D:\Users\Mihhail\Documents\Visual Studio 2010\Projects\MvcApplication1\MvcApplication1\web.config LOG: Using host configuration file: D:\Users\Mihhail\Documents\IISExpress\config\aspnet.config LOG: Using machine configuration file from D:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config. LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind). LOG: Attempting download of new URL file:///D:/Users/Mihhail/AppData/Local/Temp/Temporary ASP.NET Files/root/f5537734/fc02e379/MvcApplication1.DLL. LOG: Attempting download of new URL file:///D:/Users/Mihhail/AppData/Local/Temp/Temporary ASP.NET Files/root/f5537734/fc02e379/MvcApplication1/MvcApplication1.DLL. LOG: Attempting download of new URL file:///D:/Users/Mihhail/Documents/Visual Studio 2010/Projects/MvcApplication1/MvcApplication1/bin/MvcApplication1.DLL. LOG: Assembly download was successful. Attempting setup of file: D:\Users\Mihhail\Documents\Visual Studio 2010\Projects\MvcApplication1\MvcApplication1\bin\MvcApplication1.dll LOG: Entering download cache setup phase. ERR: Error extracting manifest import from file (hr = 0x8013110e). ERR: Setup failed with hr = 0x8013110e. ERR: Failed to complete setup of assembly (hr = 0x8013110e). Probing terminated.

philiplaureano commented 12 years ago

Try running PEVerify.exe on the modified ASP.NET MVC assembly. What does the PEVerify output look like?

ionoy commented 12 years ago

I copied all dll's from bin folder to c:\dev\123\

Output from PEVerifier is kind of unusable:

C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC>peverify c:\dev\123\MvcApplication1.dll /md /il

Microsoft (R) .NET Framework PE Verifier. Version 4.0.30319.1 Copyright (c) Microsoft Corporation. All rights reserved.

File not found or has bad headers. File is corrupt. 2 Error(s) Verifying c:\dev\123\MvcApplication1.dll

philiplaureano commented 12 years ago

Can you post the sample MVC project somewhere on Github so that I can take a look at it?

ionoy commented 12 years ago

Here: http://dl.dropbox.com/u/133081/MvcApplication2.zip