SamJolly
SamJolly

Reputation: 6477

Why can I not find .cs files in Temporary ASP.NET Files as VS2012 recommends me so to do?

I am using MVC3,C#, .NET4, VS2012.

I am trying to work out an assembly reference error, the causal file of which, according to VS2012, is:

c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\4ce30959\16e34b5\App_Web_orders.cshtml.b7021bbc.0.cs

But it does not seem to exist. There is nothing named like the above, and the others have ".compiled" or ".dll" extensions. So completely baffled.

The error is:

Error   51  The type or namespace name 'Document' does not exist in the namespace 'Orders.MVC3.' (are you missing an assembly reference?)   c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\4ce30959\16e34b5\App_Web_orders.cshtml.b7021bbc.0.cs 36  0   Orders.MVC3

So how can I find App_Web_orders.cshtml.b7021bbc.0.cs?

Yes I have tried searching for it on my hard drive.

Thanks in advance.

Upvotes: 0

Views: 125

Answers (1)

Tommy
Tommy

Reputation: 39807

Based on your messages, you have turned on compile views or you are precompling your site within your MVC project. This error is misleading, because as part of that compiling the views, it creates these fake and strangely named files when it compiles them. If you look closely at the error, its telling you that there is a View called Orders.cshtml. Your model for this view appears to be Orders.MVC3.Document which does not exist. So, you either moved, renamed, refactored or deleted that model which is causing this view's model to no longer be found.

Upvotes: 1

Related Questions