CsWinRT icon indicating copy to clipboard operation
CsWinRT copied to clipboard

VS designer build errors with NetProjectionSample

Open angelazhangmsft opened this issue 2 years ago • 2 comments

Describe the bug

When opening the NetProjectionSample (CppWinRTComponentProjectionSample.sln) in Visual Studio, errors like the following appear in VS:

(1) Error Path 'C:\Users\deads\Desktop\Dev\CsWinRT-master\src\Samples\Net5ProjectionSample_build\x64\Debug\SimpleMathComponent\bin\SimpleMathComponent\SimpleMathComponent.winmd' is not a file or directory SimpleMathProjection C:\Users\deads\Desktop\Dev\CsWinRT-master\src\Samples\Net5ProjectionSample\SimpleMathProjection\EXEC 1

(2) Error MSB3073 The command ""C:\Users\deads.nuget\packages\microsoft.windows.cswinrt\1.4.1\cswinrt.exe" @"C:\Users\deads\Desktop\Dev\CsWinRT-master\src\Samples\Net5ProjectionSample_build\x64\Debug\SimpleMathProjection\bin\cswinrt.rsp"" exited with code 1. SimpleMathProjection C:\Users\deads.nuget\packages\microsoft.windows.cswinrt\1.4.1\build\Microsoft.Windows.CsWinRT.targets 121

These errors don't prevent the projection from building successfully, but they still show up in VS Error List after building. The errors disappear if you close/reopen the solution after building, probably since the designer build happens once upon opening the solution in VS.

To Reproduce

  1. Open NetProjectionSample (CppWinRTComponentProjectionSample.sln) in VS 2022. Make sure to clear any previous output
  2. Errors appear
  3. Build the solution, and the errors still show. MicrosoftTeams-image

Expected behavior

No errors

Version Info

CsWinRT 1.4.1 (also see the errors with 1.3.5) .NET SDK 6.0.100 VS 2022 CppWinRT 2.0.210806.1 and 2.0.211028.7

Additional context

Related to this target: https://github.com/microsoft/CsWinRT/blob/b216a3854af21aa003cd3ddc19bc4b982e843b40/nuget/Microsoft.Windows.CsWinRT.targets#L121

angelazhangmsft avatar Nov 23 '21 21:11 angelazhangmsft

Need to check if fixed by #1105

angelazhangmsft avatar Mar 01 '22 19:03 angelazhangmsft

Using latest internal build I still see the following warnings before building:

image

angelazhangmsft avatar Mar 02 '22 00:03 angelazhangmsft