开发者

asp.Net 2005 "Could not load type"

开发者 https://www.devze.com 2022-12-29 00:52 出处:网络
Although I have seen dozens of forum questions relating to \"Could not load type\", none of the advice in them seemed to apply to my situation.

Although I have seen dozens of forum questions relating to "Could not load type", none of the advice in them seemed to apply to my situation.

I wrote a new web application using aspx.net VB 2005. It is tiny, with just 2 pages, 1 of which has no code-behind. It runs aok in the IDE but when I installed it on my pc (and also when installed on the production server), and tried to run it this error came up:

Parser Error 
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. 

Parser Error Message: Could not load type 'EMTTrainingDatabase.pageMain'.

Source Error: 


Line 1:  <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="pageMain.aspx.vb" Inherits="EMTTrainingDatabase.pageMain" %>
Line 2:  
Line 3:  <!D开发者_StackOverflow中文版OCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


Source File: /EMTTrainingDatabase/pageMain.aspx    Line: 1 


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.3603; ASP.NET Version:2.0.50727.3082 

I checked the web site properties in IIS and the correct ASP.net version is specified: 2.0.50727.

I checked the virtual path and it looks correct too: /EMTTrainingDatabase

pageMain source code header looks like:

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="pageMain.aspx.vb" Inherits="EMTTrainingDatabase.pageMain" %>

Some posters suggest that the bin is in the wrong folder or the bin doesn't contain the rigt contents. I don't have enough knowledge to evaulate this.

Can someone help?

Thank you.


I was able to find the answer to my problem:

When I added content to the deployment project, the dll was not in the bin. When I dragged it into the bin, the program worked.


For the benefit of others who might have had the same error, it can also come due to the ASP.NET runtime being unable to locate the /bin folder.

For this, make sure you have marked the virtual directory containing your application as a web application root.

e.g. In godaddy web hosting you should mark Set Application Root to the folder/sub-folder containing your application. (Making it a virtual directory is not enough).

Hope it will help someone.


Just replace the CodeBehind attribute with CodeFile

0

精彩评论

暂无评论...
验证码 换一张
取 消