Search code examples
c#asp.netajaxcontroltoolkitparse-error

VS2013 ASP.NET Could not load type '[solution].[application]'


Probably heard of it before, well I can't fix it. I am trying to have a website with one .aspx page, the rest is build in html and php. php is used as a 'master' page. the .aspx page is completely separate from the rest of the site, it only uses it's stylesheet,fonts and images.

Steps to this problem:

  1. Create ASP.NET Empty Web Application
  2. Add a few buttons, textboxes etc.. edit some stuff in the main.aspx.cs
  3. Right click on Solution, Publish to local folder
  4. Upload it to your hosting website and go to ~.com/main.aspx
  5. Getting This Error message: Could not load type 'Vergelijkcuracao.students'.

    Line1: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="students.aspx.cs"  Inherits="Vergelijkcuracao.students" %>
    

Things I've tried:

This article: Debug has stopped, local web server is off. The aspx.cs is after publishing indeed NOT in the saved directory, de bin folder is present but there is no aspx.cs ether. Manually dropping the aspx.cs on the server doesn't fix the problem.

Same article also suggests to check the output path: it is set to bin\ How do I correctly publish it to the hosts server? In Debug AND on a IIS local Web Site it works...

When I Choose a different way: Instead of New Project:

  1. Choose Open Website (because I already made a site in html)
  2. Browse to the directory, and open it
  3. Add new item: Web Forms
  4. Design this page with the stylesheet, make it like I want it
  5. Also include AJAX Toolkit for 2 SliderExtender's
  6. Works perfectly fine in Compile mode AND in IIS local Web server.
  7. Upload to Server, getting this error: Could not load file or assembly 'AjaxControlToolkit' or one of its dependencies.

    Line 3:  <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="AjaxControlToolkit" %> 
    

For more info on this error go to my previous article, still no solution for it. Showing Web.Config there aswell. Strange part: In my last solution, the aspx.cs is present in published directory...


Solution

  • So easy yet so hard to find: As I was saying, on a local IIS Web Site it was working, so I found it very strange to mess with web.config. It works locally, why not on a hosting Website:

    Solution: Go to your hosting control panel, in my case to the application tab, select the folder of your website and click 'Convert Folder to Application'. Pretty obvious now you think of it, In the IIS manager you do exactly the same, I thought that the hosting website would do it automatically. This Also helped for the Other topic Gives the same answer btw, still a bit strange that it works without a aspx.cs located on the server...

    Hosting: http://somee.com Using it for testing my websites, they offer a free limited hosting (sorry purpose is not to advertise it)