Thursday, December 20, 2018

Unable to cast object of type 'ConcreteTypeMapping' to type 'Microsoft.EntityFrameworkCore.Storage.RelationalTypeMapping

Error while adding data using entity framework core 2.1 with asp.net core

Unable to cast object of type 'ConcreteTypeMapping' to type 'Microsoft.EntityFrameworkCore.Storage.RelationalTypeMapping

Sunday, December 2, 2018

Package 'EntityFramework 6.2.0' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETCoreApp,Version=v2.0'

Are you installing entity framework in your Asp.Net Core Application and getting following error ?

Package 'EntityFramework 6.2.0' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETCoreApp,Version=v2.0'

The problem is 'EntityFramework 6.2.0'  supports  .NETFramework,Version=v4.6.1' not  '.NETCoreApp,Version=v2.0'.

You need to install the right version of Entity framework for your Asp.Net Core 2.0, So use this below version of entity framework, install from command.

PM>  Install-Package Microsoft.EntityFrameworkCore -Version 2.0.1 

or serach for EntityFrameworkCore 

Cannot find an instance of the Microsoft.VisualStudio.Shell.Interop.IVsReferenceManager service- Solved

In Visual Studio 2017 Asp.Net Core Project while trying to add reference of a Class Library getting this following error 

"Cannot find an instance of the Microsoft.VisualStudio.Shell.Interop.IVsReferenceManager service." - Solved 

Please follow the following steps 

1.Launch Developer Command Prompt for VS 2017

While opening the command prompt, please make sure you run that as administrator 
2.CD 
C:\Program Files\Microsoft Visual Studio\2017\Community\Common7\IDE\PublicAssemblies
3.Run gacutil -i Microsoft.VisualStudio.Shell.Interop.11.0.dll
After installing , close and reopen your asp.net core project , and now try to add reference you should be able to add