Question

I am trying to set up a build environment for an ASP.NET web application in Microsoft Visual Studio 2010 for several different projects simultaneously. I am using IIS 7.5 as the backend server. I am encountering a compilation error of the same form in all three projects, with some slight contextual differences. The error messages generated by doing a build in VS 2010 are as follows (I've added a # sign so that I can refer to each of them individually).

Could not load type 'divFetch.Global' (#1)
Could not load type 'OrderAdmin.ContractorProductivity' (#2)
Could not load type 'Ticket.forms.Ticket_summary' (#3)

For your reference, I am using the following Page directives (all defined in files corresponding to the ones mentioned above, with .aspx extensions [except #1 with .asax]):

<%@ Page language="c#" Codebehind="pleasewait.aspx.cs" AutoEventWireup="false" Inherits="Ticket.pleasewait" %>
<%@ Page language="c#" Codebehind="LogTicket_summary.aspx.cs" AutoEventWireup="false" EnableViewState="true" Inherits="Ticket.forms.Ticket_summary" %>
<%@ Page language="c#" Codebehind="ContractorProductivity.aspx.cs" AutoEventWireup="false" Inherits="OrderAdmin.ContractorProductivity" %>
<%@ Application Codebehind="Global.asax.vb" Inherits="divFetch.Global" %>

Of these, I've noticed that Resharper highlights 'divFetch.Global', 'ContractorProductivity', and 'Ticket_summary' in red, and 'OrderAdmin' and 'Ticket.forms' in blue.

I've already looked at "Could not load type [Namespace].Global" causing me grief and Could not load type 'XXX.Global' but these haven't worked for me (at least not yet). So I would like to ask a different question: why does this error come about in the first place?

In the case of #2 and #3, why does Visual Studio not like these particular modules when other modules like "Ticket.pleasewait" are just fine?

Était-ce utile?

La solution

The issue seems to be that you need to change CodeBehind with CodeFile. For information on why you can visit this other post:

CodeFile vs CodeBehind

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top