Simple asp.net precompilation issue in IIS

0

Looks like I am struck with a simple issue. I am hosting a precompiled website. It compiles and works fine in my local box. But when I host in IIS it fails with following error.

Could not load type 'MyHero.Home1'.

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Home.aspx.vb" Inherits="MyHero.Home1" %>

I can find MyHero.dll in Bin. I have also opend this in object brower and can see that there is a type Home1. MyHero.Home1 type exists and is public. So it is precompiled for sure.Not sure what I am missing Here. This is my first adventure with VB.NET.

This is how code behind looks

Partial Public Class Home1
    Inherits System.Web.UI.Page

Other part of the partial class is designer genrated. and is in Home.aspx.designer.vb

Partial Public Class Home1

I am not uploading code behind as its a precompiled site.

I am using IIS on Windows server 2003. Any pointers would be very helpful.

I can see that Home1. is listed under MyHero Namespace in object explorer. Just to ensure I added namespace Hero around class Home1, tried but same result. also tried removing namespace prefix from aspx page Inherits didnt help.

Is there any known issue with IIS on windows server 2003. Does the order of installation of .NET framework and IIS can impact this ? I am hosting this on freshly installed box. It works fine in my development box.

Thanks to dariom, I have installed fusion log viewer. Here is the Binding log, It doesnt seem to give out much clue. Does it ?

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

Assembly manager loaded from:  c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll
Running under executable  c:\windows\system32\inetsrv\w3wp.exe
--- A detailed error log follows. 
=== Pre-bind state information ===
LOG: User = NT AUTHORITY\NETWORK SERVICE
LOG: DisplayName = MyHero
 (Partial)
LOG: Appbase = file:///C:/Inetpub/wwwroot/cmail/MyHero/
LOG: Initial PrivatePath = C:\Inetpub\wwwroot\cmail\MyHero\bin
LOG: Dynamic Base = c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\2125db8d
LOG: Cache Base = c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\2125db8d
LOG: AppName = 97d7397b
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Inetpub\wwwroot\cmail\MyHero\web.config
LOG: Using host configuration file: \\?\C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet.config
LOG: Using machine configuration file from c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\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:///c:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/Temporary ASP.NET Files/root/2125db8d/97d7397b/MyHero.DLL.
LOG: Attempting download of new URL file:///c:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/Temporary ASP.NET Files/root/2125db8d/97d7397b/MyHero/MyHero.DLL.
LOG: Attempting download of new URL file:///C:/Inetpub/wwwroot/cmail/MyHero/bin/MyHero.DLL.
LOG: Assembly download was successful. Attempting setup of file: C:\Inetpub\wwwroot\cmail\MyHero\bin\MyHero.dll
LOG: Entering download cache setup phase.
ERR: Error extracting manifest import from file (hr = 0x80131018).
ERR: Setup failed with hr = 0x80131018.
ERR: Failed to complete setup of assembly (hr = 0x80131018). Probing terminated.
asp.net
iis
precompiled-headers
precompiled
asked on Stack Overflow Jul 16, 2010 by user376250 • edited Jul 20, 2010 by user376250

4 Answers

4

Guys I am able to resolve this issue. It was a Windows 7 security issue. I was uploading code from Windows 7 laptop to the server. dlls seems to have carried some hidden security permissions.

I have archived the dlls using winrar and extracted it on server. Just to ensure all the security permissions are removed. dlls are loading fine now, just that it haunted us for almost a week.

Thanks for all your help.

answered on Stack Overflow Aug 25, 2010 by user376250
0

Placing the Home1 class in the MyHero namespace would do the trick. IMO.

answered on Stack Overflow Jul 16, 2010 by Naveed Butt
0

When you say that your app is precompiled... how are you making this so? I am surprised to see the CodeBehind="" attribute in your page directive (in precompiled page). Make sure you don't have a file "Home.aspx.vb" sitting in your virtual directory. All you should need is Inherits="". You could also add the name of the assembly to the inherits value, like: Inherits="MyHero.Home1, MyHero"

answered on Stack Overflow Jul 16, 2010 by matt-dot-net
0

Your scenario sounds like it should work correctly - I can't see anything wrong with your ASPX and code-behind files.

If you have access to the IIS server you're running your application on, you can try using the Fusion Log Viewer to determine what is happening when the .NET runtime is trying to load your MyHero assembly. This MSDN Magazine article includes details for enabling binder logging and using the Fusion Log Viewer. Hopefully this can uncover why your assembly is not being found.

answered on Stack Overflow Jul 16, 2010 by dariom

User contributions licensed under CC BY-SA 3.0