Hello,
since dotnet9 is deprecating the old way to create OpenApi documents the recommended way is to add a package reference to
<PackageReference Include="Microsoft.Extensions.ApiDescription.Server" Version="9.0.0">
Everything builds via dotnet and visual studio but building with NCrunch results in this error:
Quote:NCrunch: If you are experiencing problems in getting this project to build, have a look at
https://www.ncrunch.net/...ng_project-build-issues
..\..\..\..\..\Users\xxx\.nuget\packages\microsoft.extensions.apidescription.server\9.0.0\build\Microsoft.Extensions.ApiDescription.Server.targets (68, 5): Error:
..\..\..\..\..\Users\xxx\.nuget\packages\microsoft.extensions.apidescription.server\9.0.0\build\Microsoft.Extensions.ApiDescription.Server.targets (68, 5): An assembly specified in the application dependencies manifest (CustomField.Change.Service.deps.json) was not found:
..\..\..\..\..\Users\xxx\.nuget\packages\microsoft.extensions.apidescription.server\9.0.0\build\Microsoft.Extensions.ApiDescription.Server.targets (68, 5): package: 'CustomField.EventDefinitions', version: '1.0.0.0'
..\..\..\..\..\Users\xxx\.nuget\packages\microsoft.extensions.apidescription.server\9.0.0\build\Microsoft.Extensions.ApiDescription.Server.targets (68, 5): path: 'CustomField.EventDefinitions.dll'
..\..\..\..\..\Users\xxx\.nuget\packages\microsoft.extensions.apidescription.server\9.0.0\build\Microsoft.Extensions.ApiDescription.Server.targets (68, 5): The command "dotnet "C:\Users\xxx\.nuget\packages\microsoft.extensions.apidescription.server\9.0.0\build\../tools/dotnet-getdocument.dll" --assembly "C:\Users\xxx\AppData\Local\NCrunch\39400\8\src\Change\CustomField.Change.Service\bin\Debug\net9.0\CustomField.Change.Service.dll" --file-list "obj\CustomField.Change.Service.OpenApiFiles.cache" --framework ".NETCoreApp,Version=v9.0" --output "C:\Users\xxx\AppData\Local\NCrunch\39400\8\src\Change\CustomField.Change.Service\obj" --project "CustomField.Change.Service" --assets-file "C:\Users\xxx\AppData\Local\NCrunch\39400\8\src\Change\CustomField.Change.Service\obj\project.assets.json" --platform "AnyCPU" " exited with code -2147450740.
In a global build.properties I have this:
Quote:
<Choose>
<When Condition=" $(MSBuildProjectName.EndsWith('.Service')) And !($(MSBuildProjectName.EndsWith('.Query.Service')))
And '$(NCrunch)' != '1'">
<PropertyGroup>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<OpenApiDocumentsDirectory>$(SolutionDir)/results/swagger</OpenApiDocumentsDirectory>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.ApiDescription.Server" Version="9.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
</When>
</Choose>
I am using NCrunch 5.11.0.1
Unfortunately even And '$(NCrunch)' != '1' doesnt help.
Any ideas?
Klemens