2

I am migrating from ASP.NET MVC 5 on .NET Framework 4.6 to ASP.NET Core on NetCoreApp1.1.

I'm getting these errors:

The type 'Enum' 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'

The type 'DateTime' 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'

I guess all kind of this error derived from assembly incompatible, anybody know how to fix this issue?

I did add the package Microsoft.NETCore.Portable.Compatibility but no help.

2
  • 2
    Those base types should be included in Microsoft.NETCore.App. Are you referencing that package? Can you post your project definition? Commented Mar 13, 2017 at 16:01
  • @DavidG This is a .Net core app, it can't reference mscorelib Commented Mar 14, 2017 at 14:20

1 Answer 1

0

I was able to figure out. It was my mistake. When I created new project I chose "ASP.NET .NET Core" Template. It should be "ASP.NET .NET Framework". I don't know what is the different between two template, but the 3rd one in the pic below will support compatibility with net fw 4.x if you want to add ref to legacy project.

See Pic Below

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.