anaval
anaval

Reputation: 1138

netcoreapp1.0 not compatible with net45

3 hours of googling and I still can't find an answer I tried this also: Package [some package] is not compatible with netcoreapp1.0 Still doesn't work, I even added net45 and net40 reference on the imports. Another is problem is my mvc core project doesnt have a package.json

enter image description here

Upvotes: 0

Views: 282

Answers (1)

mvermef
mvermef

Reputation: 3914

Because you are probably using VS2017, you won't have a project.json since it doesn't exist any longer. So, doing the following will get you to hopefully a working project.

 <PropertyGroup>
    <TargetFramework>net452</TargetFramework>
    <RuntimeIdentifier>win7-x86</RuntimeIdentifier>
  </PropertyGroup>
 <ItemGroup>
    <PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.0.0" />
    <PackageReference Include="Microsoft.AspNet.SignalR.Core" Version="2.2.1" />
<PackageReference Include="Microsoft.AspNetCore" Version="1.1.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.2" />
<PackageReference Include="Microsoft.AspNetCore.Owin" Version="1.1.1" />
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="1.1.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="1.1.1" />
<PackageReference Include="Microsoft.VisualStudio.Web.BrowserLink" Version="1.1.0" />
</ItemGroup>
<ItemGroup>
  <DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="1.0.0" />
  </ItemGroup>

right click your project file edit .csproj, then remove and replace the <propertygroup> </propertygroup> and it's contents. Should work now to reference signalr packages. The unfortunate fun is you have to create your own middleware to tie it into the core framework..

https://www.codeproject.com/Articles/1115941/ASP-NET-Core-Building-a-Real-Time-Online-Poll-Syst

I did create the middleware really quick and it does compile. Whether it works I hadn't gotten that far. Keep in mind that link references the really old stuff before VS2017 and .csproj files for the projects.

hope that helps.

Upvotes: 2

Related Questions