Asp.net 4.5 : The type 'System.Object' is defined in an assembly that is not referenced
I have a solution with many projects in Asp.Net Framework 4.5.2 and I want to add other project support trace logs to the Kafka server.
My project still working fine but when I add existed that project into the solution I got an error the type is defined in an assembly that is not referenced. you must add a reference to assembly
Error CS0012 The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Runtime, Version=220.127.116.11, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. D:Myproject\App_Start\WebApiConfig.cs
They are same have the same project target is 4.5.2. I tried to rebuild but it does still not work.
How can I resolve this issue?
Xhana Ahmetaj May 12 2021
You need to check
web.configof the new project you add more to your solution, It must has config below:
<compilation targetFramework="4.5" debug="true" > <assemblies> <add assembly="System.Runtime, Version=18.104.22.168, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> </assemblies> </compilation>
You need to add
System.Runtimepackage, It'll resolve your issues.