I am using Visual Studio 2017 to create a web site and get the above error on new pages only.
The pages that were included (default, About & Contact) load as expected, but any page I create get the same error.
I only get the error on the remote host, they load fine in the local test host.
I am using the publish upload function.
I am an occasional user and have no idea where to look. It’s probably a simple setting I have missed.
Before you publish and deploy your website, it’s required to compile/build them first so that the dlls can be generated, this error usually occurs when you did not compile before deployment.
If this is the case, you could try this: Use ctrl + shift + B or F5 to build the application.
Then try to publish the website and the error shall be resolved.
If this is not the case, please try back up the Global.asax file in your project and then delete it, after this, create a new Global.asax file and copy the content from the old Global.asax to this new when and save it. Compile and publish
it at last.
Thanks, I am still learning but it appears whenever I add a page I not only need to 'build' the solution but need to publish the
entire solution. I thought all i need to do was publish the page i added.
Member
235 Points
452 Posts
Could not load type 'SafariTest2017.TestPage2'
May 20, 2020 04:39 PM|john1506|LINK
I am using Visual Studio 2017 to create a web site and get the above error on new pages only. The pages that were included (default, About & Contact) load as expected, but any page I create get the same error.
I only get the error on the remote host, they load fine in the local test host.
I am using the publish upload function.
I am an occasional user and have no idea where to look. It’s probably a simple setting I have missed.
What other information can I provide?
Test Page 2 will not load
<%@ Page Title="Test Page 2" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="TestPage2.aspx.cs" Inherits="SafariTest2017.TestPage2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
Test Page 2
</asp:Content>
The pages that were included load fine, like the Default page below.
The Default page has not problem.
<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="SafariTest2017._Default" %>
Thanks in advance.
John
Contributor
3140 Points
983 Posts
Re: Could not load type 'SafariTest2017.TestPage2'
May 21, 2020 03:25 AM|Yang Shen|LINK
Hi john1506,
Before you publish and deploy your website, it’s required to compile/build them first so that the dlls can be generated, this error usually occurs when you did not compile before deployment.
If this is the case, you could try this: Use ctrl + shift + B or F5 to build the application.
Then try to publish the website and the error shall be resolved.
If this is not the case, please try back up the Global.asax file in your project and then delete it, after this, create a new Global.asax file and copy the content from the old Global.asax to this new when and save it. Compile and publish it at last.
Best Regard,
Yang Shen
Member
235 Points
452 Posts
Re: Could not load type 'SafariTest2017.TestPage2'
May 21, 2020 11:43 PM|john1506|LINK
Thanks, I am still learning but it appears whenever I add a page I not only need to 'build' the solution but need to publish the entire solution. I thought all i need to do was publish the page i added.
Thanks
John