The old project was Web Application. But on further testing it looks like the problem is not associated with the old files. I created a new web page in the new VS2012 project (empty) and it won't run either.
The error I get is:
Could not load type 'GpmWoRequest.TestPage'.
Line 1: %@ Page Language="C#" AutoEventWireup="true" CodeBehind="TestPage.aspx.cs" Inherits="GpmWoRequest.TestPage" %
So it must be something basic in the new project I created. Some setting maybe?
>Was your old project a 'Web Site' or a 'Web Application' project?
>
>Web Site projects don't compile the actual pages into a fixed assembly in the /Bin folder (ie. there's no MyWebSite.dll), while Web Applications do. The two project types have different ways of referencing CodeBehind files.
>
>If you have a Web site and need to run it in a new Web Application I believe there is a "Convert to Web Application" option on the project which can take some but not all of the steps needed to convert. It's a pain. You can search online to find out what differences there are for the two project types. Mainly it involves small fixes to the page header (CodeBehind vs. CodeFile if I recall) and in some cases differences in how dynamic controls (user controls and masterpages) are accessed.
>
>The other option is you can just run your application as a 'Web Site' under .NET 4.0/4.5. You still get all the new runtimes and features but you can maintain your original project type.
>
>+++ Rick ---
>
>>Hi,
>>I am converting an ASP.NET web application from ASP.NET 2.0 to 4.0. Actually from VS2005 to VS2012. Here is what I did:
>>In VS2012 I created a new empty web project. Then I manually copied all files (aspx, cs, etc) from the VS2005 folder to the new VS2012 project folder. Then in VS2012 I added existing items (all project file).
>>When I execute (browse) a page I get the following error:
>>
>>
>>Could not load type 'MyAspxPageName.MyUserControl'.
>>
>>%@ Control Language="c#" AutoEventWireup="True" Codebehind="MyUserControl.ascx.cs"
>>Inherits="MyAspxPageName.MyUserControl" TargetSchema="http://schemas.microsoft.com/intellisense/ie5"%
>>
>>Source File: /MyUserControl.ascx Line: 1
>>
>>
>>Has anything changed in the way a user control is "wired" to the aspx page in VS2012? Or do you see or suggest anything I need to change?
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham