Results 1 to 20 of 20

Thread: Problems uploading Site to Host - Can not load type "WebApplication1.SiteMaster"

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2007
    Posts
    522

    Problems uploading Site to Host - Can not load type "WebApplication1.SiteMaster"

    My application works fine in Visual Studio. However, when I try to move it to my Web IIS Host it is throwing errors. The first errors were that it did not like the two Compile statements in Site.Master (Microsoft.CodeDom.Providers.DotNetCompilersPlatform). I forget what the errors were, but deleting the two statements in Site.Master eliminated them.

    Next problem was that my host complained about "~/" in the relative addresses in my code. I removed them and got past that error.

    Now it is indicating that "Can not load type "WebApplication1.SiteMaster". In Site.Master.vb I have
    Code:
    Public Class SiteMaster
        Inherits MasterPage
        Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
    
        End Sub
    End Class
    I then created a simple Hello World website, but I had identical issues. I have rebuilt the site multiple times to no avail.

    I have uploaded ASP.Net code to websites before and never had this problem. From what I gather from my internet research, others have similar issues starting with VS2017, but I have not found a solution. Any help would be appreciated.

  2. #2
    Superbly Moderated NeedSomeAnswers's Avatar
    Join Date
    Jun 2002
    Location
    Manchester uk
    Posts
    2,649

    Re: Problems uploading Site to Host - Can not load type "WebApplication1.SiteMaster"

    How are you publishing your website?

    are you using web deploy? as if your not I would recommend you do.

    The version of VS has no bearing on your publishing

    This is a .Net Core website correct? have you installed the .net core runtime on your web server? also are you running your app pool under no managed code ?
    Please Mark your Thread "Resolved", if the query is solved & Rate those who have helped you



  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2007
    Posts
    522

    Re: Problems uploading Site to Host - Can not load type "WebApplication1.SiteMaster"

    I am publishing my code using VS, using FTP. BTW, I am using .Net version 4.6.1.

    I am not sure if it is .Net Core or not. It has been a while since I created it, and I don't remember, but I think I used ASP.Net Web Forms. I don't know how to tell if this is a .Net Core website or not. (The last time I created an ASP.Net web app was before .Net Core was around, and I tried to stay with an environment I was familiar. For this reason, I think I went with The Web / Previous Versions / ASP Web Forms Site template)

    I did not install the .net core runtime on the webserver. Is this something that I need to do separately, or is it part of publish from within VS? Do I need this if I am not running Core? The last time I created a website in ASP.Net I don't think I had to upload the runtime - I just had to publish to an IIS server, which is what I am doing now.

    I am sorry I don't know what you mean by am I running my app pool under no managed code. I did not specify any setting indicating if the code is managed or not. I thought I was using Managed code since I am not doing any specific memory management.

  4. #4
    Superbly Moderated NeedSomeAnswers's Avatar
    Join Date
    Jun 2002
    Location
    Manchester uk
    Posts
    2,649

    Re: Problems uploading Site to Host - Can not load type "WebApplication1.SiteMaster"

    Ok so we can assume its not .Net Core as your using Web Forms.

    Are you publishing this to a Server you have used before or a new web server?

    Most publishing issues are to do with either server setup, or with Web Site config, so lets first look at the server setup

    If it is a new server or one you have not used recently, can you confirm that it has the correct .Net framework installed and also in your windows components that asp.net 4.5 is installed.

    Let me know if we can rule these thing out, then we will look at the config !!
    Please Mark your Thread "Resolved", if the query is solved & Rate those who have helped you



  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2007
    Posts
    522

    Re: Problems uploading Site to Host - Can not load type "WebApplication1.SiteMaster"

    I am using HostGator. I have used them in the past with no problems, however this is a new account and this is the first time I have tried to load a .net website. This is shared hosting

    The host's documentation states they have "ASP Classic, ASP.NET 2.0, 3.5, 4.0, 4.5, 4.6 & 4.7" installed.

    On my local machine I have 3, 3.5, 4.0, and 4.8 installed. From the documentation I read it appears that 4.8 will also support earlier 4 frameworks. My application states it is using 4.6.1. My application would allow me to change the framework to frameworks up to and including 4.8 (4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.7.2, 4.8)

  6. #6
    Superbly Moderated NeedSomeAnswers's Avatar
    Join Date
    Jun 2002
    Location
    Manchester uk
    Posts
    2,649

    Re: Problems uploading Site to Host - Can not load type "WebApplication1.SiteMaster"

    Ah ok so your uploading to a web host rather than your own server.

    You say its the first time you have tried to upload a .Net website, Does that mean you uploaded a classic asp site before or something else?

    have you asked you hosting company for assistance on this, can you get hold of the application logs from the server? often they will show any error messages from your deployment!
    Please Mark your Thread "Resolved", if the query is solved & Rate those who have helped you



  7. #7

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2007
    Posts
    522

    Re: Problems uploading Site to Host - Can not load type "WebApplication1.SiteMaster"

    Yes, I am using a web host. I picked HostGator, because I used it back in 2012 without any problems. At one time I uploaded an ASP.net website without problems, and that is why I am so frustrated with all the problems I am having now.

    Previously I did upload a classic Web Forms site to Host Gator. It was a multipage site with master pages.

    I have asked the hosting company for help. It did get escalated to a level two when I was having trouble with the compiler statements in the Web.config file when I tried to load the Default.aspx file. They removed they compiler statements (Microsoft.CodeDom.Providers.DotNetCompilersPlatform) and the execution continued and threw and error everywhere VS used "~/" as the prefix for the root of the website. I modified those statements changing say "~/image/pic1.jpg" to "image/pic1.jpg". The code in VS still ran, now ran into the problem with not being able to load WebApplication1.SiteMaster". The hosting company support staff told me they do not support software, and that I should contact a programmer to figure out what is wrong with my code.

    I did not ask for logs. I do see the error message when I try to access the site. I am not sure what else the logs would show me, but I can ask for them. This is what I see when I try to access the default.aspx page"
    Code:
    Server Error in '/' Application.
    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 'WebApplication1.SiteMaster'.
    
    Source Error:
    
    
    Line 1:  <%@ Master Language="VB" AutoEventWireup="true" CodeBehind="Site.master.vb" Inherits="WebApplication1.SiteMaster" %>
    Line 2:  
    Line 3:  <!DOCTYPE html>
    
    Source File: /WebApplication1/Site.Master    Line: 1
    
    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.3770.0
    One thing I thought I could try is to compile the site under VS2019 and see if that helps.

  8. #8
    Superbly Moderated NeedSomeAnswers's Avatar
    Join Date
    Jun 2002
    Location
    Manchester uk
    Posts
    2,649

    Re: Problems uploading Site to Host - Can not load type "WebApplication1.SiteMaster"

    can you post your code then? the error message your posting doesn't really tell us much!!

    What would help is the page load code
    Please Mark your Thread "Resolved", if the query is solved & Rate those who have helped you



  9. #9

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2007
    Posts
    522

    Re: Problems uploading Site to Host - Can not load type "WebApplication1.SiteMaster"

    I did not want to upload my actual code, So I created a new app which demonstrates the same issues. I created a brand now Visual Basic / Web / Previous Versions / ASP.NET Web Forms Site. The original code without modifications and final code with all changes can be found at: https://github.com/Drgerdes/WebApplication1

    Right out of the box, the site shows the following error when I upload it to HostGator.

    Attachment 181460

    Following the errors suggestion, I added the Custom Errors to Web.Config and now I see

    Attachment 181461

    This is the error I brought to Host Gator, and they said that the compilers are not supported on shared hosts. The deleted the compile lines which brought up different errors, at which point they indicated they do not support codeing and recommend I consult a programmer.

    Removing both compile lines I get the following

    Attachment 181462

    This error is now in Default.aspx. It can not find Site.master, which is in the root of my application. I guessed the tilde slash prefix might be the problem, so I removed it. It still ran in VS, but now it can not find WebApplication1.SiteMaster, which is a system generated Partial Public Class in Site.Master.designer.vb.

    Attachment 181463

    That is where I am at.

  10. #10
    Superbly Moderated NeedSomeAnswers's Avatar
    Join Date
    Jun 2002
    Location
    Manchester uk
    Posts
    2,649

    Re: Problems uploading Site to Host - Can not load type "WebApplication1.SiteMaster"

    Unfortunately all your attachments are invalid so I cant view them.

    I dont really understand why you cant post your code, even the code from your replicated solution would have been fine. Your using very old tech nobody is going to steal your code!

    I dont really like downloading solutions to be honest, I am fairly busy during the week and its just extra hassle. If I have time later in the week towards the weekend I might take a look then.
    Please Mark your Thread "Resolved", if the query is solved & Rate those who have helped you



  11. #11

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2007
    Posts
    522

    Re: Problems uploading Site to Host - Can not load type "WebApplication1.SiteMaster"

    The real application is quite large with lots of pages and links to a database. I posted a simpler application that has the same problems without the additional complexity. There must be something basic wrong, so I posted the basic application without any added code and it still has the same issues.

    I fully understand your reluctance to download code. I do greatly appreciate your willingness to at least give me your insights to what is going on.

    I was not sure if you wanted me to actually post the actual files, or post the code in the forum. I did post the actual file in github and provided the link. I can upload individual files in the forum, and will in a subsequent post. Here is another try on my prior post with working attachments. They work in the Preview Post.

    As I said in the last poste, I created a brand now Visual Basic / Web / Previous Versions / ASP.NET Web Forms Site. The original code without modifications and final code with all changes can be found at: https://github.com/Drgerdes/WebApplication1

    Right out of the box, the site shows the following error when I upload it to HostGator.

    Name:  Original.jpg
