Could not load type 'Namespace.[Global]' & different harddrives?

T

thefritz_j

We just converted our VS2003 1.1 VB web project (which was working
fine) to VS2005 2.0 and now I get:

Parser Error Message: Could not load type '<Namespace>.[Global]'.
Source Error:
Line 1: <%@ Application Codebehind="Global.asax.vb"
Inherits="<Namespace>.[Global]" %>

I've done a lot of things I've found on the web to no avial, but here
are some unique things about what is happening to me.

* I have all my development on a J drive. (local drive).
* I read that this error means you need to recompile so I deleted the
web app dll and pdb files. They haven't been rebuilt yet...because of
the initial error. Chicken before the egg?
* When I exclude/delete Global.* files I then get errors saying that
some of my User controls could also not be loaded
* Several of these User controls also now have image files can't be
found, (that really do exist). The missing image urls look like /web
app folder/graphics/image.gif
* Now for some reason instead of showing my web app name in Solution
Explorer is says "J:\...\Web app name".

Has anyone had these things happen? Does 2.0 not like virtual folders
on different harddrives? I read that Global is now a keyword, Can I
safely rename [Global] to Global2

Help!
Thanks

JF
 
N

Nathan Sokalski

Global.asax.vb does not exist in ASP.NET 2.0 (I had the same problem as you
when I converted to 2.0). My recommendation would be to update your
application by placing (and possibly modifying) any code in Global.asax.vb
in another file. If you don't want to bother trying to figure out where to
move this code to, you could create a class named Global, but in the long
taking this route will probably cause you more trouble than it's worth, so I
would just sacrifice the time to update your application to use ASP.NET
2.0's features/conventions and get rid of Global.asax/Global.asax.vb. You
can probably get help with some of the specific code you have in
Global.asax.vb if you post it here. Good Luck!
 
J

Juan T. Llibre

re:
Global.asax.vb does not exist in ASP.NET 2.0

Actually, it does, but you have to place it in the App_Code directory.
It will compile just fine if placed there.

The same for Global.asax.cs

The conversion wizard will move the files for you.






Nathan Sokalski said:
Global.asax.vb does not exist in ASP.NET 2.0 (I had the same problem as you when I converted to
2.0). My recommendation would be to update your application by placing (and possibly modifying)
any code in Global.asax.vb in another file. If you don't want to bother trying to figure out where
to move this code to, you could create a class named Global, but in the long taking this route
will probably cause you more trouble than it's worth, so I would just sacrifice the time to update
your application to use ASP.NET 2.0's features/conventions and get rid of
Global.asax/Global.asax.vb. You can probably get help with some of the specific code you have in
Global.asax.vb if you post it here. Good Luck!
--
Nathan Sokalski
(e-mail address removed)
http://www.nathansokalski.com/

thefritz_j said:
We just converted our VS2003 1.1 VB web project (which was working
fine) to VS2005 2.0 and now I get:

Parser Error Message: Could not load type '<Namespace>.[Global]'.
Source Error:
Line 1: <%@ Application Codebehind="Global.asax.vb"
Inherits="<Namespace>.[Global]" %>

I've done a lot of things I've found on the web to no avial, but here
are some unique things about what is happening to me.

* I have all my development on a J drive. (local drive).
* I read that this error means you need to recompile so I deleted the
web app dll and pdb files. They haven't been rebuilt yet...because of
the initial error. Chicken before the egg?
* When I exclude/delete Global.* files I then get errors saying that
some of my User controls could also not be loaded
* Several of these User controls also now have image files can't be
found, (that really do exist). The missing image urls look like /web
app folder/graphics/image.gif
* Now for some reason instead of showing my web app name in Solution
Explorer is says "J:\...\Web app name".

Has anyone had these things happen? Does 2.0 not like virtual folders
on different harddrives? I read that Global is now a keyword, Can I
safely rename [Global] to Global2

Help!
Thanks

JF
 
N

Nathan Sokalski

Sorry, my error. However, I still recommend getting rid of it since it is
not usually the recommended or most efficient way to do things in 2.0. What
code do you have in Global.asax (that was not placed there automatically)?
When I converted, most of the stuff had a place that it could be easily
moved to without any major changes, since there is usually very little code
that is manually added to Global.asax.vb or Global.asax.cs.
--
Nathan Sokalski
(e-mail address removed)
http://www.nathansokalski.com/

