How to reference dlls in bin folder when deploying with dynamic compilation

Discussion in 'ASP.NET 2.0' started by jwilde, May 30, 2008.

  1. Thanks Mark. I should have been more clear in my post. The code does work in Visual Studio.. so I don't think there is anything wrong with the code. What is missing is the reference to Report.dll, which definies the ReportTools namespace. The first reference to the namespace, which exists in a using statement, is throwing the error.
     
  2. Just to be more clear.. in that link you gave, it says:

    Assembly Reference:

    Make sure that you have referenced the assembly that contains the namespace. If you are developing in Visual Studio .NET, you can go to the Project menu and click Add Reference. On the .NET tab, choose the assembly that contains the namespace that you are trying to import, or Browse to the folder that contains the assembly. If you are using the command-line compiler, add the appropriate switch (/reference) to the compile statement.



    So, I am indeed missing the assembly reference in the version that exists at DiscountAsp.net. Locally, using Visual Studio, however, the reference is fine. So my question is - when you deploy a project live, where is the JIT compiler getting its references information from? How can I get it to see Report.dll in the same way it is being seen when I run the project from within VS?

    Thanks!

    Jeff
     
  3. Hi Mark,


    Can I use version 9.0 on .Net 2.0?


    NowI use version 8.0


    <add assembly="Microsoft.ReportViewer.Common, Version=8.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
    <add assembly="Microsoft.ReportViewer.ProcessingObjectModel, Version=8.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
    <add assembly="Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>



    Best regards.


    Alexei Cioina.


    http://www.californiadreamhomesandland.com
     
  4. Guess so...According to Bruce v9 is now on all of the servers.
    Salute,
    Mark
     
  5. Hi Jeff,
    Are we talking about SQL Server Reports in VS?
    If so, creating report pages in VS will add the references to the components that are on the DASP servers.
    Your web.config should have sections with these:

    <assemblies>
    <add assembly="Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
    <add assembly="Microsoft.ReportViewer.Common, Version=9.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
    </assemblies>




    <add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.Common, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    </buildProviders>


    <httpHandlers>
    <add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" validate="false" />
    </httpHandlers>
     
  6. Hi all.

    I've deployed my asp.net application using the technique of throwing up all the source files (.cs) and letting the JIT compiler dynamically compile the web app the first time it is hit. But I think I don't have a grip on how I reference certain dlls.

    Currently, I get this error:

    Compilation Error

    Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

    Compiler Error Message: CS0246: The type or namespace name 'ReportTools' could not be found (are you missing a using directive or an assembly reference?)

    Source Error:


    Line 17: using BaseClasses.Data;
    Line 18: using BaseClasses.Utils;
    Line 19: using ReportTools.ReportCreator;
    Line 20: using ReportTools.Shared;
    Line 21:

    Source File: EditCategoryPage.Controls.cs Line: 19


    I believe this namespace exists in an assembly 'Report.dll'. Do I need to reference this assembly or namespace explicitly in the web.config or something? Generally, in the past, it seems I've gotten away with just putting these files in the bin and it has been OK.

    Any help would be appreciated - thanks!

    Jeff
     
  7. Hi,
    ASP.NET will toss this generic error with the namespace that is missing for several reasons.
    In C# it's often due to case sensitivity.
    Most often the namespace needed is not referenced.
    See if this helps a bit:
    http://support.microsoft.com/kb/304656
    Salute,
    Mark
     
  8. I've only tested it with .NET v3.5 but since the reports v9 are named 2008, well...
    Open a support ticket and ask which version to use on your server. [​IMG]
    Salute,
    Mark
     

Share This Page