Skip to content

VS designer build errors with NetProjectionSample #1056

@angelazhangmsft

Description

@angelazhangmsft

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:

<Exec Command="$(CsWinRTCommand)" />

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingtooling

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions