dotnet / dotnet/sdk

WPF app using CsWin32 fails to publish - GenerateTemporaryTargetAssembly project is not importing nuget props

Open
#51,474 4 comments 1 reaction 0 assignees View on GitHub
Area-WebSDK untriaged
Dominant language
C#
Stars
3.2k
Forks
1.3k
PR merge metrics
PR metrics pending

Description

### Describe the bug
Publishing a WPF app that uses cswin32 fails to publish from VS but succeeds using "dotnet publish" at the command line.

What I see comparing the successful dotnet publish vs VS publish is that VS publish runs the GenerateTemporaryTargetAssembly stuff a second time, and that second invocation fails during CSC.

I also notice that during that second invocation, AdditionalFiles itemgroup is empty (this is why cswin32 fails), implying that the nuget cswin32.props did not get imported. It looks none of the nuget imports are happening this second time around.

### To Reproduce
Clone https://github.com/BennyBread/WpfCsWin32PublishApp
Open .sln in VS
Right click solution and "Publish..." and accept defaults

Result:
Publish fails during compile due to missing "Windows" namespace and related errors.

See https://github.com/microsoft/CsWin32/issues/1188 for more details.

### Exceptions (if any)

### Further technical details
details of dotnet --info

- The IDE (VS / VS Code/ VS4Mac) you're running on, and its version

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.