locked
Compiler Error Message: CS0246: The type or namespace name DataContext RRS feed

  • Question

  • User335416057 posted

    Hi

    I have now come to the end of my thether with this, I have a very very simple .NET website (VS2010 Website) that has some gridviews with linq data sources, it basically captures data. The solution contains a DBML model, two ASPX pages and some styling.

    I have published this site to a test server which is Windows 2003 SP2 with IIS6 and Framework 3.5 SP1 on which is works perfectly fine, how ever when i move this to the production server which is Windows 2003 R2 SP2 with IIS6 Framework 3.5 SP1 it get the following:

    The code is copied directly from the test server, I had to point the live one to its own app pool but i have even left the incorrect DB connection string for now to ensure nothing is a miss, but this to me looks like a compliation issue as the error implies! 

    I need help here I am missing something really simple but its just what.

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

    Source Error:

    Line 53: 
    Line 54:         //Insert new item into DB
    Line 55: var _dcAsset = new AssetDBDataContext(); Line 56: 
    Line 57:         var _cabinOrCabinet = new  CabinOrCabinet()


    Source File: e:\inetpub\wwwroot\InterComAssetRegister\AssetCapture.aspx.cs    Line: 55 


    Show Detailed Compiler Output:


    Show Complete Compilation Source:




    Version Information: Microsoft .NET Framework Version:2.0.50727.3082; ASP.NET Version:2.0.50727.3082

    Friday, May 31, 2013 4:23 AM

Answers

  • User-166373564 posted

    Hi,

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

    First you could refer the analysis of this compiler error mentioned above,

    http://support.microsoft.com/kb/304656 

    At the same time I would like to suggest you to learn how to deploy your website on IIS 6.0, this blog will give a detailed explanation for you,

    # Deployment of a Website on IIS

    hope it helps you,

    With regards

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, June 6, 2013 6:12 AM

All replies

  • User335416057 posted

    Additional info that repeats for all controls on the page

    c:\windows\system32\inetsrv> "C:\WINDOWS\Microsoft.NET\Framework\v3.5\csc.exe" /t:library /utf8output /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Data.DataSetExtensions\3.5.0.0__b77a5c561934e089\System.Data.DataSetExtensions.dll" /R:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Web.Mobile\2.0.0.0__b03f5f7f11d50a3a\System.Web.Mobile.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.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.IdentityModel\3.0.0.0__b77a5c561934e089\System.IdentityModel.dll" /R:"C:\WINDOWS\assembly\GAC_32\System.EnterpriseServices\2.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Web.Services\2.0.0.0__b03f5f7f11d50a3a\System.Web.Services.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.ServiceModel\3.0.0.0__b77a5c561934e089\System.ServiceModel.dll" /R:"C:\WINDOWS\assembly\GAC_32\System.Web\2.0.0.0__b03f5f7f11d50a3a\System.Web.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Xml.Linq\3.5.0.0__b77a5c561934e089\System.Xml.Linq.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Core\3.5.0.0__b77a5c561934e089\System.Core.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Drawing\2.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll" /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.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Web.Extensions\3.5.0.0__31bf3856ad364e35\System.Web.Extensions.dll" /R:"C:\WINDOWS\assembly\GAC_32\System.Data\2.0.0.0__b77a5c561934e089\System.Data.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.WorkflowServices\3.5.0.0__31bf3856ad364e35\System.WorkflowServices.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Data.Linq\3.5.0.0__b77a5c561934e089\System.Data.Linq.dll" /out:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\2e230ced\951dc92c\App_Web_kwrn4o5t.dll" /D:DEBUG /debug+ /optimize- /win32res:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\2e230ced\951dc92c\kwrn4o5t.res" /w:4 /nowarn:1659;1699;1701 /warnaserror-  "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\2e230ced\951dc92c\App_Web_kwrn4o5t.0.cs" "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\2e230ced\951dc92c\App_Web_kwrn4o5t.1.cs" "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\2e230ced\951dc92c\App_Web_kwrn4o5t.2.cs"
    
    
    Microsoft (R) Visual C# 2008 Compiler version 3.5.30729.1
    for Microsoft (R) .NET Framework version 3.5
    Copyright (C) Microsoft Corporation. All rights reserved.
    
    e:\inetpub\wwwroot\InterComAssetRegister\AssetCapture.aspx.cs(55,28): error CS0246: The type or namespace name 'AssetDBDataContext' could not be found (are you missing a using directive or an assembly reference?)
    e:\inetpub\wwwroot\InterComAssetRegister\AssetCapture.aspx.cs(57,36): error CS0246: The type or namespace name 'CabinOrCabinet' could not be found (are you missing a using directive or an assembly reference?)
    e:\inetpub\wwwroot\InterComAssetRegister\AssetCapture.aspx.cs(81,28): error CS0246: The type or namespace name 'AssetDBDataContext' could not be found (are you missing a using directive or an assembly reference?)
    e:\inetpub\wwwroot\InterComAssetRegister\AssetCapture.aspx.cs(83,34): error CS0246: The type or namespace name 'CabinDoorLock' could not be found (are you missing a using directive or an assembly reference?)
    e:\inetpub\wwwroot\InterComAssetRegister\AssetCapture.aspx.cs(107,28): error CS0246: The type or namespace name 'AssetDBDataContext' could not be found (are you missing a using directive or an assembly reference?)
    e:\inetpub\wwwroot\InterComAssetRegister\AssetCapture.aspx.cs(109,30): error CS0246: The type or namespace name 'FenceType' could not be found (are you missing a using directive or an assembly reference?)
    e:\inetpub\wwwroot\InterComAssetRegister\AssetCapture.aspx.cs(133,28): error CS0246: The type or namespace name 'AssetDBDataContext' could not be found (are you missing a using directive or an assembly reference?)
    e:\inetpub\wwwroot\InterComAssetRegister\AssetCapture.aspx.cs(135,35): error CS0246: The type or namespace name 'PortableLadder' could not be found (are you missing a using directive or an assembly reference?)
    e:\inetpub\wwwroot\InterComAssetRegister\AssetCapture.aspx.cs(159,28): error CS0246: The type or namespace name 'AssetDBDataContext' could not be found (are you missing a using directive or an assembly reference?)
    e:\inetpub\wwwroot\InterComAssetRegister\AssetCapture.aspx.cs(161,36): error CS0246: The type or namespace name 'ElectricalMeter' could not be found (are you missing a using directive or an assembly reference?)
    Friday, May 31, 2013 4:26 AM
  • User-166373564 posted

    Hi,

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

    First you could refer the analysis of this compiler error mentioned above,

    http://support.microsoft.com/kb/304656 

    At the same time I would like to suggest you to learn how to deploy your website on IIS 6.0, this blog will give a detailed explanation for you,

    # Deployment of a Website on IIS

    hope it helps you,

    With regards

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, June 6, 2013 6:12 AM