Juan T. Llibre said:
re:
Global.asax.vb does not exist in ASP.NET 2.0

Actually, it does, but you have to place it in the App_Code directory.
It will compile just fine if placed there.

The same for Global.asax.cs

The conversion wizard will move the files for you.






Nathan Sokalski said:
Global.asax.vb does not exist in ASP.NET 2.0 (I had the same problem as
you when I converted to 2.0). My recommendation would be to update your
application by placing (and possibly modifying) any code in
Global.asax.vb in another file. If you don't want to bother trying to
figure out where to move this code to, you could create a class named
Global, but in the long taking this route will probably cause you more
trouble than it's worth, so I would just sacrifice the time to update
your application to use ASP.NET 2.0's features/conventions and get rid of
Global.asax/Global.asax.vb. You can probably get help with some of the
specific code you have in Global.asax.vb if you post it here. Good Luck!
--
Nathan Sokalski
(e-mail address removed)
http://www.nathansokalski.com/

thefritz_j said:
We just converted our VS2003 1.1 VB web project (which was working
fine) to VS2005 2.0 and now I get:

Parser Error Message: Could not load type '<Namespace>.[Global]'.
Source Error:
Line 1: <%@ Application Codebehind="Global.asax.vb"
Inherits="<Namespace>.[Global]" %>

I've done a lot of things I've found on the web to no avial, but here
are some unique things about what is happening to me.

* I have all my development on a J drive. (local drive).
* I read that this error means you need to recompile so I deleted the
web app dll and pdb files. They haven't been rebuilt yet...because of
the initial error. Chicken before the egg?
* When I exclude/delete Global.* files I then get errors saying that
some of my User controls could also not be loaded
* Several of these User controls also now have image files can't be
found, (that really do exist). The missing image urls look like /web
app folder/graphics/image.gif
* Now for some reason instead of showing my web app name in Solution
Explorer is says "J:\...\Web app name".

Has anyone had these things happen? Does 2.0 not like virtual folders
on different harddrives? I read that Global is now a keyword, Can I
safely rename [Global] to Global2

Help!
Thanks

JF
 
J

Juan T. Llibre

re:
However, I still recommend getting rid of it

Absolutely.

Code-behind in global.asax is not the default any more for a very good reason:
the file doesn't have a UI and anything you can do in code-behind you can also
do inline, more efficiently, to boot.

Including a code-behind file for global.asax results in double compilation.




Nathan Sokalski said:
Sorry, my error. However, I still recommend getting rid of it since it is not usually the
recommended or most efficient way to do things in 2.0. What code do you have in Global.asax (that
was not placed there automatically)? When I converted, most of the stuff had a place that it could
be easily moved to without any major changes, since there is usually very little code that is
manually added to Global.asax.vb or Global.asax.cs.
Juan T. Llibre said:
re:
Global.asax.vb does not exist in ASP.NET 2.0

Actually, it does, but you have to place it in the App_Code directory.
It will compile just fine if placed there.

The same for Global.asax.cs

The conversion wizard will move the files for you.






Nathan Sokalski said:
Global.asax.vb does not exist in ASP.NET 2.0 (I had the same problem as you when I converted to
2.0). My recommendation would be to update your application by placing (and possibly modifying)
any code in Global.asax.vb in another file. If you don't want to bother trying to figure out
where to move this code to, you could create a class named Global, but in the long taking this
route will probably cause you more trouble than it's worth, so I would just sacrifice the time
to update your application to use ASP.NET 2.0's features/conventions and get rid of
Global.asax/Global.asax.vb. You can probably get help with some of the specific code you have in
Global.asax.vb if you post it here. Good Luck!
--
Nathan Sokalski
(e-mail address removed)
http://www.nathansokalski.com/

We just converted our VS2003 1.1 VB web project (which was working
fine) to VS2005 2.0 and now I get:

Parser Error Message: Could not load type '<Namespace>.[Global]'.
Source Error:
Line 1: <%@ Application Codebehind="Global.asax.vb"
Inherits="<Namespace>.[Global]" %>

I've done a lot of things I've found on the web to no avial, but here
are some unique things about what is happening to me.

