samedi 5 avril 2014

Visual studio 2013 - boîte de dialogue Ajouter une vue ne fonctionne pas dans un projet MVC 5 qui fait référence à un projet F # - Stack Overflow



  1. Using Visual Studio 2013, create a new ASP.NET Web Application project using the MVC template. Verify that the Add View dialog functions by right-clicking the "Views\Home" folder and choosing "Add... View".

  2. Now add a new F# Library project to the solution. The Add View dialog should still function correctly.

  3. Now add a project reference from the MVC project to the F# project by right-clicking the References folder, choosing Add Reference, Then browse to Solution...Projects on the left and checking the F# library project that you just added.


At this point, if you right-click the "Views\Home" folder and choose "Add... View" you will get an error in a pop-up alert box instead of the Add View dialog:



There was an error running the selected code generator: 'Object reference not set to an instance of an object.'



Workarounds include, but are hopefully not limited to:



  • Remove all your references to any F# projects every time you want to add a new view.

  • Unload any referenced F# projects, but leave the project references in place, every time you want to add a new view.


My questions are:



  • Are other people seeing this behavior, or is it just me?

  • Does anyone know of a better work-around than removing references or unloading F# projects?

  • Does anyone know if Microsoft is already working on fixing this? If not should this be reported to the F# team or the Visual Studio team?


Between this issue and the fact that it is still impossible to use NuGet to add an Entity Framework 6 reference to any F# project, I'm starting to get nervous about Microsoft's level of commitment to the F# language.




  1. Using Visual Studio 2013, create a new ASP.NET Web Application project using the MVC template. Verify that the Add View dialog functions by right-clicking the "Views\Home" folder and choosing "Add... View".

  2. Now add a new F# Library project to the solution. The Add View dialog should still function correctly.

  3. Now add a project reference from the MVC project to the F# project by right-clicking the References folder, choosing Add Reference, Then browse to Solution...Projects on the left and checking the F# library project that you just added.


At this point, if you right-click the "Views\Home" folder and choose "Add... View" you will get an error in a pop-up alert box instead of the Add View dialog:



There was an error running the selected code generator: 'Object reference not set to an instance of an object.'



Workarounds include, but are hopefully not limited to:



  • Remove all your references to any F# projects every time you want to add a new view.

  • Unload any referenced F# projects, but leave the project references in place, every time you want to add a new view.


My questions are:



  • Are other people seeing this behavior, or is it just me?

  • Does anyone know of a better work-around than removing references or unloading F# projects?

  • Does anyone know if Microsoft is already working on fixing this? If not should this be reported to the F# team or the Visual Studio team?


Between this issue and the fact that it is still impossible to use NuGet to add an Entity Framework 6 reference to any F# project, I'm starting to get nervous about Microsoft's level of commitment to the F# language.


0 commentaires:

Enregistrer un commentaire