asp.net mvc4 app, targetting .NET framework 4.5.2, working with VS 2019
I am getting a CS0012 error on a razor page at @Html.HiddenFor(x => x.InvoiceId)
pointing to the missing assembly reference 'System.Core'.
The strange thing is, that the error only pops up when the page is opened the VS solution explorer but the solution compiles and runs without error!
I do not have a reference to 'System.Core' in my project and from posts I learned that it is referenced internally. So I changed the key for PublicKeyToken as suggested in the error message but that did not remove the error and caused a runtime error.
Then I used the workaround posted by Serge
<input type="hidden" value="@Html.AttributeEncode(Model.InvoiceId)" id="InvoiceId" name="InvoiceId" />
which works properly.
But I would like to find out what causes this error and how to remove it.
Help and suggestions will be gratefully appreciated.