The type 'Object' is defined in an assembly that is not referenced #526

Closed
opened 2025-08-09 17:16:38 +00:00 by fergalmoran · 0 comments
Owner

Originally created by @CindySLiu on 8/4/2017

I really like these templates, but I need to use EF 6.x in my project.

I used "dotnet new angular" to generate my Test project and open it in VS2017.

I know .net core doesn't support EF 6.x. So based on other people's suggestion, I used VS2015 to create EFLib project using "Class Library" template, then installed EF6 package. Then I referenced it in my .net core angular project - Test.

I added the following code in Test project (Class1 is defined in EFLib project)
Class1 a = null;
if (a == null)
{
}
When compiling the code, I got the following error:
1>------ Rebuild All started: Project: EFLib, Configuration: Debug Any CPU ------
1> EFLib -> C:\MyProjects\VS2015\EFLib\EFLib\bin\Debug\EFLib.dll
2>------ Rebuild All started: Project: test, Configuration: Debug Any CPU ------
2>Controllers\SampleDataController.cs(23,8,23,17): error CS0012: The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
2>Done building project "test.csproj" -- FAILED.

How to solve this problem?

*Originally created by @CindySLiu on 8/4/2017* I really like these templates, but I need to use EF 6.x in my project. I used "dotnet new angular" to generate my Test project and open it in VS2017. I know .net core doesn't support EF 6.x. So based on other people's suggestion, I used VS2015 to create EFLib project using "Class Library" template, then installed EF6 package. Then I referenced it in my .net core angular project - Test. I added the following code in Test project (Class1 is defined in EFLib project) Class1 a = null; if (a == null) { } When compiling the code, I got the following error: 1>------ Rebuild All started: Project: EFLib, Configuration: Debug Any CPU ------ 1> EFLib -> C:\MyProjects\VS2015\EFLib\EFLib\bin\Debug\EFLib.dll 2>------ Rebuild All started: Project: test, Configuration: Debug Any CPU ------ 2>Controllers\SampleDataController.cs(23,8,23,17): error CS0012: The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. 2>Done building project "test.csproj" -- FAILED. How to solve this problem?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/JavaScriptServices#526
No description provided.