I've created .NET Core class library and try to build it against net40 framework. I want to use Clipboard class from System.Windows.Forms assembly. How can I do this?
My project.json file:
{
"version": "1.0.0-*",
"dependencies": {
"NETStandard.Library": "1.6.0"
},
"frameworks": {
"netstandard1.6": {
"imports": "dnxcore50",
"buildOptions": {
"define": [
"NETCORE"
]
},
"dependencies": {
"System.Threading": "4.0.11",
"System.Threading.Thread": "4.0.0",
"System.Threading.Tasks": "4.0.11"
}
},
"net40": {
"buildOptions": {
"define": [
"NET40"
]
},
"dependencies": {
// dependency should be here but there is no such dll
}
}
}
}
All my net40 specific code is under NET40 define. Any thoughts?
For VS2019 .NET Core 3.1:
Microsoft.NET.Sdk
to Microsoft.NET.Sdk.WindowsDesktop
to be able to use also wpf.<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup Label="Globals">
<SccProjectName>SAK</SccProjectName>
<SccProvider>SAK</SccProvider>
<SccAuxPath>SAK</SccAuxPath>
<SccLocalPath>SAK</SccLocalPath>
</PropertyGroup>
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<UseWPF>true</UseWPF>
<UseWindowsForms>true</UseWindowsForms>
</PropertyGroup>
...