0

looks like i'm not the only one with this issue

  1. Visual Studio 2010 is not catching compile errors on build
  2. http://social.msdn.microsoft.com/Forums/en-US/vseditor/thread/423387c5-1649-4517-996a-fb6405ea7af0/

Getting a really weird error here

I created a brand new mvc4 .net 4.5 project in vs2012 Added nuget packages, added classes from a couple of test projects changed the namespaces, get it to compile, run the project and voila get the YSOD with a message saying method... is not available on class ....

I have tried the following to no avail

  • clean the project, rebuild and run debug again
  • restart vs2012
  • reboot machine
  • apply windows update
  • run vs2012 with only the project in question

It also appears that while there's no Compiler error, there's also no intellisense as well atleast on the EF model types too !

Hopefully there's some rational explanation for this !

UPDATE - the specific error is

Compiler Error Message: CS0117: 'MySite.MyUserType' does not contain a definition for 'GetFor'

Where GetFor() is a static method on type MyUserType, is in a partial class, both partial files are in the same project, both have the same namespace MySite etc. etc.

UPDATE 2 - Added a class to the project, left it to default Class1 typed some random text in class1 such as

klsjdflksj flksj flksj flksjdf lksjdf lskfjd

hit and it gives no compilation error but a run-time YSOD instead

what gives ?

UPDATE 3 - tried the "fix" from link #2 above but still getting the YSOD

4

1 に答える 1

1

デフォルトでは、mvc ビューはプロジェクトのコンパイルでコンパイルされないため、ビュー ページにバグがある可能性が 90% あります。ビューのコンパイルを追加してみると、ビルド時にエラーが発生します。

In .csproj file:
<MvcBuildViews>true</MvcBuildViews>

http://www.stefanprodan.eu/2011/05/compile-views-in-asp-net-mvc-3-with-visual-studio/

于 2013-05-21T07:09:49.290 に答える