NSwag
NSwag copied to clipboard
Expected "%(NSwagGenerateExceptionClasses)" to evaluate to a boolean instead of "", in condition "!%(FirstForGenerator) OR !%(NSwagGenerateExceptionClasses)" when upgrading from `preview010` to `preview012`
Inside a project that uses a OpenApiProjectReference
to generate a C# client:
<ItemGroup>
<PackageReference Include="NSwag.ApiDescription.Client" Version="14.0.0-preview012">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<OpenApiProjectReference Include="../MyAPI/MyAPI.csproj">
<CodeGenerator>NSwagCSharp</CodeGenerator>
<ClassName>{controller}MyClient</ClassName>
<Options>/GenerateClientInterfaces:true /GenerateNullableReferenceTypes:true /GenerateNativeRecords:true /ClassStyle:Record /JsonLibrary:SystemTextJson</Options>
</OpenApiProjectReference>
</ItemGroup>
Running the build on NSwag version 14.0.0-preview012 outputs the following error:
MSB4100 Expected "%(NSwagGenerateExceptionClasses)" to evaluate to a boolean instead of "", in condition "!%(FirstForGenerator) OR !%(NSwagGenerateExceptionClasses)".
Got this when downgrading from preview012 to preview011 as well :(
Temporary workaround for this is to add property to the project explicitly:
<NSwagGenerateExceptionClasses>true</NSwagGenerateExceptionClasses>
until this is fixed.
This seems to be still an issue in the v14 release...
I resolved the issue by adding a boolean property NSwagGenerateExceptionClasses
in my project file.
<PropertyGroup>
<NSwagGenerateExceptionClasses>true</NSwagGenerateExceptionClasses>
</PropertyGroup>
The issue seem to be present on the latest build as well
I'm not able to use NSwagGenerateExceptionClasses
to fix my issue
The issue seem to be present on the latest build as well
I'm not able to use
NSwagGenerateExceptionClasses
to fix my issue
Present for me as well (NSwag 4.6.1) but NSwagGenerateExceptionClasses
works for me.
#4773 should fix this when merged.
With /GenerateExceptionClasses:false
do i use:
<PropertyGroup>
<NSwagGenerateExceptionClasses>false</NSwagGenerateExceptionClasses>
</PropertyGroup>
It gives me an error with The command "dotnet --roll-forward-on-no-candidate-fx 2...." exited with code -1.
Edit: Found out why, i will just wait for the PR
The issue seems to still exist in the latest version, I tried the work around and didn't work. Is there an estimation for when this will be fixed?
The issue seems to still exist in the latest version, I tried the work around and didn't work. Is there an estimation for when this will be fixed?
👇
#4773 should fix this when merged.
What will be the release number for this one ?
I tried version 14.0.7 and the build is still broken with this issue: The command "dotnet --roll-forward-on-no-candidate-fx 2 ....exited with code 255 Is there a fix coming for this anytime soon?
This is still partly broken, see #4890.