dotnet / dotnet/wpf

UseWpf should work with netframework as a TargetFramework

Open
#3,865 5 comments 1 reaction 1 assignee Claimed by @ryalanms View on GitHub
External Non-WPF Issue Question
Dominant language
C#
Stars
7.7k
Forks
1.3k
Avg merge
1d 11h
Merged PRs (30d)
61

Description

After some headache trying to achieve a multitarget project with net47 and net5.0-windows.
I would like to suggest that UseWpf should also work for net47.

My current project sadly has to look like this to make it "work".

```


net47;net5.0-windows
WinExe
MyNamespace


MyNamespace.App


true















C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationUI\v4.0_4.0.0.0__31bf3856ad364e35\PresentationUI.dll




```

My project file is a strange combination of this stackoverflow question
https://stackoverflow.com/questions/43693591/how-to-migrate-wpf-projects-to-the-new-vs2017-format

Other question, why is it necessary for me to provide the `HintPath` only for the assembly `PresentationUI`?
All the other assemblies can be found without an issue, but if I would drop the `HintPath` I would get a

> 14>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2123,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "PresentationUI". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.

I am not sure if that is the correct place to post this issue.
If possible and I am wrong here move the issue to the correct place.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.