* I have all my development on a J drive. (local drive).
* I read that this error means you need to recompile so I deleted the
web app dll and pdb files. They haven't been rebuilt yet...because of
the initial error. Chicken before the egg?
* When I exclude/delete Global.* files I then get errors saying that
some of my User controls could also not be loaded
* Several of these User controls also now have image files can't be
found, (that really do exist). The missing image urls look like /web
app folder/graphics/image.gif
* Now for some reason instead of showing my web app name in Solution
Explorer is says "J:\...\Web app name".

Has anyone had these things happen? Does 2.0 not like virtual folders
on different harddrives? I read that Global is now a keyword, Can I
safely rename [Global] to Global2

Help!
Thanks

JF
 
J

Juan T. Llibre

re:
That statement stands, in its very precise meaning.

You can only make the code-behind in global.asax option
available by modifying the default installation of VS 2005.

re:
For web application projects it most certainly is the default...

That is true, but is true *only* for VS with WAP installed
as an additional option...or WAP installed with VS SP1.

To make the point clearer, compare to the "designer.cs" files which WAP uses.
Would you say that they are a default feature in VS 2005 ?

However, WAP *is* a default feature in Visual Studio SP1.
I wish WDP had been included in it, too.
 
M

Mark Rae

That is true, but is true *only* for VS with WAP installed
as an additional option...or WAP installed with VS SP1.

Fair comment.
However, WAP *is* a default feature in Visual Studio SP1.
I wish WDP had been included in it, too.

Oh yes - me too!
 
J

JF

I'm not sure what WAP is but we've never had any code in the Global
file or even the Global namespace.

That said, if you note in my initial post I *did* remove this file and
I still get *apparent* pathing problems with images and lots of build
errors with my server controls. It is kind of behaving like it can't
see the designer.vb files that containe the server side asp
controls. Do the designer files have to appear as a dependant file
(child node) or can they show up in the solution underneath (sibiling
node) to the ascx files?
 
J

Juan T. Llibre

re:
I'm not sure what WAP is
Do the designer files have to ...

Question for you :

Since *.designer.cs and *.designer.vb files are *only* created by WAP,
how come you are not sure what WAP is ?

How did you install WAP ?
As the add-in...or as part of VS 2005 SP1 ?
 
J

JF

First, Thanks for taking the time on this with me!

Here's what I have in my Help/About

"Microsoft Web Application Projects 2005 Version 8.0.50727.762"
and
"Microsoft Visual Studio 2005 Professional Edition - ENU Service Pack
1 (KB926601) "

I didn't install anything as an "add-on", but I did install the
service pack before converting my project. I wasn't sure that you
meant "Web Application Projects". I guess this is the what they call
the new IDE for ASN.NET stuff. (?)

Also, FYI I'm using "Version: 5.1" of IIS.

Does the installation method of WAP affect it's ability to convert
projects with their paths intact?
 
J

Juan T. Llibre

re:
I didn't install anything as an "add-on"

Are you sure?

Check out the "SP1 release notes" KB :
http://support.microsoft.com/kb/928957

"Uninstallation of Visual Studio 2005 Web Application Projects required:

Follow these steps to install Visual Studio 2005 SP1 if you
have Visual Studio 2005 Web Application Projects installed:

