Net Framework framework references are mostly added directly on the Internet
But this method of packaging is very unfriendly
After going through the Microsoft documentation, I found a direct reference to the System. Froms assembly. It is also hidden deep, at: link
Net Core version >= 3.0
In fact, just modify the project’s csproj file
The original file
<Project Sdk=”Microsoft.NET.
<PropertyGroup
<TargetFramework>netcoreapp3.1</TargetFramework
<OutputType>Library</OutputType>
</PropertyGroup>
</Project>.
Modify the SDK in the first line
<Project Sdk=”Microsoft.NET.Sdk.WindowsDesktop”>
<PropertyGroup
<TargetFramework>netcoreapp3.1</TargetFramework
<OutputType>Library</OutputType>
</PropertyGroup>
</Project>.
Note this extra WindowsDesktop
Just add this reference to find System.Windows.
Similar Posts:
- Vs publish error: NETSDK1152: multiple publishing output files with the same relative path were found
- This project references NuGet package(s) that are missing on this computer. Enable NuGet Package …
- [Solved] VS Error: No project was found. Change the current working directory or use the –project option.
- Inline variable declaration not compiling [How to Solve]
- ERROR StatusLogger No log4j2 configuration file found. Using default configuration
- Project file is incomplete. Expected imports are missing [How to Solve]
- [Solved] LD: library not found for – XXX when Xcode compiles code
- Solution for oserror: [errno 1] operation not permitted encountered when installing tensorflow
- Running NETCORE 2.2 program error [How to Fix]