visual studio - Unable to resolve .NET Framework dependency in VS2017 csproj -


i trying use wcf service, .net framework in .net core project. included service project reference in .net core project, can see in .csproj settings.

vs2017 complains service needs system.servicemodel assemble reference. tried add system.servicemodel has following error:

error unable resolve 'system.servicemodel (>= 4.0.0)' '.netframework,version=v4.6.2 (win7-x64)'.

i tried add in csproj file following:

<itemgroup condition="'$(targetframework)'=='net462'">     <packagereference include="system.servicemodel" version="4.0.0.0" /> </itemgroup> 

here whole csproj file:

<propertygroup>   <targetframeworks>netcoreapp1.1;net462</targetframeworks>   <runtimeidentifiers>win7-x64;</runtimeidentifiers>   <assemblyname>simpletokenprovider.test</assemblyname>   <outputtype>exe</outputtype>   <packageid>simpletokenprovider.test</packageid> </propertygroup>  <itemgroup>   <none update="views;areas\**\views">     <copytopublishdirectory>preservenewest</copytopublishdirectory>   </none> </itemgroup>  <itemgroup>   <projectreference include="..\..\services\services.csproj" />   <projectreference include="..\..\src\simpletokenprovider\simpletokenprovider.csproj" /> </itemgroup>  <itemgroup condition="'$(targetframework)'=='netcoreapp1.1'">   <packagereference include="microsoft.aspnetcore.authentication.cookies" version="1.1.1" />   <packagereference include="microsoft.aspnetcore.authentication.jwtbearer" version="1.1.1" />   <packagereference include="microsoft.aspnetcore.mvc" version="1.1.2" />   <packagereference include="microsoft.aspnetcore.server.iisintegration" version="1.1.1" />   <packagereference include="microsoft.aspnetcore.server.kestrel" version="1.1.1" />   <packagereference include="microsoft.aspnetcore.staticfiles" version="1.1.1" />   <packagereference include="microsoft.extensions.configuration.environmentvariables" version="1.1.1" />   <packagereference include="microsoft.extensions.configuration.fileextensions" version="1.1.1" />   <packagereference include="microsoft.extensions.configuration.json" version="1.1.1" />   <packagereference include="microsoft.extensions.logging" version="1.1.1" />   <packagereference include="microsoft.extensions.logging.console" version="1.1.1" />   <packagereference include="microsoft.extensions.logging.debug" version="1.1.1" />   <packagereference include="microsoft.netcore.portable.compatibility" version="1.0.1-rc2-24027" /> </itemgroup>  <itemgroup condition="'$(targetframework)'=='net462'">   <packagereference include="system.servicemodel" version="4.0.0.0" /> </itemgroup>  <itemgroup>   <wcfmetadata include="connected services" /> </itemgroup> 


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -