I am upgrading our existing platform from .Net Core 1.1 to .Net Core 2.0. I upgraded the framework and Nuget packages associated with it.
My controllers no longer inherit from the Controller class.
However, my project is no longer building and throws cs0012 with message: You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture= neutral, publicKeyToken = cc7b13ffcd2ddd51".
This is my cs.project
<PropertyGroup>
<AssemblyTitle>Demand1</AssemblyTitle>
<TargetFramework>netcoreapp2.0</TargetFramework>
<DebugType>portable</DebugType>
<PreserveCompilationContext>true</PreserveCompilationContext>
<AssemblyName>OnDemand</AssemblyName>
<OutputType>Exe</OutputType>
<PackageId>OnDemand</PackageId>
<RuntimeFrameworkVersion>1.1.1</RuntimeFrameworkVersion>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Authentication.Cookies" Version="2.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics" Version="2.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Hosting" Version="2.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Rewrite" Version="2.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Server.IISIntegration" Version="2.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="2.0.1" />
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.0.1" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="2.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="2.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="2.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="2.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="2.0.0" />
<PackageReference Include="Moq" Version="4.7.10" />
<PackageReference Include="OctoPack" Version="3.6.1" />
<PackageReference Include="Serilog.Extensions.Logging.File" Version="1.0.0" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="2.0.0" />
<PackageReference Include="StackifyMiddleware" Version="2.0.3" />
I followed suggestions found here: Solution 1 and Another One
- Reference Include="netstandard" as a ItemGroup
- PackageReference Update="Microsoft.NETCore.App" Version="2.0.0"
- Removed the RuntimeFrameworkVersion
- Updated my vs community to 15.5.7
Could anyone point me to a correct direction please after spending a whole day to try resolving it. Also I thought .net core 2 implements .net standard 2.0.0. Please do correct me if I am completely wrong here.