Views: 49
Size:  41.8 KB

    Following the errors suggestion, I added the Custom Errors to Web.Config and now I see

    Name:  Original + customerrors.jpg
Views: 48
Size:  45.4 KB

    This is the error I brought to Host Gator, and they said that the compilers are not supported on shared hosts. The deleted the compile lines which brought up different errors, at which point they indicated they do not support codeing and recommend I consult a programmer.

    Removing both compile lines I get the following

    Name:  Add CustomErrors and Removed Compile.jpg
Views: 50
Size:  41.3 KB

    This error is now in Default.aspx. It can not find Site.master, which is in the root of my application. I guessed the tilde slash prefix might be the problem, so I removed it. It still ran in VS, but now it can not find WebApplication1.SiteMaster, which is a system generated Partial Public Class in Site.Master.designer.vb.

    Name:  Final - remove tilde slash.jpg
Views: 48
Size:  32.7 KB

    That is where I am at.

  12. #12

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2007
    Posts
    522

    Re: Problems uploading Site to Host - Can not load type "WebApplication1.SiteMaster"

    This is the Web.config, with <customErrors> added and Compiler code commented out

    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <!--
      For more information on how to configure your ASP.NET application, please visit
      https://go.microsoft.com/fwlink/?LinkId=169433
      -->
    <configuration>
      <system.web>
        <customErrors mode="Off"></customErrors>  
        <compilation debug="true" strict="false" explicit="true" targetFramework="4.6.1"/>
        <httpRuntime targetFramework="4.6.1"/>
        <pages>
          <namespaces>
            <add namespace="System.Web.Optimization"/>
          </namespaces>
          <controls>
            <add assembly="Microsoft.AspNet.Web.Optimization.WebForms" namespace="Microsoft.AspNet.Web.Optimization.WebForms" tagPrefix="webopt"/>
          </controls>
        </pages>
      </system.web>
      <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
          <dependentAssembly>
            <assemblyIdentity name="Antlr3.Runtime" publicKeyToken="eb42632606e9261f"/>
            <bindingRedirect oldVersion="0.0.0.0-3.5.0.2" newVersion="3.5.0.2"/>
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed"/>
            <bindingRedirect oldVersion="0.0.0.0-11.0.0.0" newVersion="11.0.0.0"/>
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35"/>
            <bindingRedirect oldVersion="0.0.0.0-1.6.5135.21930" newVersion="1.6.5135.21930"/>
          </dependentAssembly>  
        </assemblyBinding>
      </runtime>
      <system.codedom>
     <!--   <compilers>
          <compiler language="c#;cs;csharp" extension=".cs"
            type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
            warningLevel="4" compilerOptions="/langversion:default /nowarn:1659;1699;1701"/>
          <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb"
            type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
            warningLevel="4" compilerOptions="/langversion:default /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+"/>
        </compilers>  -->
      </system.codedom>
    </configuration>


    Here is the Default.aspx. The changes here are that I removed the "~/" from in front of "Site.Master". Othere than that the whole application was generated when I created a new Web Application.

    Code:
    <%@ Page Title="Home Page" Language="VB" MasterPageFile="Site.Master" AutoEventWireup="true" CodeBehind="Default.aspx.vb" Inherits="WebApplication1._Default" %>
    
    <asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server">
    
        <div class="jumbotron">
            <h1>ASP.NET</h1>
            <p class="lead">ASP.NET is a free web framework for building great Web sites and Web applications using HTML, CSS and JavaScript.</p>
            <p><a href="http://www.asp.net" class="btn btn-primary btn-lg">Learn more &raquo;</a></p>
        </div>
    
        <div class="row">
            <div class="col-md-4">
                <h2>Getting Started</h2>
                <p>
                    ASP.NET Web Forms lets you build dynamic websites using a familiar drag-and-drop, event-driven model.
                A design surface and hundreds of controls and components let you rapidly build sophisticated, powerful UI-driven sites with data access.
                </p>
                <p>
                    <a class="btn btn-default" href="https://go.microsoft.com/fwlink/?LinkId=301948">Learn more &raquo;</a>
                </p>
            </div>
            <div class="col-md-4">
                <h2>Get more libraries</h2>
                <p>
                    NuGet is a free Visual Studio extension that makes it easy to add, remove, and update libraries and tools in Visual Studio projects.
                </p>
                <p>
                    <a class="btn btn-default" href="https://go.microsoft.com/fwlink/?LinkId=301949">Learn more &raquo;</a>
                </p>
            </div>
            <div class="col-md-4">
                <h2>Web Hosting</h2>
                <p>
                    You can easily find a web hosting company that offers the right mix of features and price for your applications.
                </p>
                <p>
                    <a class="btn btn-default" href="https://go.microsoft.com/fwlink/?LinkId=301950">Learn more &raquo;</a>
                </p>
            </div>
        </div>
    
    </asp:Content>

  13. #13
    Superbly Moderated NeedSomeAnswers's Avatar
    Join Date
    Jun 2002
    Location
    Manchester uk
    Posts
    2,649

    Re: Problems uploading Site to Host - Can not load type "WebApplication1.SiteMaster"

    are you using Microsoft.CodeDom.Providers.DotNetCompilerPlatform ?

    It was probably automatically added in as a reference, as your uploading to a host server they wont have this installed on the server and so i would remove it.

    Just did a quick read up and found this which may basically be your issue

    https://stackoverflow.com/questions/...lerplatform-cs

    scroll down to the answer which talks about - Roslyn references !
    Please Mark your Thread "Resolved", if the query is solved & Rate those who have helped you



  14. #14

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2007
    Posts
    522

    Re: Problems uploading Site to Host - Can not load type "WebApplication1.SiteMaster"

    Thank you for the reference. I had found that previously, which is why I was commenting out the Compile statements in the Web.Config file. I also had previously tried unloading the CodeCom elements. I just tried it once again, and I am still getting the same results.

    Note, when I did remove the compiler statements, it got past the Web.config, and giving the error in the Default.aspx file (as shown in the third screen shot in post #11.

  15. #15

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2007
    Posts
    522

    Re: Problems uploading Site to Host - Can not load type "WebApplication1.SiteMaster"

    I just tried creating a new web Form application in VS 2019 with exactly the same results. I when through the same sequence of errors, and end up at the same place. It can not find 'WebApplication2.SiteMaster' when loaded on the server in this case (this second site is WebApplication2).

    I have now used both VS 2017 and VS 2019 with the same results. It must either be that I am doing some simple thing wrong, or the host is not configured properly. I will go back to the host and see if they have any idea of what is going on. I will report back.

  16. #16

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2007
    Posts
    522

    Re: Problems uploading Site to Host - Can not load type "WebApplication1.SiteMaster"

    I heard back from the host support. They stated:


    The errors affecting http://itjuggler.com/webapplication1/ and http://itjuggler.com/webapplication2/ stem from the configuration of the site content, and as we do not specialize in site development the level of assistance that we can offer in this area is limited. Errors of this nature are typically resolved by republishing the site to include all required dependencies. For your reference I have located the following documentation in which users have reported resolutions for similar problems:

    https://stackoverflow.com/questions/...on1-sitemaster

    The shared server you have with us is a Windows based server, and will fully support a self contained application, as long as the full publish directory is uploaded, especially if the target version is not one that the server supports natively, as self contained applications publish with all of the files needed to run the target version. You would also want to remove all of the files for the application and then upload the new publish directory when making more major changes, so that the files are all current copies for the new publish. Should you have any other inquiries in which we may offer assistance please let us know.

    -----------------------
    I had previously found that posting, but did not find it helpful. I did change CodeBehind to CodeFile, but that generated other errors. I did copy over Web.Config.vb and Default.aspx.vb to the host manually, but that did not have any effect. I did not understand how to change the name space appropriately, so I did not try that. I even tried precompiling the code before uploading it to the host (an option in Publish), but that did not help either.

    My next step is to see if I can find a private IIS server and load it up on that and see if it will run. This will at least indicate if the problem is with the host or on my side. I will post back when I have any other info.

  17. #17
    Superbly Moderated NeedSomeAnswers's Avatar
    Join Date
    Jun 2002
    Location
    Manchester uk
    Posts
    2,649

    Re: Problems uploading Site to Host - Can not load type "WebApplication1.SiteMaster"

    How are you publishing the site?

    are you just grabbing the file in the bin folder and copying across manually? or are you using the publish function inside Visual Studio to create a zip file and then using that to publish your website ?
    Please Mark your Thread "Resolved", if the query is solved & Rate those who have helped you



  18. #18

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2007
    Posts
    522

    Re: Problems uploading Site to Host - Can not load type "WebApplication1.SiteMaster"

    I am using the Publish function inside VS to FTP the site to the httpdocs folder.

  19. #19
    New Member
    Join Date
    Nov 2014
    Posts
    9

    Re: Problems uploading Site to Host - Can not load type "WebApplication1.SiteMaster"

    Quote Originally Posted by John_SC View Post
    I am using the Publish function inside VS to FTP the site to the httpdocs folder.
    It seems that you haven't deployed your files properly, you may read this post https://windowswebhostingreview.com/...hared-hosting/ for further reference.

  20. #20

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2007
    Posts
    522

    Re: Problems uploading Site to Host - Can not load type "WebApplication1.SiteMaster"

    The process I have used in the past is:
    1) Run application in VS to verify it is working

    2) Click on Build / Publish WebApplication1


    Attachment 181496


    3) Configure the Publish Connection. I set it to delete existing files. Validate connection

    Attachment 181497


    4) Press Save, and now I am ready to Publish

    Attachment 181498


    5)Publish site. Here is the output

    Attachment 181499


    6) This is what is reported by VS under Web Publish Activity Window

    Attachment 181500


    7) When accessing the site, this generates the same error: Could not load type 'WebApplication1.SiteMaster'.

    I have only used the FTP method of publishing, I could try copying the files - I just thought the FTP approach would be simpler.

    Note, I did not try adding the one command suggested in the reference page you provided yet (adding <trust level = "full"/>, but I can try that.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width