This project is read-only.

Unable to resolve Namespace

Feb 3, 2012 at 10:45 AM
Edited Feb 3, 2012 at 10:46 AM

When Compiling my project after the generator has done its job, I get the following errors on all my views:

Error 15 The type or namespace name 'Collections' does not exist in the namespace 'Caracal.Application.Views.System' (are you missing an assembly reference?) application\Views\_ViewStart.generated.cs 15 18 application
... (many more)
Error 18 The type or namespace name 'Net' does not exist in the namespace 'Caracal.Application.Views.System' (are you missing an assembly reference?) application\Views\_ViewStart.generated.cs 18 18 application
... (many more)

The generated code looks like this:

#pragma warning disable 1591
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.239
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.

namespace Caracal.Application.Views
    using System;
    using System.Collections.Generic;
    using System.IO;
    using System.Linq;
    using System.Net;
    using System.Text;
    using System.Web;
    using System.Web.Helpers;
    using System.Web.Mvc;
    using System.Web.Mvc.Ajax;
    using System.Web.Mvc.Html;
    using System.Web.Routing;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.WebPages;
    using Caracal.Application;
    using Caracal.Application.Helpers;
    using Caracal.Application.Models;
    using Caracal.Application.Models.ViewModels;
    using Caracal.Application.Source.EntityExtensions;
    using Caracal.Application.Source.Statistics;
    using Caracal.Entities;
    using Caracal.Entities.Data.Tuple;
    using Caracal.Entities.Onderwijs;
    using Caracal.Messages;
    using Caracal.Resources;
    [System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "")]
    public class ViewStart : System.Web.Mvc.ViewStartPage
        public ViewStart()
        public override void Execute()

            #line 1 "..\..\Views\_ViewStart.cshtml"
    Layout = "~/Views/Shared/Layouts/_Layout.cshtml";

            #line default
            #line hidden

#pragma warning restore 1591

All the used namespaces from pointer a to pointer b cannot be resolved, causing the explained errors.
This problem leaves me with a solution that cannot be compiled, any suggestions? (Double checked the obvious that all namespaces are truly referenced by the assembly)


p.s. Love this project!

Feb 3, 2012 at 3:44 PM

One curious thing is that when I prefix the system namespaces with the global alias (like global::System etc.), the errors disappear.
Is there seomething that I do wrong, does have to something with a configuration entry in the web.config?

I need of help here...


Feb 3, 2012 at 5:42 PM

You have views under a directory named System (~/Views/System) and the files under it are generated with the namespace Caracal.Application.Views.System that's causing issues with the namespace resolution. One option would be to select all the views under the System directory and specify a value for CustomToolNamespace in the Property dialog (any namespace would do). The other alternative is you could consider renaming the directory although that probably isn't going to be feasible.