Copied to clipboard

Flag this post as spam?

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


  • Jacob Phillips 34 posts 84 karma points
    Jan 01, 2014 @ 20:14
    Jacob Phillips
    0

    'WebExtensions' does not exist in the namespace 'System.Web'

    uBlogsy version: 2.1.1.2 Umbraco Version: 4.9.1

    When I install as a local package (after unblocking the downloaded zip file), uBlogsy installs, but any pages I view generate the following errors all over each page:

    Error loading Razor Script /uBlogsy/uBlogsyBrowserTitle.cshtml c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\2b948917\acf654a0\AppWebublogsybrowsertitle.cshtml.df712cef.th_gnx5b.0.cs(27): error CS0234: The type or namespace name 'WebExtensions' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)

    I tried uninstalling and reinstalling. I also tried deleting the files under "c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\2b948917"

    I had installed this on a dev server a couple of months ago and it was fine.

    Any suggestions?

  • Jacob Phillips 34 posts 84 karma points
    Jan 01, 2014 @ 20:56
    Jacob Phillips
    0

    I see in the aforementioned .cs file on line 27:

    using System.Web.WebExtensions;
    

    I can't find anything on that on MSDN.

    I do see System.Web.Extensions.

    Hmmm

  • Anthony Dang 1404 posts 2558 karma points MVP 3x c-trib
    Jan 02, 2014 @ 02:00
  • jacob phillips 130 posts 372 karma points
    Jan 02, 2014 @ 03:17
    jacob phillips
    0

    I just downloaded the install package from the project page from Umbraco.
    System.Web is in the Umbraco bin folder though. I haven't loaded or modified the project in VS at all at this point.

    The Error says "WebExtensions" is not in the System.Web namespace. Is the error handler dropping the '.' in WebExtensions?
    Does it really mean "Web.Extensions"?

    I also looked in the ASP file:

    c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\2b948917\acf654a0\AppWebublogsybrowsertitle.cshtml.df712cef.th_gnx5b.0.cs

    and it has a "using System.Web.WebExtensions" statement (no '.') at the top.

    I tried editing that line to:

    "using System.Web.Extensions"

    But the file just gets regenerated.

  • Jacob Phillips 34 posts 84 karma points
    Jan 03, 2014 @ 00:02
    Jacob Phillips
    0

    So just to be clear, that stackoverflow message is a different error. It says is referring to System.Web.Extensions. This error is referring to "System.Web.WebExtensions". That namespace doesn't even exist in the .NET Framework afaik.

    So if I'm not mistaken, uBlogsy is generating the .cshtml referenced above. If in fact, uBlogsy is putting in a non-existent namespace (i.e. System.Web.WebExtensions), is my only choice downloading the source of the project and trying to figure out where/why it is doing this?

    Here is an example of what the top-level page in the blog is generating in the browser (from a clean, unchanged install):

    enter image description here

    And, looking in one of the files in one of the error messages shows a file trying to include a namespace that DNE:

    #pragma checksum "C:\inetpub\wwwroot\newdev\App_Data\TEMP\Razor\inline-6d21bde5280d9aae2508bb29af4307b7.razor" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "DAA8F514F49CF477DB0565A10469177C38BF6110"
    //------------------------------------------------------------------------------
    // <auto-generated>
    //     This code was generated by a tool.
    //     Runtime Version:4.0.30319.18052
    //
    //     Changes to this file may cause incorrect behavior and will be lost if
    //     the code is regenerated.
    // </auto-generated>
    //------------------------------------------------------------------------------
    
    namespace ASP {
        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;
        using Microsoft.Web.Helpers;
        using umbraco;
        using Examine;
        using System.Web.WebExtensions;
    
    
        public class _Page_App_Data_TEMP_Razor_inline_6d21bde5280d9aae2508bb29af4307b7_razor : umbraco.MacroEngines.DynamicNodeContext {
    
    #line hidden
    
    
            public _Page_App_Data_TEMP_Razor_inline_6d21bde5280d9aae2508bb29af4307b7_razor() {
            }
    
            protected System.Web.HttpApplication ApplicationInstance {
                get {
                    return ((System.Web.HttpApplication)(Context.ApplicationInstance));
                }
            }
    
            public override void Execute() {
    
    
                #line 1 "C:\inetpub\wwwroot\newdev\App_Data\TEMP\Razor\inline-6d21bde5280d9aae2508bb29af4307b7.razor"
       var landing = uBlogsy.BusinessLogic.DataService.Instance.GetLanding(Model.Id);
    
    
                #line default
                #line hidden
    WriteLiteral("                            <a href=\"");
    
    
    
                #line 2 "C:\inetpub\wwwroot\newdev\App_Data\TEMP\Razor\inline-6d21bde5280d9aae2508bb29af4307b7.razor"
                                    Write(landing.Url);
    
    
                #line default
                #line hidden
    WriteLiteral("\">");
    
    
    
                #line 2 "C:\inetpub\wwwroot\newdev\App_Data\TEMP\Razor\inline-6d21bde5280d9aae2508bb29af4307b7.razor"
                                                  Write(landing.uBlogsyContentTitle);
    
    
                #line default
                #line hidden
    WriteLiteral("</a> ");
    
    
    
                #line 2 "C:\inetpub\wwwroot\newdev\App_Data\TEMP\Razor\inline-6d21bde5280d9aae2508bb29af4307b7.razor"
    
    
                #line default
                #line hidden
    
            }
        }
    }
    

    Thanks for any suggestions.

  • Jacob Phillips 34 posts 84 karma points
    Jan 03, 2014 @ 00:22
    Jacob Phillips
    0

    Duplicate posting removed (posting comments appears to not work sometimes (was using FF 26.0)

  • jacob phillips 130 posts 372 karma points
    Jan 03, 2014 @ 00:26
    jacob phillips
    0

    Here is what the top-level blog pages looks like in the browser after a clean install with no modifications.

  • jacob phillips 130 posts 372 karma points
    Jan 03, 2014 @ 00:32
    jacob phillips
    0

    After looking inside one fo the .cshtml files referenced in the errors, the file is including a namespace that does nto even exist in the .NET Framework. Am I right in assuming that uBlogsy is generating these files, and if so, why is it including a non-existent namespace? Again "System.Web.Extensions" exists, but that is not the error here, the error is for "System.Web.WebExtensions"

    Here is the actual code generated in one of the .cshtml files.

     

    #pragma checksum "C:\inetpub\wwwroot\newdev\App_Data\TEMP\Razor\inline-6d21bde5280d9aae2508bb29af4307b7.razor" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "DAA8F514F49CF477DB0565A10469177C38BF6110"
    //------------------------------------------------------------------------------
    // <auto-generated>
    //     This code was generated by a tool.
    //     Runtime Version:4.0.30319.18052
    //
    //     Changes to this file may cause incorrect behavior and will be lost if
    //     the code is regenerated.
    // </auto-generated>
    //------------------------------------------------------------------------------
    namespace ASP {
        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;
        using Microsoft.Web.Helpers;
        using umbraco;
        using Examine;
        using System.Web.WebExtensions;
       
       
        public class _Page_App_Data_TEMP_Razor_inline_6d21bde5280d9aae2508bb29af4307b7_razor : umbraco.MacroEngines.DynamicNodeContext {
           
    #line hidden
            
            public _Page_App_Data_TEMP_Razor_inline_6d21bde5280d9aae2508bb29af4307b7_razor() {
            }
           
            protected System.Web.HttpApplication ApplicationInstance {
                get {
                    return ((System.Web.HttpApplication)(Context.ApplicationInstance));
                }
            }
           
            public override void Execute() {
                
                #line 1 "C:\inetpub\wwwroot\newdev\App_Data\TEMP\Razor\inline-6d21bde5280d9aae2508bb29af4307b7.razor"
       var landing = uBlogsy.BusinessLogic.DataService.Instance.GetLanding(Model.Id);
                
                #line default
                #line hidden
    WriteLiteral("                            <a href=\"");

               
                #line 2 "C:\inetpub\wwwroot\newdev\App_Data\TEMP\Razor\inline-6d21bde5280d9aae2508bb29af4307b7.razor"
                                    Write(landing.Url);
                
                #line default
                #line hidden
    WriteLiteral("\">");

               
                #line 2 "C:\inetpub\wwwroot\newdev\App_Data\TEMP\Razor\inline-6d21bde5280d9aae2508bb29af4307b7.razor"
                                                  Write(landing.uBlogsyContentTitle);
                
                #line default
                #line hidden
    WriteLiteral("</a> ");

               
                #line 2 "C:\inetpub\wwwroot\newdev\App_Data\TEMP\Razor\inline-6d21bde5280d9aae2508bb29af4307b7.razor"
                                                                                       
               
                #line default
                #line hidden
            }
        }
    }

     

    So is this a matter of downloading the source of this project, and trying to figure out why these files being generated are trying to include a namespace that doesn't exist? Or is it something else?

    It just seems like the base install would not generate a using statement to a namespace (and a .NET framework namespace under System.Web) that DNE.

     

  • Anthony Dang 1404 posts 2558 karma points MVP 3x c-trib
    Jan 03, 2014 @ 11:40
    Anthony Dang
    0

    uBlogsy is just a collection of dlls and cshtml files. It doesnt generate any files.

    I think you may have an issue with either IIS, or .net not being installed /registered propertly. Possibly net 3.5 ?

    Ensure that you have 2.0, 3.5, and 4.0 installed and registered in IIS.

    http://msdn.microsoft.com/en-us/library/k6h9cz8h.ASPX

    Also ensure that the application pool is .net 4.0.

     

     

  • Jacob Phillips 34 posts 84 karma points
    Jan 04, 2014 @ 00:17
    Jacob Phillips
    0

    Thanks

    All .NET Framework versions were installed/registered. This might be a useful article for someone else verifying v 3.5

    ...But this did lead me a new direction, and eventually, I found the problem in my web.config:

      <system.web.webPages.razor>
        <host factoryType="umbraco.MacroEngines.RazorUmbracoFactory, umbraco.MacroEngines" />
        <pages pageBaseType="umbraco.MacroEngines.DynamicNodeContext">
          <namespaces>
            <add namespace="Microsoft.Web.Helpers" />
            <add namespace="umbraco" />
            <add namespace="Examine" />
            <add namespace="System.Web.WebExtensions" />
          </namespaces>
        </pages>
      </system.web.webPages.razor>
    

    Not sure why this namespace was defined in there; I have no recollection of making this change:

    <add namespace="System.Web.WebExtensions" />
    

    , Or knowing if an application would have added it. Removing it fixed the problem. This is another reason why I should have all these files under source control.

  • Anthony Dang 1404 posts 2558 karma points MVP 3x c-trib
    Jan 04, 2014 @ 19:18
    Anthony Dang
    0

    Interesting.

    I do recall having that issue once. I think it was because I created a project using .net 2.0 and then changed it to 4.0. Or something like that.

    Anyway, I'm glad you managed to figure it out.

     

Please Sign in or register to post replies

Write your reply to:

Draft