none
Compilation error RRS feed

  • Question

  • I keep getting this compilation error, related to the datasets I'm using for a locally hosted site.

    Server Error in '/' Application.

    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 'PostsDSTableAdapters' could not be found (are you missing a using directive or an assembly reference?)

    Source Error:

    Line 35:         */
    Line 36:
    Line 37: PostsDSTableAdapters.edaniels_postsTableAdapter postsTableAdapter =
    Line 38: new PostsDSTableAdapters.edaniels_postsTableAdapter();
    Line 39: DataSet PostsData = new DataSet();

    PostsDSTableAdapters is the table adapter I created for the dataset. Everything runs perfectly fine in the debugger, but when I try to access the webpage in a browser I get the error above. And if I add 'using' directives, it complains about those not having a required dll. The files in question are in a subdirectory of an already functioning local site, if that means anything.

    New to .NET so... assume I missed some of the basic steps.

    Any ideas?
    Tuesday, June 2, 2009 7:02 PM

Answers

  • I am not sure what the problem is but I think that the files I pointed to are not compiled in. Perhaps this link describes the Asp.net link that outlines how the compilation works

    http://msdn.microsoft.com/en-us/library/ms366723.aspx

    Typically things are compiled into Temporary Internet files, the directory is listed in the above link. Look in this directory for your compiled application. Use .net reflector or some app to review the MSIL and see if its compiled in.


    Thanks
    Chris
    This posting is provided "AS IS" with no warranties, and confers no rights.
    Friday, June 5, 2009 4:18 PM