1. Uninstall the Visual Studio 2005 Web Application Projects
( http://msdn2.microsoft.com/en-us/asp.net/aa336618.aspx ) add-in.

2. Install Visual Studio 2005 SP1."

You *must* uninstall WAP before uninstalling SP1.

There's also *other* issues with SP1 which you should familiarize yourself with.
Read that SP! release notes KB page...

re:
I guess this is the what they call the new IDE for ASP.NET stuff. (?)

Not quite.
It's a compilation model which is similar to what VS 2003 did.

re:
Does the installation method of WAP affect its ability
to convert projects with their paths intact?

Not sure, but if WAP was installed before SP1 is installed,
WAP must be uninstalled before SP1 is installed.





First, Thanks for taking the time on this with me!

Here's what I have in my Help/About

"Microsoft Web Application Projects 2005 Version 8.0.50727.762"
and
"Microsoft Visual Studio 2005 Professional Edition - ENU Service Pack
1 (KB926601) "

I didn't install anything as an "add-on", but I did install the
service pack before converting my project. I wasn't sure that you
meant "Web Application Projects". I guess this is the what they call
the new IDE for ASP.NET stuff. (?)

Also, FYI I'm using "Version: 5.1" of IIS.

Does the installation method of WAP affect it's ability to convert
projects with their paths intact?
 
J

JF

Well, I reviewed what we isntalled, here's what we did:

Installed VS2005
Installed "Update to the Web Project Conversion Wizard",
installed VS 2005 SP1 from the web site.
Converted project.

So, that's one reason why I didn't recognize WAP when you mentioned it
because I didn't install it in my steps.

Perhaps I'll unisntall it all and try the process all over and see at
which point "WAP" shows up in the help about.

Could it be that WAP has been included in SP1? From the release notes
it doesn't really sound like it, but maybe?
 
J

Juan T. Llibre

re:
Could it be that WAP has been included in SP1?

Yes, it is included in SP1.

See this blog entry by a member of the C# team:
http://blogs.msdn.com/charlie/archive/2006/10/12/the-c-teams-needs-input-on-vs-2005-sp1-beta.aspx

Don't worry about the fix mentioned in Scott Guthrie's blog.
That was fixed in the release version.

The issue is that, if you installed WAP from the standalone setup files,
you must uninstall it before applying Visual Studio SP1.

If you don't uninstall WAP before installing SP1, you'll have all sorts of problems,
just like the one you described in you original post. :-(

re your latest post, I notice this
Installed "Update to the Web Project Conversion Wizard",

Is that this one ?
http://www.microsoft.com/downloads/...52-fc04-4ef8-a28a-25c5006677d8&DisplayLang=en
....which corresponds to this KB :
http://support.microsoft.com/kb/898904

?

Or, was it this one :
http://msdn2.microsoft.com/en-us/asp.net/aa336618.aspx

If it was the latter one, you also need to install an update
( unless you uninstalled WAP and installed VS SP1 ) :

That update is at :
http://www.microsoft.com/downloads/...00-9554-4733-8725-3CA89DD9BFCA&displaylang=en

Again, if you installed WAP but didn't uninstall it before installing SP1,
you need to uninstall both WAP and SP1 and reinstall SP1.

Also, you'll do well to check out the list of fixes and hotfixes included in VS 2005 SP1:
http://bloggingabout.net/blogs/mgla...Studio-2005-SP1-_2600_amp_3B00_-Hotfixes.aspx

The very first one says that the "Update to the Web Project Conversion Wizard"
*and* the WAP update ( http://support.microsoft.com/kb/915364 ) are included in SP1.

Also, take notice that installing the WAP update if you haven't installed the WAP add-in does
nothing.

At this point, if I were you, I'd nuke both VS 2005 SP1 and VS 2005 and reinstall VS 2005 and SP1.
You'll be covered if you do that...and you won't have to bother adding any add-ins or updates.
 
J

JF

Well, I did nuke VS2005. (SP1 wasn't showing as a seperate item in
add/remove) and re-installed it alone.

Before installing SP1 I checked and saw that WAP wasn't there however
there was a "Microsoft Visual Web Developer 2005".

I then installed SP1 and... (drumroll please), it STILL didn't work.
(WAP was added) I did not isntall anything else, just the main studio
and the sp1.

Since I've excluded global.*, now I just get many, many "Could not
Load Type..." for most of my ascx files (server controls). I'm still
inclined to think that it's a namespace problem, but there isn't
anywhere to set namespace for the "web" project. Also note that when
I right click on the "web" project in the solution explorer I don't
have a "Properties" option, instead I have "Property Pages".

Additionally I get "Name 'Common' is not declared." but there is a
"Common.vb" in the root of the project and the file starts like this:

"
Imports System.Threading
Imports System.Text.RegularExpressions
Imports System.IO
Imports <namespace>.BusinessLayer

Module Common
Public Const EditCondition As String = "EditCondition"
...."


Do any of these "clues" help point out what I may have done?
I think we'll probably just rebuild the project from scratch based on
the old files... but can VS2005 convert 1.1 to 2.0 on a file-by-file
basis?

Thanks
 
J

JF

We rebuilt the solution by hand (added the existing files) and it
seemed to work. I suspect that it may have been a .webinfo file or
some other stray file that was confusing VS.

Thanks everyone for the help with this!

JF
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top