Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Could not load type 'Namespace.[Global]' & different harddrives?

Reply
Thread Tools

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

 
 
thefritz_j
Guest
Posts: n/a
 
      02-06-2007
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

 
Reply With Quote
 
 
 
 
Nathan Sokalski
Guest
Posts: n/a
 
      02-07-2007
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
http://www.velocityreviews.com/forums/(E-Mail Removed)
http://www.nathansokalski.com/

"thefritz_j" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.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
>



 
Reply With Quote
 
 
 
 
Juan T. Llibre
Guest
Posts: n/a
 
      02-07-2007
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.





Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
"Nathan Sokalski" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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 Removed)
> http://www.nathansokalski.com/
>
> "thefritz_j" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed) oups.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
>>

>
>



 
Reply With Quote
 
Nathan Sokalski
Guest
Posts: n/a
 
      02-07-2007
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 Removed)
http://www.nathansokalski.com/

"Juan T. Llibre" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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.
>
>
>
>
>
> Juan T. Llibre, asp.net MVP
> asp.net faq : http://asp.net.do/faq/
> foros de asp.net, en espaņol : http://asp.net.do/foros/
> ===================================
> "Nathan Sokalski" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>> 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 Removed)
>> http://www.nathansokalski.com/
>>
>> "thefritz_j" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed) oups.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
>>>

>>
>>

>
>



 
Reply With Quote
 
Juan T. Llibre
Guest
Posts: n/a
 
      02-07-2007
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.



Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
"Nathan Sokalski" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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 Removed)
> http://www.nathansokalski.com/


> "Juan T. Llibre" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> 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.
>>
>>
>>
>>
>>
>> Juan T. Llibre, asp.net MVP
>> asp.net faq : http://asp.net.do/faq/
>> foros de asp.net, en espaņol : http://asp.net.do/foros/
>> ===================================
>> "Nathan Sokalski" <(E-Mail Removed)> wrote in message
>> news:%(E-Mail Removed)...
>>> 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 Removed)
>>> http://www.nathansokalski.com/
>>>
>>> "thefritz_j" <(E-Mail Removed)> wrote in message
>>> news:(E-Mail Removed) oups.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
>>>>
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
Mark Rae
Guest
Posts: n/a
 
      02-07-2007
"Juan T. Llibre" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...

> Code-behind in global.asax is not the default any more


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


 
Reply With Quote
 
Juan T. Llibre
Guest
Posts: n/a
 
      02-07-2007
re:
>> Code-behind in global.asax is not the default any more


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.




Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
"Mark Rae" <(E-Mail Removed)> wrote in message news:%(E-Mail Removed)...
> "Juan T. Llibre" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...


>> Code-behind in global.asax is not the default any more


> For web application projects it most certainly is the default...



 
Reply With Quote
 
Mark Rae
Guest
Posts: n/a
 
      02-07-2007
"Juan T. Llibre" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...

> 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!


 
Reply With Quote
 
JF
Guest
Posts: n/a
 
      02-07-2007
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?

 
Reply With Quote
 
Juan T. Llibre
Guest
Posts: n/a
 
      02-07-2007
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 ?




Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
"JF" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> 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?
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
could not load type "_default" M ASP .Net 1 07-24-2006 04:29 PM
Could not load type =?Utf-8?B?RGhlZXJhaiBXYWRo?= ASP .Net 2 10-26-2005 06:33 PM
Could not load type - not obvious ChrisC ASP .Net 8 05-12-2005 01:20 PM
Could not load type Neil Ramsbottom ASP .Net 2 07-30-2003 05:23 AM
could not load type global bob ASP .Net 1 07-02-2003 04:18 AM



Advertisments