APP_CODE directory and Conversion to VS 2005

R

Randy

I've converted a VS 2003 project to VS 2005. I have one utility class that
it put in the APP_CODE directory. When I try and compile I'm getting this
error...
Error 1 The type or namespace name 'WelcomeToPFP' could not be found (are
you missing a using directive or an assembly reference?)
C:\Inetpub\wwwroot\PFPApp\App_Code\Utils.cs 19 9

WelcomeToPFP is a class defined in the root directory of the solution.
My question is...I'm drawing a blank as to how to let this Utils class in
the APP_CODE directory know about the WelcomeToPFP class out in the main
solution directory...what is the syntax to correct this?

Thanks
Randy
 
N

Nicholas Paldino [.NET/C# MVP]

Randy,

Why not move the code file from the main directory to the APP_CODE
directory as well?
 
R

Randy

Nicholas,
I've got about 40 files which make up my solution. After conversion to 2005,
all of them are in the main solution directory. The conversion just put this
one file (Utils class) in the APP_CODE directory, I believe because it is
just a standalone class. In this standalone class (Utils) in the APP_CODE
directory, I'm declaring an object of a class (WelcomeToPFP) which is one of
the files in the main solution directory. I'm thinking it would not be the
correct thing to do to move it (WelcomeToPFP) into the APP_CODE directory
because it would probably create many more compile errors. I just need a way
(syntax) to let this Utils class in the APP_CODE directory see the
'WelcomeToPFP' class in the main solution directory. But I'm not sure of the
syntax to do this.
Thanks

Nicholas Paldino said:
Randy,

Why not move the code file from the main directory to the APP_CODE
directory as well?


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Randy said:
I've converted a VS 2003 project to VS 2005. I have one utility class
that it put in the APP_CODE directory. When I try and compile I'm getting
this error...
Error 1 The type or namespace name 'WelcomeToPFP' could not be found (are
you missing a using directive or an assembly reference?)
C:\Inetpub\wwwroot\PFPApp\App_Code\Utils.cs 19 9

WelcomeToPFP is a class defined in the root directory of the solution.
My question is...I'm drawing a blank as to how to let this Utils class in
the APP_CODE directory know about the WelcomeToPFP class out in the main
solution directory...what is the syntax to correct this?

Thanks
Randy
 
R

Randy

Also...I tried moving the Utils.cs file from the APP_CODE directory into the
main solution directory, but then I get many other compile errors because
all the main classes which use this Utils class can't see it then. They for
some reason are expecting it to be in the APP_CODE directory.

Nicholas Paldino said:
Randy,

Why not move the code file from the main directory to the APP_CODE
directory as well?


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Randy said:
I've converted a VS 2003 project to VS 2005. I have one utility class
that it put in the APP_CODE directory. When I try and compile I'm getting
this error...
Error 1 The type or namespace name 'WelcomeToPFP' could not be found (are
you missing a using directive or an assembly reference?)
C:\Inetpub\wwwroot\PFPApp\App_Code\Utils.cs 19 9

WelcomeToPFP is a class defined in the root directory of the solution.
My question is...I'm drawing a blank as to how to let this Utils class in
the APP_CODE directory know about the WelcomeToPFP class out in the main
solution directory...what is the syntax to correct this?

Thanks
Randy
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,


Did you convert it to a web APP or a web SITE?

The main difference is that the latter the namespaces are created for you,
This in theory should makes it easier to develop, IMHO it's a pain in the
a... !
Convert it to a web app instead, You have to download the SP1 of VS IIRC.
 
R

Randy

I removed it and reconverted it from a backup. This time I did the "Convert
to Web App" (I think it was) which I didn't do last time. It put everything
in the main solution directory this time and it all compiles. So...it
appears solved...Thanks
 

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

Top