Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > .NET General

Vista - Website place class cs file outside App Code folder

Reply
 
Old 05-20-2009   #1 (permalink)
Ice


 
 

Website place class cs file outside App Code folder

Good morning! My apologies if this is a dumb question - but I've had no luck
searching for an answer and am on a tight deadline, so ...

I'm working on a tiny part of a huge project that uses the Website model.
I'd like to place some code in a separate class that I can reference from
several pages, but the .cs file for the class needs to be stored outsite the
App_Code folder. (Making any changes under App_Code causes the entire site to
recompile, which takes about 4 minutes - a real problem when you're on a
deadline. Converting to a Web Application is not an option, for the same
reason.)

I'd like to place my pages in a separate folder and place the .cs file for
the class in the same folder, but I keep getting compile error "CS0246: The
type or name space name 'x y z' could not be found (are you missing a using
directive or an assembly reference?)". If I place the code for the class
inside the .aspx .cs file it finds it, but I haven't found any way to make it
work with the class in a separate file.

What do I need to make my pages recognize the class? (Please spell out the
solution in detail if you would, I'm rushing around in too many directions at
once to think straight.)

Thank you!
Lena

My System SpecsSystem Spec
Old 05-20-2009   #2 (permalink)
Victor Amelkin


 
 

Re: Website place class cs file outside App Code folder

Hi Lena,

You can either use the ASP.NET Web Application as a project type
(it has no described drawback) or move the shared part of code to
an external assembly.

--
Victor
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Messanger Error code :80048820 + Microsoft website problem Live Messenger
Adding class library to website .NET General
Sfc_os.dll File in more than place Vista General
A place for shared ini-file Vista security
A place for shared ini-file Vista file management


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46