All replies

  • Typically ASP.net will compile thier program when a user first accesses the website. I would look at what ASP.net is compiling into the binary to see if your Typed DataSet code is there. Do you have a separate datalayer dll that is compiled in? Or is the whole thing in an ASP.net website project? Where ever you are calling the code for the TypedDataSet is the correct namespaces defined in the file?

    Thanks
    Chris Robinson
    Program Manager - DataSet
    This posting is provided "AS IS" with no warranties, and confers no rights.
    Wednesday, June 3, 2009 3:27 PM
  • The dataset is included in .xsd files inside the project I built. Should I be referencing them through a dll or would that matter?


    Server Error in '/' Application.

    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 'PostsDSTableAdapters' could not be found (are you missing a using directive or an assembly reference?)

    Source Error:

     
    Line 12: using System.Collections.Generic;
    Line 13: using System.Text;
    Line 14: using PostsDSTableAdapters;
    Line 15: using UsersDSTableAdapters;
    Line 16:

    Source File: ... \bulletinboardapp\Default.aspx.cs    Line: 14



    c:\windows\system32\inetsrv> "c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\csc.exe" /t:library /utf8output /R:"C:\WINDOWS\assembly\GAC_MSIL\System.ServiceModel.Web\3.5.0.0__31bf3856ad364e35\System.ServiceModel.Web.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Drawing\2.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll" /R:"C:\WINDOWS\assembly\GAC_32\System.EnterpriseServices\2.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.ServiceModel\3.0.0.0__b77a5c561934e089\System.ServiceModel.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.WorkflowServices\3.5.0.0__31bf3856ad364e35\System.WorkflowServices.dll" /R:"c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll" /R:"c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\40ea235e\45a6afb9\assembly\dl3\c793a923\cab33f8d_0fe3c901\SMSAC.SESSIONSTATEPROVIDER.DLL" /R:"c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\40ea235e\45a6afb9\assembly\dl3\a307e3c3\76b25e8d_0fe3c901\SMSac.Common.Logging.DLL" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.IdentityModel\3.0.0.0__b77a5c561934e089\System.IdentityModel.dll" /R:"c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\40ea235e\45a6afb9\assembly\dl3\2e870318\3a3d498d_0fe3c901\NLog.DLL" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll" /R:"c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\40ea235e\45a6afb9\assembly\dl3\0410d24e\c2521e8d_0fe3c901\SMSac.UniqueURL.DLL" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Web.Services\2.0.0.0__b03f5f7f11d50a3a\System.Web.Services.dll" /R:"C:\WINDOWS\assembly\GAC_32\System.Web\2.0.0.0__b03f5f7f11d50a3a\System.Web.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Runtime.Serialization\3.0.0.0__b77a5c561934e089\System.Runtime.Serialization.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll" /R:"c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\40ea235e\45a6afb9\assembly\dl3\d23d9619\f666128d_0fe3c901\SMSAC.UNIQUEURLREDIRECTOR.DLL" /R:"c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\40ea235e\45a6afb9\assembly\dl3\5dec77ce\c4bff261_15e3c901\fanbox.DLL" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Web.Mobile\2.0.0.0__b03f5f7f11d50a3a\System.Web.Mobile.dll" /R:"C:\WINDOWS\assembly\GAC_32\System.Data\2.0.0.0__b77a5c561934e089\System.Data.dll" /out:"c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\40ea235e\45a6afb9\App_Web_uqvsjrc0.dll" /D:DEBUG /debug+ /optimize- /w:4 /nowarn:1659;1699;1701  "c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\40ea235e\45a6afb9\App_Web_uqvsjrc0.0.cs" "c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\40ea235e\45a6afb9\App_Web_uqvsjrc0.1.cs" "c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\40ea235e\45a6afb9\App_Web_uqvsjrc0.2.cs" "c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\40ea235e\45a6afb9\App_Web_uqvsjrc0.3.cs" "c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\40ea235e\45a6afb9\App_Web_uqvsjrc0.4.cs"


    Microsoft (R) Visual C# 2005 Compiler version 8.00.50727.3053
    for Microsoft (R) Windows (R) 2005 Framework version 2.0.50727
    Copyright (C) Microsoft Corporation 2001-2005. All rights reserved.

    ...\bulletinboardapp\Default.aspx.cs(14,7): error CS0246: The type or namespace name 'PostsDSTableAdapters' could not be found (are you missing a using directive or an assembly reference?)
    ...\bulletinboardapp\Default.aspx.cs(15,7): error CS0246: The type or namespace name 'UsersDSTableAdapters' could not be found (are you missing a using directive or an assembly reference?)
    ...\bulletinboardapp\reply.aspx.cs(14,7): error CS0246: The type or namespace name 'PostsDSTableAdapters' could not be found (are you missing a using directive or an assembly reference?)
    ...\bulletinboardapp\reply.aspx.cs(15,7): error CS0246: The type or namespace name 'UsersDSTableAdapters' could not be found (are you missing a using directive or an assembly reference?)
    ...\bulletinboardapp\reply.aspx.cs(16,7): error CS0246: The type or namespace name 'ThreadDSTableAdapters' could not be found (are you missing a using directive or an assembly reference?)

    This is the error I get from adding the using directives.
    Wednesday, June 3, 2009 5:36 PM
  • What about the code files? TypedDataSets and Adatpers produce code, are these being built into the Asp.net project?

    Thanks
    Chris
    This posting is provided "AS IS" with no warranties, and confers no rights.
    Friday, June 5, 2009 1:40 AM
  • They're included in the project, I assume they're being compiled correctly but I'm not sure what/where the .asp file looks for to reference the datasets. I mean the project works fine in the debugger, it's just when I browse to it outside of the IDE that I have problems.
    Friday, June 5, 2009 3:42 PM
  • I am not sure what the problem is but I think that the files I pointed to are not compiled in. Perhaps this link describes the Asp.net link that outlines how the compilation works

    http://msdn.microsoft.com/en-us/library/ms366723.aspx

    Typically things are compiled into Temporary Internet files, the directory is listed in the above link. Look in this directory for your compiled application. Use .net reflector or some app to review the MSIL and see if its compiled in.


    Thanks
    Chris
    This posting is provided "AS IS" with no warranties, and confers no rights.
    Friday, June 5, 2009 4:18 PM