IIS cannot see my DLLs

Last post 10-22-2007 4:28 AM by dermotos. 6 replies.

Sort Posts:

  • IIS cannot see my DLLs

    10-12-2007, 11:57 AM
    • Loading...
    • dermotos
    • Joined on 08-15-2007, 9:45 AM
    • Posts 4

    Hi,

     

    Ive been developing a system for the last month using .Net 2.0 in Visual Studio 2005. Its a web project, Ajax Enabled (Probably irrevelant) This has been debugged on the ASP.NET Development server that ships with VS2005. I am now trying to move it to a staging server running IIS, however, it simply wont work. After a lot of playing around with settings, i have narrowed it down to the fact that IIS, for some reason, cannot see DLLS that are in the web project. For example, I have two dlls, one called common.dll and one called dataaccess.dll. If i write code on a test default page, in a button event to do something like:

     

    Button.Text = now.ToString("hh:mm:ss")

    It works fine. However, when i add the line:

    Dim x As new Common.ColumnItem()
     

    It crashes out. The dlls are properly registered, and i have tried both registering the dlls directly and registering the projects which generate the dlls. (They are part of the same solution) but no luck. I can also confirm that the dlls ARE in the bin directory of the website.

    If i try to just copy the website (so it compiles on first request) i get the error saying "Common.ColumnItem is not defined". If i build it as a pre-compiled site (wwhich isnt really an option for this site in the long run) i just get that "This is a placeholder..." text, when i should be seeing the page content.

     

    Has anyone any ideas? Ive been developing asp.net for years and never encountered this before.

    Thanks for reading anyway! :-)
     

    Filed under: , ,
  • Re: IIS cannot see my DLLs

    10-12-2007, 12:52 PM
    • Loading...
    • hongping
    • Joined on 11-02-2006, 9:42 PM
    • Posts 434
    • AspNetTeam

    Just checking, are the references to the dlls specified in the web.config?

    What does "crashes out" mean? Any stack trace or exception reported? Anything reported in event viewer?

    It is not clear what are the exact steps you did to deploy. You mentioned that you "try to just copy", how is the different from the initial attempt that you performed?

    Also, could you try just an empty web site to see if works, just to make sure settings in IIS have not been inadvertently changed somehow?

    ==============================================
    If you get the answer to your question, please mark it as the answer.
  • Re: IIS cannot see my DLLs

    10-15-2007, 4:22 AM
    • Loading...
    • dermotos
    • Joined on 08-15-2007, 9:45 AM
    • Posts 4

    Sorry, "Crashes out" wasnt very clear. It basically means that i get an error saying that the type of the variable im trying to declare isnt defined. Even though it is in a seperate DLL, its just IIS isnt "seeing" it.

     Ive tried it with a demo project, and it occurs as soon as an external DLL is used.

    So , say i define a class called TestClass in a class library called TestLib which results in the dll TestLib.dll. I add it to the solution with a TestWebsite with a single page called Default.aspx I add a project reference (or direct to the binary, it doesnt make a difference) to the web project, then on the first line of Page_Load in Default.aspx i have the line:

     

    Dim abc As New TestClass()

     

    It will crash out in this, giving me the standard ASP.NET error page with the error information:

    Dim abc As New TestClass() (in red)

    TestClass is not defined

     

    Regarding what you were saying about the web config, i never had to do that manually before. I dont see any references to my dlls in it. I assume they should be under <assemblies />

    Where do i get the info for them, eg: the public keytoken or the culture?

    <add assembly="System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>

     

    Thanks. :-)



     

  • Re: IIS cannot see my DLLs

    10-15-2007, 12:42 PM
    • Loading...
    • hongping
    • Joined on 11-02-2006, 9:42 PM
    • Posts 434
    • AspNetTeam

    Did the referenced dll get copied to the BIN folder of the web site project? Here is an article on adding references to another project in a Web Site project:

    http://msdn2.microsoft.com/en-us/library/f3st0d45(VS.80).aspx

    You can just use the assembly name if it doesn't have a public key token. The referenced assemblies should be in the BIN folder, or one of the locations that gets looked up:

    <add assembly="MyAssembly"/>

    http://msdn2.microsoft.com/en-us/library/37e2zyhb.aspx

    Another thing you could do, is to just put your code into App_Code. For example, you can have a file named TestClass.cs in the folder App_Code.

    ==============================================
    If you get the answer to your question, please mark it as the answer.
  • Re: IIS cannot see my DLLs

    10-16-2007, 5:37 AM
    • Loading...
    • dermotos
    • Joined on 08-15-2007, 9:45 AM
    • Posts 4

     Thanks for your reply, but i found what the problem was. On the testing server, the folder was only part of the default application, not its own application, so it was looking in the root bin folder for its binaries, and they werent there. I know, it was a silly mistake, espically since i am fully aware of applications etc in IIS. but at least its sorted now!

     

    For anyone who encounters this problem, right click on the folder in IIS configuration and click Create to create an application for the project

     

    *rolls eyes* !! 

  • Re: IIS cannot see my DLLs

    10-17-2007, 5:24 PM
    • Loading...
    • faldridge
    • Joined on 10-17-2007, 9:07 PM
    • Posts 2

     Thank you so much, dermotos.  I was encountering the same problem, and your advice solved my issue, except for possibly one thing:

    My background is in PHP, Java, Ruby, etc. running on Linux/Apache platforms, so I am completely new to the Windows Server-side programming environment in general.

    My question is this (for anybody): If I am developing a plug-in component in ASP.NET for existing web sites, does the average person with a Windows-based hosting package have permission to create a sub-application like this in IIS?

    The reason this is important is that I must be able to keep the source code for my classes in their own App_Code folder that is independent of my users' main application App_Code folder.

     

    Thank You.
     

  • Re: IIS cannot see my DLLs

    10-22-2007, 4:28 AM
    • Loading...
    • dermotos
    • Joined on 08-15-2007, 9:45 AM
    • Posts 4

    To create a new application, you can do it through the IIS configuration applet. If you have some windows hosting package, then it depends on the type of account you have. Normally, your hosting package will be its own web application, ie: you will have your own web.config, app_data, bin folders etc that dont affect others on the same server. To create ANOTHER account under your account probably wont be possible. Where i work, for example,we have a reseller account which means we CAN do that, through the control panel that the hosting service provides. With a standard package however, you probably wont be able to create a seperate one, and would need another hosting package.

Page 1 of 1 (7 items)
Microsoft Communities
Page view counter