Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API test errors in Visual Studio #379

Open
ForNeVeR opened this issue Feb 14, 2023 · 1 comment
Open

API test errors in Visual Studio #379

ForNeVeR opened this issue Feb 14, 2023 · 1 comment

Comments

@ForNeVeR
Copy link
Owner

ForNeVeR commented Feb 14, 2023

Visual Studio apparently tries to load GenAPI into its .NET Framework-based (?) MSBuild process:

3>W:\Projects\wpf-math\src\WpfMath.ApiTest\WpfMath.ApiTest.csproj(38,9): error MSB4062: The "Microsoft.DotNet.GenAPI.GenAPITask" task could not be loaded from the assembly C:\Users\fried\.nuget\packages\microsoft.dotnet.genapi\7.0.0-beta.23060.4\build\\..\tools\net472\Microsoft.DotNet.GenAPI.exe. Could not load file or assembly 'file:///C:\Users\fried\.nuget\packages\microsoft.dotnet.genapi\7.0.0-beta.23060.4\tools\net472\Microsoft.DotNet.GenAPI.exe' or one of its dependencies. The system cannot find the file specified. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.

For now, I have no idea how to fix this. GenAPI is a Microsoft-produced task, how come it's broken in VS?

@ygra
Copy link
Contributor

ygra commented Feb 17, 2023

Seems to be a problem in GenAPI's Microsoft.DotNet.GenAPI.targets:

<GenAPIAssembly Condition="'$(MSBuildRuntimeType)' != 'Core'">$(MSBuildThisFileDirectory)\..\tools\net472\Microsoft.DotNet.GenAPI.exe</GenAPIAssembly>

which doesn't even exist. Changing this to .dll makes the build work again.

Also combined with the build being slightly weird in Visual Studio (e.g. the Lc task also exists for .NET, even though it shouldn't – but only when building in VS). And yes, the check for .NET Core vs. Framework in the build target then assumes .NET Framework.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants