This project is read-only.

Can't access objects in another project

Sep 8, 2011 at 1:57 PM

For example: If I have 2 projects.  One with the views named MyViews, another with a class like this:

namespace MyTest.Business.Components
{

 public struct Tokens

{

  public const String MyToken = "XYZ";

}

}

If I try and access MyToken string in my view in the "MyViews" project it compiles fine until I add the RazorGenerator to the view, then it won't compile, it gives me an error: "MyViews.MyTest does not contain a definition for "Business"

var myToken = '@MyTest.Business.Components.Tokens.MyToken';

Any thoughts?

 

Coordinator
Sep 8, 2011 at 5:27 PM
Edited Sep 8, 2011 at 5:27 PM

Is the project that contains the view a regular Mvc project (File -> New Project -> Mvc 3 Web Application)? You'll run into designer issues if the view is located in a regular class library. (http://razorgenerator.codeplex.com/discussions/268455)