0

After following the recommendations in the following question's answers, I've been able to get Razor mostly working in FubuMVC.

Need razor view engine auto-complete to work in a class library?

However, the only way I can get Intellisense to work with the @model is to disable ReSharper's Intellisense. With R# 6, you can now specify limited R# Intellisense. Unfortunately, the only way to disable R# Intellisense for Razor is to disable the code in supported server pages; C# in my case. Doing so, also disables R# Intellisense for all C# files as well. That's definitely not ideal.

Currently, all ReSharper Intellisense is working in my Razor views as expected, except for the @model.

What does ReSharper need to be able to work properly with Razor views in FubuMVC? Am I just missing a reference, or should I create the web application as an ASP.NET MVC application instead of the recommended standard web application?

1 Answer 1

1

Take a look at the FubuMVC.HelloWorld project inside FubuMVC's source. There are a couple things required, your web.config needs to contain the compilation section, and the system.web.webPages.razor section. You must also add references to System.Web.Mvc, System.Web.WebPages.Razor, System.Web.WebPages.

Everything described above is only necessary for the tooling. The implementation doesn't depend on any of those things being present.

This may be improved a bit after RazorEngine implements a build provider, and we may do this for you when you add the nuget package.

3
  • Thanks for the response, Corey. I verified that I have the appropriate configSection defined, and the system.web.webPages.razor section matches that of the HelloWorld project's. I was missing the compilation/assemblies section and references to System.Web.Mvc and System.Web.WebPages.I just added those missing bits and still cannot get ReSharper Intellisense to recognize the @model and therefore any references to the Model property.
    – ventaur
    Mar 31, 2012 at 16:34
  • Disabling ReSharper altogether for Razor appears to be the only way I can get Intellisense to work in Razor files with FubuMVC now. Corey, are you successfully using R# 6 in your FubuMVC.Razor files?
    – ventaur
    Mar 31, 2012 at 16:35
  • Okay, this is just odd. There must have been some sort of R# cache interfering. I just kept enabling/disabling R# Intellisense and then it just started working partially. It was weird. My reference to Model.SomeProperty was still showing as an error, so I changed it to this.Model.SomeProperty and it worked, but then R# mentioned 'this' was redundant. Took out "this." again and all seems to work now. Sorry for the multiple comments above. Your suggestions that I was missing seems to have done the trick once R# cleared itself out, I suppose.
    – ventaur
    Mar 31, 2012 at 16:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.