0

I'm using the JavaScript Services Angular infrastructure to build an Angular project that utilizes Entity Framework. I was able to produce a similar project in the past by modifying the project.json file but project settings are now set in the csproj file in VS2017. Below is my code based on Microsoft's recommendations for adapting project.json files to csproj:

<Project ToolsVersion="15.0" Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>netcoreapp1.1</TargetFramework> <-- Tried with and without ths line -->
    <TargetFrameworks>netcoreapp1.1;net452</TargetFrameworks>
    <RuntimeIdentifiers>win7-x64</RuntimeIdentifiers>
    <TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
    <IsPackable>false</IsPackable>
  </PropertyGroup>
  <ItemGroup Condition="'$(TargetFramework)' == 'net452'">
    <PackageReference Include="EntityFramework" Version="6.1.3" />
    <PackageReference Include="Microsoft.CSharp" Version="1.0.0" />
  </ItemGroup>
  <ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp1.1'">
    <PackageReference Include="Microsoft.AspNetCore" Version="1.1.0" />
    <PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.1" />
    <PackageReference Include="Microsoft.AspNetCore.SpaServices" Version="1.1.1" />
    <PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="1.1.0" />
    <PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="1.1.0" />
  </ItemGroup>
  <ItemGroup>
...

On Build I get the following error referencing several files in my project:

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'

With the <TargetFramework> tag removed, no netcoreapp1.1 references were found.

tlcooper
  • 1
  • 1
  • 2

0 Answers0