Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Terry Clancy 204 posts 944 karma points
    Aug 07, 2015 @ 07:00
    Terry Clancy
    0

    The type or namespace name 'global_asax' does not exist in the namespace 'ASP' (are you missing an assembly reference?)

    Hi all,

    I am running Umbraco 7 with uCommerce and I am getting this error :

    The type or namespace name 'global_asax' does not exist in the namespace 'ASP' (are you missing an assembly reference?)

    and I am not sure what caused it (I was not previously getting it).

    I am getting this error in 14 files which are not even ins the solution !@#? They are in the following location :

    C:\Users\v-terrcl\AppData\Local\Temp\Temporary ASP.NET Files\root\f5406281\63b285ae\SourcesAppCode

    Can anyone please help me solve the problem an help me understand why it is compiling files outside of the solution folders ?

    Thanks

    Terry Clancy ClanceZ

    PS Here is a summary of the errors:

    Severity Code Description Project File Line

    Error CS0234 The type or namespace name 'global_asax' does not exist in the namespace 'ASP' (are you missing an assembly reference?)

    TeraTastic02    C:\Users\v-terrcl\AppData\Local\Temp\Temporary ASP.NET Files\root\f5406281\63b285ae\Sources_App_Code\basket.cshtml.d5362fc8.cs  166
    

    Error CS0234 The type or namespace name 'global_asax' does not exist in the namespace 'ASP' (are you missing an assembly reference?)

    TeraTastic02    C:\Users\v-terrcl\AppData\Local\Temp\Temporary ASP.NET Files\root\f5406281\63b285ae\Sources_App_Code\category.cshtml.9019fc77.cs    155
    

    Error CS0234 The type or namespace name 'global_asax' does not exist in the namespace 'ASP' (are you missing an assembly reference?)

    TeraTastic02    C:\Users\v-terrcl\AppData\Local\Temp\Temporary ASP.NET Files\root\f5406281\63b285ae\Sources_App_Code\product.cshtml.9019fc77.cs 457
    

    Error CS0234 The type or namespace name 'global_asax' does not exist in the namespace 'ASP' (are you missing an assembly reference?)

    TeraTastic02    C:\Users\v-terrcl\AppData\Local\Temp\Temporary ASP.NET Files\root\f5406281\63b285ae\Sources_App_Code\product.cshtml.d5362fc8.cs 65
    

    Error CS0234 The type or namespace name 'global_asax' does not exist in the namespace 'ASP' (are you missing an assembly reference?)

    TeraTastic02    C:\Users\v-terrcl\AppData\Local\Temp\Temporary ASP.NET Files\root\f5406281\63b285ae\Sources_App_Code\productreview.cshtml.9019fc77.cs   1325
    

    Error CS0234 The type or namespace name 'global_asax' does not exist in the namespace 'ASP' (are you missing an assembly reference?)

    TeraTastic02    C:\Users\v-terrcl\AppData\Local\Temp\Temporary ASP.NET Files\root\f5406281\63b285ae\Sources_App_Code\review.cshtml.9019fc77.cs  108
    

    Error CS0234 The type or namespace name 'global_asax' does not exist in the namespace 'ASP' (are you missing an assembly reference?)

    TeraTastic02    C:\Users\v-terrcl\AppData\Local\Temp\Temporary ASP.NET Files\root\f5406281\63b285ae\Sources_App_Code\review.cshtml.d5362fc8.cs  108
    

    Error CS0234 The type or namespace name 'global_asax' does not exist in the namespace 'ASP' (are you missing an assembly reference?)

    TeraTastic02    C:\Users\v-terrcl\AppData\Local\Temp\Temporary ASP.NET Files\root\f5406281\63b285ae\Sources_App_Code\basket.cshtml.d5362fc8.cs  168
    

    Error CS0234 The type or namespace name 'global_asax' does not exist in the namespace 'ASP' (are you missing an assembly reference?)

    TeraTastic02    C:\Users\v-terrcl\AppData\Local\Temp\Temporary ASP.NET Files\root\f5406281\63b285ae\Sources_App_Code\category.cshtml.9019fc77.cs    157
    

    Error CS0234 The type or namespace name 'global_asax' does not exist in the namespace 'ASP' (are you missing an assembly reference?)

    TeraTastic02    C:\Users\v-terrcl\AppData\Local\Temp\Temporary ASP.NET Files\root\f5406281\63b285ae\Sources_App_Code\product.cshtml.9019fc77.cs 459
    

    Error CS0234 The type or namespace name 'global_asax' does not exist in the namespace 'ASP' (are you missing an assembly reference?)

    TeraTastic02    C:\Users\v-terrcl\AppData\Local\Temp\Temporary ASP.NET Files\root\f5406281\63b285ae\Sources_App_Code\product.cshtml.d5362fc8.cs 67
    

    Error CS0234 The type or namespace name 'global_asax' does not exist in the namespace 'ASP' (are you missing an assembly reference?)

    TeraTastic02    C:\Users\v-terrcl\AppData\Local\Temp\Temporary ASP.NET Files\root\f5406281\63b285ae\Sources_App_Code\productreview.cshtml.9019fc77.cs   1327
    

    Error CS0234 The type or namespace name 'global_asax' does not exist in the namespace 'ASP' (are you missing an assembly reference?)

    TeraTastic02    C:\Users\v-terrcl\AppData\Local\Temp\Temporary ASP.NET Files\root\f5406281\63b285ae\Sources_App_Code\review.cshtml.9019fc77.cs  110
    

    Error CS0234 The type or namespace name 'global_asax' does not exist in the namespace 'ASP' (are you missing an assembly reference?)

    TeraTastic02    C:\Users\v-terrcl\AppData\Local\Temp\Temporary ASP.NET Files\root\f5406281\63b285ae\Sources_App_Code\review.cshtml.d5362fc8.cs  110
    
  • Carl Jackson 139 posts 478 karma points
    Aug 07, 2015 @ 07:58
    Carl Jackson
    0

    Framework issue maybe? Is your app pool set to .net framework version 4 not 2?

    Or are you missing a dll file from your server maybe?

    Thanks

  • Terry Clancy 204 posts 944 karma points
    Aug 07, 2015 @ 18:04
    Terry Clancy
    0

    Thank you very much for your suggestion Carl.

    I think you may be on to something because I think (?) this started when I reimaged my machine and moved to Windows 10.

    I have checked IIS Manager and the application pool used for my web site in IIS uses .Net CLR V4.0 (V4.0.30319).

    However this error occurs when recompiling in Visual Studio BEFORE I even try and run the site using IIS or VS Debug.

    So I still have not solved the issue and would appreciate any more suggestions, particularly considering that I have just moved to Windows 10.

    Terry Clancy ClanceZ

  • Carl Jackson 139 posts 478 karma points
    Aug 07, 2015 @ 20:34
    Carl Jackson
    0

    Maybe try running nuget package restore?

    How many projects are in your solution? Are there any conflicting dependencies there.

    Also, are you targeting .net 4.0 or 4.5 + in your solution?

    Thanks

  • Terry Clancy 204 posts 944 karma points
    Aug 08, 2015 @ 04:45
    Terry Clancy
    0

    Hi again Carl,

    Do you mean to run a Nuget "package restore" on what package ? Umbraco ? or .Net ? or what ?

    I have only one "Project" in my "Solution".

    When I select "Properties" on that project, the Target Framework is ".NET Framework 4.5.1"

    So I can not see any conflicting framework conflict ? I am not sure what to try next ?

    Terry Clancy ClanceZ

  • Carl Jackson 139 posts 478 karma points
    Aug 08, 2015 @ 07:51
    Carl Jackson
    0

    What can you supply the code from one if the mentioned view files?

    Thanks

  • Terry Clancy 204 posts 944 karma points
    Aug 09, 2015 @ 04:32
    Terry Clancy
    0

    Hi again Carl and thanks for your assistance.

    Sure here is the content of:

    C:\Users\v-terrcl\AppData\Local\Temp\Temporary ASP.NET Files\root\f5406281\63b285ae\SourcesAppCode\basket.cshtml.d5362fc8.cs

    Here it is:

    pragma checksum "C:\Clancy\ATeraTastic\Dev\TeraTastic02\TeraTastic02\AppCode\uCommerce\Functions\Basket.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "354FF1D4CFDBA58CD7CCE3478F16691A55B64FF9"

    //------------------------------------------------------------------------------ // //------------------------------------------------------------------------------

    namespace ASP.uCommerce.Functions { using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Net; using System.Web; using System.Web.Helpers; using System.Web.Security; using System.Web.UI; using System.Web.WebPages; using System.Web.WebPages.Html;

    #line 1 "C:\Clancy\A_TeraTastic\Dev\TeraTastic02\TeraTastic02\App_Code\uCommerce\Functions\Basket.cshtml"
    using UCommerce.Api;
    
    #line default
    #line hidden
    
    
    public class Basket : System.Web.WebPages.HelperPage {
    

    line hidden

        #line 2 "C:\Clancy\A_TeraTastic\Dev\TeraTastic02\TeraTastic02\App_Code\uCommerce\Functions\Basket.cshtml"
    
    public static bool? AddToBasket(string addToBasketKey, string quantityKey, UCommerce.EntitiesV2.Product variant)
    {
        var request = HttpContext.Current.Request;
    
        if (request.Form.AllKeys.All(x => x != addToBasketKey))
        {
            return null;
        }
    
        if (variant == null)
        {
            return false;
        }
    
        var quantity = Convert.ToInt32(request.Form[quantityKey]);
        TransactionLibrary.AddToBasket(quantity, variant.Sku, variant.VariantSku);
        TransactionLibrary.ExecuteBasketPipeline();
        var returnUrl = request.RawUrl;
    
        if (returnUrl.Contains("item-added"))
            HttpContext.Current.Response.Redirect(returnUrl);
    
        if (returnUrl.Contains("?"))
            HttpContext.Current.Response.Redirect(string.Format("{0}&item-added=true", returnUrl));
    
        HttpContext.Current.Response.Redirect(string.Format("{0}?item-added=true", returnUrl));
        return true;
    }
    
    public static bool? AddVoucher(string addVoucherKey, string voucherKey)
    {
        var request = HttpContext.Current.Request;
    
        if (request.Form.AllKeys.All(x => x != addVoucherKey))
        {
            return null;
        }
    
        if (request.Form.AllKeys.All(x => x != voucherKey))
        {
            return false;
        }
    
        var code = request.Form[voucherKey];
        if (string.IsNullOrWhiteSpace(code))
        {
            return false;
        }
    
        MarketingLibrary.AddVoucher(code);
        TransactionLibrary.ExecuteBasketPipeline();
        return true;
    }
    
    public static bool? RemoveItem(string removeItemKey)
    {
        var request = HttpContext.Current.Request;
    
        if (!request.Form.AllKeys.Any(x => x.Equals(removeItemKey)))
        {
            return null;
        }
    
        int orderLineId;
    
        if (!int.TryParse(request.Form[removeItemKey], out orderLineId))
        {
            return false;
        }
    
        TransactionLibrary.UpdateLineItem(orderLineId, 0);
        TransactionLibrary.ExecuteBasketPipeline();
        HttpContext.Current.Response.Redirect(request.RawUrl);
    
        return true;
    }
    
    public static bool? UpdateCartLines(string updateItemKey, string quantityKey, UCommerce.EntitiesV2.PurchaseOrder basket)
    {
        var request = HttpContext.Current.Request;
    
        if (!request.Form.AllKeys.Any(x => x.Equals(updateItemKey)))
        {
            return null;
        }
    
        // NOTE: This could be made more efficient by checking whether the quantities are different
        foreach (var orderLineId in basket.OrderLines.Select(x => x.OrderLineId).ToList())
        {
            int newQuantity;
            if (int.TryParse(request.Form[quantityKey + orderLineId], out newQuantity))
            {
                TransactionLibrary.UpdateLineItem(orderLineId, newQuantity);
            }
        }
    
        //// NOTE: If you are expecting a lot of changes each time, this would be better a better way to handle the updates
        // var orderLines = basket.OrderLines.ToList();
        // foreach (var orderLine in orderLines)
        // {
        //     int newQuantity;
    
        //     if (!int.TryParse(request.Form[quantityKey + orderLine], out newQuantity)) 
        //         continue;
    
        //     orderLine.Quantity = newQuantity;
    
        //     if (newQuantity == 0)
        //         basket.RemoveOrderLine(orderLine);
        // }
    
        foreach (var line in basket.OrderLines.Where(l => l.Quantity == 0))
        {
            basket.RemoveOrderLine(line);
        }
    
        TransactionLibrary.ExecuteBasketPipeline();
        return true;
    }
    
    
        #line default
        #line hidden
    
    
        public Basket() {
        }
    
        protected static ASP.global_asax ApplicationInstance {
            get {
                return ((ASP.global_asax)(Context.ApplicationInstance));
            }
        }
    }
    

    }

  • Terry Clancy 204 posts 944 karma points
    Aug 09, 2015 @ 04:35
    Terry Clancy
    0

    Hi again

    I have an update on the symptoms of this problem

    (1) I have copied my solution back to a machine running Windows Server 2012 R2 and Visual Studio 13 and found that the error does not occur in that environment

    (2) Another (new) error has emerged :

        Error CS1061 'HtmlHelper<RenderModel>' does not contain a definition for 'RenderPartial' 
         and no extension method 'RenderPartial' accepting a first argument of type 
         'HtmlHelper<RenderModel>' could be found (are you missing a using directive or an assembly 
         reference?) TeraTastic02 C:\Clancy\A_TeraTastic\Dev\TeraTastic02\TeraTastic02
         \Views\TTMaster2.cshtml 88
    
    This error also does not occur on Windows Server 2012 R2 and Visual Studio 13.
    

    This adds weight to the hypothesis that the error is caused by the move to Windows 10 and Visual Studio Enterprise 2015. Any help resolving this would be appreciated.

    Terry Clancy

    ClanceZ

  • Martyn 2 posts 22 karma points
    Sep 03, 2015 @ 20:27
    Martyn
    0

    Hi Terry

    I came across this page https://support.microsoft.com/en-us/kb/3025133

    which suggests the following

    "ASP.NET and Web Development When you create a Web Forms 4.5 WAP and open a Web Form page, you receive the following errors in the Errors List window:

    The project will run without any issues. Error CS0234 The type or namespace name 'global_asax' does not exist in the namespace 'ASP' (are you missing an assembly reference?) Error CS0234 The type or namespace name 'Linq' does not exist in the namespace 'System' (are you missing an assembly reference?) Assume that you use new language features for C# and VB in Visual Studio 2015 RC. You receive a runtime error when you use C# or VB in a Web Form page or in Razor Views.

    To work around this issue, install Microsoft.CodeDom.Providers.DotNetCompilerPlatform NuGet package. This package will substitute the Roslyn-based provider for the in-box CodeDom providers for ASP.NET."

    Not sure this is 100% relevant to your problem but might be worth looking at

Please Sign in or register to post replies

Write your reply to:

Draft