locked
[solved] Splitting functionality into dlls/separate code files RRS feed

  • Question

  • User-1707359321 posted

    I'm trying to get a simple website up and running, and I'm new to asp.net.  I have:

     

    • default.aspx
    • default.aspx.cs
    • app_code
    • utils.cs
    I'm trying to get code referenced in my utils file into the default code file.  When i "run" the webpage from within VS2008, everything works as i would expect, but trying to navigate directly to the http://localhost/test/default.aspx page, (using IIS, instead of whatever VS uses), it fails, saying that it didn't understand any references to the utils.cs
    I've also tried rearranging the project so that utils.cs compiles into a dll, but this didn't work either - I could see the dll in my bin directory, but it wasn't linked in automatically (looking at the error, it was obvious that the dll wasn't included in the compiling of the aspx page)

    Wednesday, April 6, 2011 7:35 AM

Answers

  • User581921910 posted

    Hi,

    Please set the property of utils.cs to compile mode. Place this under App_Code folder. This will sove your problem

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, April 7, 2011 1:19 PM

All replies

  • User11483486 posted

    try building your project and generating dlls and deploy to IIS and try browsing your website.

    Wednesday, April 6, 2011 8:03 AM
  • User-1707359321 posted

    When I try that, I get a different error, albeit the same kind of thing - it says that it can't find the dll with the auto-generated-random name (which can be found in the bin directory)

    It feels like the IIS settings are wrong somehow - I've tried playing with the "application" settings, turning the folder into an application, in the IIS config tool, but i'll admit i don't really know what i'm doing with it!

     

    Wednesday, April 6, 2011 9:11 AM
  • User581921910 posted

    Hi,

    Please set the property of utils.cs to compile mode. Place this under App_Code folder. This will sove your problem

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, April 7, 2011 1:19 PM