Orchard 1.8 Theme References

Topics: Troubleshooting
Apr 5 at 7:00 PM
So I've upgraded my development machine to Orchard 1.8 and I've rebuilt the themes I'm working on as .NET 4.5 projects.

I'm getting tons of errors in Visual Studio that don't affect the themes when using them, but makes developing harder. It all seems to track back to the following:

"The pre-application start initialization method Start on type System.Web.Mvc.PreApplicationStartCode threw an exception with the following message: Could not load file or assembly 'System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified."

I checked the lib directory and the 3.0 version of System.Web.WebPages.Razor is in there. I also checked the Orchard.Web project and the reference points to that version. I even tried adding a reference to that library directly to my theme and it didn't change anything.

I have rebuilt the entire 1.8 solution as well as my theme, but the error persists.

These are themes that were originally built in 1.7.2 source. Also, the theme I started in 1.8 has absolutely NO intellisense on the razor items...it's like it's completely ignoring them.

Any ideas on what may have happened? Is there something in 1.8 source that I didn't load properly or need to do? Thanks for any help.
Apr 5 at 7:10 PM
Edited Apr 5 at 7:12 PM
A little bit of progress...after updating the themes to .NET 4.5, I decided to restart Visual Studio 2012.

Now my 1.7 themes are behaving like the new 1.8 theme I created in that the errors are gone, but razor syntax intellisense is working at all.

I suppose that's progress : \

Just as a reference too...if I open up Layout.cshtml from TheThemeMachine in 1.8, or any file in a 1.8 module actually, I don't get intellisense either.

Any ideas on how I can get that back in 1.8? Thanks =)
Apr 5 at 8:13 PM
AH! Near success.

I decided to just replace the contents of the web.config file in my theme with the contents of the one for the theme I created in 1.8

I also did some other things such as upgrade my VS Web Tools to the newest version.

I have nearly everything working again with razor intellisense. Just a few strange errors where it doesn't recognize things like
using (Script.Foot()) {
}

or

@Url

or

@Display
Apr 5 at 8:28 PM
So the only thing I'm missing at this point are the Orchard Helpers...similar to this post

https://orchard.codeplex.com/discussions/529611

Although I'm using 1.8 source (downloaded last night).

If anyone has suggestions on how to get those back, it would be greatly appreciated. Thanks =)
Apr 5 at 8:45 PM
And...in true fashion of my development environment, the errors suddenly disappeared without me doing anything again.

I'm not complaining that it does that...I just wish I knew why it all of a sudden it decided to stop throwing errors when I have changed anything =) LOL

Oh well...I guess I should be happy it's all working.
Marked as answer by psenechal on 4/10/2014 at 12:15 PM