July 14th, 2003, 03:27 PM
Parser Error Message: Could not load type
I have seen this error reported numerous times in different forums, but haven't found the solution to my particular problem yet. I have created a few sample ASP.net apps, from a book I am studying, and haven't had any trouble compiling and running my apps, until recently. Now I get the following error when I create a new ASP.NET Web Application (VB.net) in VS.net, and "Start" the application.
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 'WebApplication2.Global'.
Line 1: <%@ Application Codebehind="Global.asax.vb" Inherits="WebApplication2.Global" %>
Source File: c:\inetpub\wwwroot\WebApplication2\global.asax Line: 1
It doesn't matter whether I add web controls to the form or not. I haven't knowingly changed anything about my environment since I was previously able to compile and run ASP.NET apps. And I'm not changing any of the default code that is generated by VS.NET before I attempt to start the application.
The suggestion solution to this error usually contains a warning that the application has not been built or is not located in the bin subdirectly of the virtual directory. But my app IS being built (WebApplication2.dll) and IS located in the bin subdirectly of my virtual directory.
I would appreciate any suggestions.
August 6th, 2003, 04:49 AM
Is WebApplication2 configured as an application in IIS?
August 28th, 2003, 12:49 PM
Setting IIS Application Not Solving Problem
I am having the same problem, but setting the IIS application variable does not resolve the problem. Any other suggestions?
September 5th, 2003, 02:49 PM
Oh, I had this problem for new web forms added to solution, but after a short navigating in VS menu I found the solution --> Ctrl +Shift +B you should "rebuild solution" from "Build" menu.
September 9th, 2003, 09:14 AM
I found that by moving your global files into the bin folder within the project, this problem is taken care of. In the solution explorer click on "show all files" and drag the global files into the foler.
September 9th, 2003, 09:58 AM
Don't do this
All it achieves is to remove the page (Global.asax) that asks the application for an instance of YourApp.Global. As it's not in the application's root any more it won't be invoked at the beignning of any request. It's bound to remove the error since the class will never be loaded. You may as well delete Global.asax to achieve this result.
It doesn't address the class loader issue, just stops the class being loaded at all.
September 25th, 2003, 09:43 PM
I had the same problem with one of my projects. After searching on Internet I found on Microsoft site this article http://support.microsoft.com/default...;EN-US;Q306155.
I have tried to build the solutions ( VS) but nothing worked. Finally I deleted the 'dll' from bin folder and I compiled again.
Last edited by daprodu; September 25th, 2003 at 09:45 PM.
October 3rd, 2003, 06:20 AM
This error out of the blue started occuring for me I pulled my hair out until I tried all sorts, rebuilding restarting services, blah blah, until after reading your post I deleted the dlls and rebuilt the app it started working again. Sounds like VS got its nickers in a twist!
Thanks again, hopefully my hair will start to grow back!
December 10th, 2003, 10:05 AM
In case anybody else encounters this error, I felt I should post my solution. I have been trying for two days to solve it, and the tip someone gave on one of the forums helped me out.
We have a very large application and our clients are using various versions. When they encounter a bug that we cannot pinpoint right away on an older version, we have to load it on out dev platforms in order to debug it. The simplest method we've found to do this, is to modify the relevant paths in IIS and reload and compile in VS.NET.
So I recently had to do this, and when I finished, I tried to reload the newest dev version. Everything compiled ok, but one of the projects returned this error. Someone posted a tip about problems in the Project properties dialog. So I opened it up and found that the file share path under Web Settings had an extra slash that had not been there before.
That is, the path was:
Removing the extra slash, closing the studio, reopening and compiling solved the problem.
Hope that helps.
January 5th, 2004, 04:13 PM
The same error was occuring, i tried many things as discussed above when i finally noticed that my bin directory was named cgi-bin. When i renamed it to bin, site started working.
January 18th, 2004, 02:42 PM
I have been trying for two days to resolve this same problem - please anyone I'm really getting desperate!
Things I've tried
Rebuild Project - many times
Rebuild Solution - many times
delete dll from bin & rebuild - 3 times
delete entire bin dir & rebuild - 2 times
Rebuild solutions and project - 10 more times
remove problem file from solution, rebuild, add problem file back rebuild - 2 times
Change dir to application in IIS
remove application - different error
change back to application - same error
have read tech notes referred to in this thread - either not applicable or did not help at all. e.g. rebuild project....
January 20th, 2004, 03:58 AM
my solution to the problem
I had the same problems while i was developing a webapplication and a webservice.
My cause of the problem was that i changed the Output Path in the project properties for the Debug and Release configuration.
I thought i was handy to build the Debug version of the dll's to \bin\Debug and the Release version of the dll's to \bin\Release.
But for some reason IIS and/or VS does not understand to not only look in the \bin directory but also in the other directories.
I guess the general solution is to see if your latest build dll's are in the correct bin directory right under the directory where global.asax is.
March 23rd, 2004, 11:03 AM
I found another answer
Hi, just thought I'd share my answer to this frustrating problem.
Basically what I found was that for some reason, the class names that my .aspx pages where inheriting from were wrong. What happened
was that when checking the project in to source control, I had actually named my solution "Something.Net". This meant that all my
code behind inheritance directives said "Something.Net.class". (i.e. Something.Net._default) This may have been a problem.
When I noticed that, I recreated the solution as just "Something" and copied the files from the old solution. I then had to go in to the .aspx files
and change the page directives so that the pages inherited from Something._default.
After that it worked fine.
April 28th, 2004, 03:18 PM
I had the same problem today and wanted to thank you for posting what resolutions everyone came up with. Mine however; did not work using any of the above suggestions. Instead; I had to copy the file C:\WINNT\MICROSOFT.NET\FRAMEWORK\VER....\CONFIG\MA CHINE.CONFIG from the production server (which was working fine) to the developer server (which somehow got corrupted)
I tried adding a reference to SYSTEM.WINDOWS.FORMS.DLL and found it didnt work so when I removed the reference; that is when I started getting the error message.
May 6th, 2004, 12:31 AM
I got solution at last.
I too faced the same problem and finally looking over this thread , I found that the problem lies in the configuration of the project in folder in IIS. After fixing it, application is running like a horse.
By rajarao in forum .NET Development
Last Post: January 28th, 2009, 02:32 AM
By nineone in forum ASP Development
Last Post: January 20th, 2004, 08:33 AM
By codyc in forum .NET Development
Last Post: May 27th, 2003, 03:41 AM
By Steve Schofield in forum SQL Development
Last Post: July 27th, 2000, 01:12 AM
By Steve Schofield in forum SQL Development
Last Post: July 27th, 2000, 01:12 AM