AaronRobinsonMSFT / DNNE

Prototype native exports for a .NET Assembly.
MIT License
394 stars 41 forks source link

DNNE.targets produces error in Visual Studio error list on open solution #156

Closed AArnott closed 1 year ago

AArnott commented 1 year ago

Visual Studio reports an error in the Error List, despite the fact that this error does not occur in a full build.

Severity    Code    Description Project File    Line    Suppression State
Error       Generated source file(s), C:\Users\andarno\source\repos\vs-threading\obj\src\SosThreadingTools\Debug\net7.0-windows\dnne/SosThreadingToolsManaged.g.c, not found. In order to generate source an export must exist. Create an export by adorning a function with UnmanagedCallersOnly.  SosThreadingTools   C:\_nugetpackages\dnne\2.0.0\build\DNNE.targets 121 

The thing is, I do have such an attribute.

Repro steps

git clone https://github.com/AArnott/vs-threading.git
cd vs-threading
git checkout 00d95df58e51bbee9500ff17fff9b41354978433
.\init.ps1  # or init.cmd if using cmd.exe
.\Microsoft.VisualStudio.Threading.sln

See how the Error List populates with the error.

AArnott commented 1 year ago

This also breaks the design-time build to such an extent that when I open source files within the impacted project, I get errors everywhere that I reference the DbgEngExtension or Microsoft.Diagnostics namespaces.

AArnott commented 1 year ago

Your fix works. Thank you!