question

jimnycrypto-0940 avatar image
0 Votes"
jimnycrypto-0940 asked jimnycrypto-0940 answered

The type 'RazorViewAttribute' exists in both 'Microsoft.AspNetCore.Mvc.Razor, Version=2.0.3.0'

Hi,

After upgrading Visual Studio Community 2019 to version 16.10.0, I get this error at runtime
"*

The type 'RazorViewAttribute' exists in both 'Microsoft.AspNetCore.Mvc.Razor, Version=2.0.3.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' and 'Microsoft.AspNetCore.Mvc.Razor, Version=2.0.4.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'"



But, running Visual Studio Enterprise 2019 Version 16.8.4 the app works just fine.

Below screenshot are the pacakges.

102642-image.png


dotnet-aspnet-core-mvcdotnet-aspnet-core-razor
image.png (38.9 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

jimnycrypto-0940 avatar image
0 Votes"
jimnycrypto-0940 answered

Managed to solved it by uninstalling/removing both "Microsoft.AspNetCore.Razor (2.0.3)" and "Microsoft.AspNetCore.MVC (2.0.4)" packages.





5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.