Re: Use class ... why is not available?



I am pretty sure that classes in the App_Code folder don't work in a Web Application Project as you would expect them to in a Web Site project. Put them next to the aspx pages and they'll get compiled.
Peter
"shapper" <mdmoura@xxxxxxxxx> wrote in message news:1a2b3250-759d-4df2-924b-538291ad210b@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On May 8, 6:25 pm, "Juan T. Llibre" <nomailrepl...@xxxxxxxxxxx> wrote:
re:
!> The problem is when I create classes in App_Folder they don't
!> seem to be accessible to ASPX pages as it is usual in Web Site.

!> The only solution I found was to make all classes "Build: Compile"
!> and rename the App_Code folder to New_App_Code.

Have you tried putting all your classes in the App_Code folder, instead of in your App_Folder folder ?

ASP.NET will not automatically compile classes in application folders,
but *will* compile classes in source files in the App_Code folder.

Better yet, have you considered compiling your helper classes
into assemblies and placing the dll's in your app's bin directory ?

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/
======================================

"shapper" <mdmo...@xxxxxxxxx> wrote in messagenews:93187d96-3ff0-4157-956f-d6d1bdbc12cc@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> On May 8, 3:13 pm, "Mark Rae [MVP]" <m...@xxxxxxxxxxxxxxxxx> wrote:
>> "shapper" <mdmo...@xxxxxxxxx> wrote in message

>>news:811ff1c6-7f0c-4849-96e4-7d55f109b3f7@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

>> > I added a class but whatever I do the class is not visible to my aspx
>> > pages or anywhere else.

>> > I then changed the property Build Action in my class from Content to
>> > Compile. Now it is recognized.

>> > Why do I need to do this?

>> Sounds like something's up with your installation of VS.NET, as classes
>> (should) have their Build Action property set to Compile by default...

>> --
>> Mark Rae
>> ASP.NET MVPhttp://www.markrae.net

> Hi,

> I think the problem is where the classes are being added to.
> App_Folder or somewhere else.

> I created a Web Application Project.

> When I add a class to App_Folder it VS 2008 makes "Build: Content". If
> I add the class somewhere else it says "Build: Compile".

> The problem is when I create classes in App_Folder they don't seem to
> be accessible to ASPX pages as it is usual in Web Site.

> When I changed them "Build: Compile" then I am able to build the
> solution with no errors but when I preview an ASPX pages I get errors
> everywhere.

> The only solution I found was to make all classes "Build: Compile" and
> rename the App_Code folder to New_App_Code.

> I think I am missing something.

> Any idea?

> Thanks,

> Miguel

Sorry, when I wrote App_Folder I meant App_Code ... and that is the
strange problem!

Thanks,
Miguel

.



Relevant Pages

  • Re: xcopy is not recognized as an internal or external command
    ... > months they one day I hit the compile button and BAM! ... > 'xcopy' is not recognized as an internal or external command, ... Go to this web site: ... Extract the files from the zip folder and run fixpath.exe. ...
    (microsoft.public.windowsxp.general)
  • Re: Use class ... why is not available?
    ... seem to be accessible to ASPX pages as it is usual in Web Site. ... Have you tried putting all your classes in the App_Code folder, instead of in your App_Folder folder? ... ASP.NET will not automatically compile classes in application folders, ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Use class ... why is not available?
    ... seem to be accessible to ASPX pages as it is usual in Web Site. ... Have you tried putting all your classes in the App_Code folder, instead of in your App_Folder folder? ... ASP.NET will not automatically compile classes in application folders, ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Use class ... why is not available?
    ... seem to be accessible to ASPX pages as it is usual in Web Site. ... Have you tried putting all your classes in the App_Code folder, instead of in your App_Folder folder? ... ASP.NET will not automatically compile classes in application folders, ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Where are project files?
    ... Also, even when that compile happens, each page is ... There was immediate "grumbling" from VS 2003 developers, ... since each page is effectively its own island in a web site (no more ... The code is not within the aspx pages. ...
    (microsoft.public.dotnet.framework.aspnet)

Loading