BeginCollectionItem icon indicating copy to clipboard operation
BeginCollectionItem copied to clipboard

BeginCollectionItem breaking publish of MVC5 apps

Open richardlawley opened this issue 4 years ago • 0 comments

I'm unsure exactly what caused this, but I noticed that I was unable to publish one of my web apps. This either happened after upgrading to Visual Studio 16.5, or after the most recent Windows Update - all I know is the last time I built the project on March 5th it worked.

The errors were during the aspnet_merge phase of precompiling the views, with the error messages:

error CS0234: The type or namespace name 'WebViewPage<>' does not exist in the namespace 'Sy stem.Web.Mvc' (are you missing an assembly reference?)

and

error CS0115: '_Page_Views_XXXX_XXXX_cshtml.Execute()': no suitable method found to override

The errors all pointed to something referencing a different version of MVC, and I eventually noticed this project in my NuGet references, which was actually no longer used but had not been removed. Upon removing it, I could publish this again.

I'm mostly posting this here in the hope that there are enough keywords and error messages to save someone else the hours I spent looking for the solution to this yesterday! I no longer use the project but if someone else encounters this and does need it, I suspect the simplest answer would be to recompile it referencing MVC5 instead of MVC2!

richardlawley avatar Mar 24 '20 08:03 richardlawley