Hello. I am running an mvc5 website. My ms visual compiler is giving me this error.
Severity Code Description Project File Line Suppression State
Error CS0012 The type 'Expression<>' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. 1_Views_Home_Account.cshtml C:\Users\MyName\source\repos\VmFusion2020\VmFusion2020\Views\Home\Account.cshtml
62 Active
The error is comping from this code in my .cshtml files. @Html.LabelFor , @Html.PasswordFor , Html.ValidationMessageFor.......
I tried to add that assembly but the compiler says its already added by default. I never had this issue before. Is anyone familiar with this problem . Thanks for any tips.
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
Member
9 Points
60 Posts
My project is giving me an error that I cannot find a solution to on the internet
Oct 23, 2020 01:29 PM|johnboyman12|LINK
Hello. I am running an mvc5 website. My ms visual compiler is giving me this error.
Severity Code Description Project File Line Suppression State
Error CS0012 The type 'Expression<>' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. 1_Views_Home_Account.cshtml C:\Users\MyName\source\repos\VmFusion2020\VmFusion2020\Views\Home\Account.cshtml 62 Active
The error is comping from this code in my .cshtml files. @Html.LabelFor , @Html.PasswordFor , Html.ValidationMessageFor.......
I tried to add that assembly but the compiler says its already added by default. I never had this issue before. Is anyone familiar with this problem . Thanks for any tips.
Contributor
2880 Points
846 Posts
Re: My project is giving me an error that I cannot find a solution to on the internet
Oct 27, 2020 01:15 AM|Sean Fang|LINK
Hi johnboyman12,
Could you please provide more information for us targeting the problem?
To summarize, you have to add the assembly references to the web.config correctly with respect to your real environment.
Related resolution from SO:
https://stackoverflow.com/questions/31599087/vs-2015-intellisense-assembly-not-referenced-error
https://stackoverflow.com/questions/31086850/the-type-expression-is-defined-in-an-assembly-that-is-not-referenced
Hope helps.
Best regards,
Sean