You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When using the dotnet-svcutil tool from a C# SDK-style project and the project has <TargetFramework>$(LibTargetFramework)</TargetFramework>, the dotnet-svcutil tool will fail with a message about $(LibTargetFramework) not being a supported target framework even though the LibTargetFramework property resolves to netstandard2.0.
The target framework '$(libtargetframework)' is not a supported .NET Core, .NET Standard, or a .NET Framework version. The minimum supported framework versions are as follows: netcoreapp1.0, netstandard1.3 and net4.5.
The command "dotnet tool run dotnet-svcutil "WSDL\Repro.wsdl" -tf "netstandard2.0" -n "*,Repro.Proxy.Generated" -o ".generated\ReproProxy.cs" -v Verbose" exited with code 2.
I am using dotnet-svcutil 2.1.0 when encountering this error. If I change the TargetFramework property in the project file to be netstandard2.0 rather than using a property, it works.
To Reproduce
Steps to reproduce the behavior:
Create a C# SDK-style library project for .NET Standard 2.0.
Add a Directory.Build.props file and defined a property: <LibTargetFramework>netstandard2.0</LibTargetFramework>
Update the csproj to set: <TargetFramework>$(LibTargetFramework)</TargetFramework>
Add a custom target to invoke the dotnet-svcutil tool before the Build target.
Thanks for raising the issue, @RuneH-MSFT. There are some bug fixes in the latest preview version of the tool, instead of using dotnet-svcutil 2.1.0, could you please give version 2.2.0-preview1.23462.5 a try?
@imcarolwang - That 2.2.0-preview1.23462.5 version from August does not appear to have the same issue. From searching other issues it looks like an issue was previously reported on this and was resolved in 2.0.1. Since I encounter it on 2.1.0, Hong Li requested that I log a new issue for this to make sure it is fixed in a non-preview release, so we can start using the tool. I hope there will be a non-preview release with the fix made available soon.
@imcarolwang - With the 2.2.0-preview1.23462.5 version I can get a bit further, but I run into another error also related to using a property as the target framework when the project has assembly references without a hint path like this:
The dotnet-svcutil tool will fail with this error:
The project reference specification 'System.ServiceModel' does not have a file path.
The command "dotnet tool run dotnet-svcutil "WSDL\Repro.wsdl" -ntr -tf "net48" -n "*,Repro.Proxy.Generated" -o ".\Generated\ReproProxy.cs" -v Verbose" exited with code 2.
In this case I am using "net48" as the value of the LibTargetFramework property in Directory.Build.props. If I change the project to use "net48" directly as the value of the TargetFramework property, I do not get this error.
It seems like the same problem where it does not correctly resolve the TargetFramework value.
Describe the bug
When using the
dotnet-svcutil
tool from a C# SDK-style project and the project has<TargetFramework>$(LibTargetFramework)</TargetFramework>
, thedotnet-svcutil
tool will fail with a message about$(LibTargetFramework)
not being a supported target framework even though the LibTargetFramework property resolves tonetstandard2.0
.The target framework '$(libtargetframework)' is not a supported .NET Core, .NET Standard, or a .NET Framework version. The minimum supported framework versions are as follows: netcoreapp1.0, netstandard1.3 and net4.5.
The command "dotnet tool run dotnet-svcutil "WSDL\Repro.wsdl" -tf "netstandard2.0" -n "*,Repro.Proxy.Generated" -o ".generated\ReproProxy.cs" -v Verbose" exited with code 2.
I am using dotnet-svcutil 2.1.0 when encountering this error. If I change the TargetFramework property in the project file to be
netstandard2.0
rather than using a property, it works.To Reproduce
Steps to reproduce the behavior:
<LibTargetFramework>netstandard2.0</LibTargetFramework>
<TargetFramework>$(LibTargetFramework)</TargetFramework>
Build
target.See attached TestDotNetSvcUtilLib_CSProj.zip.
Expected behavior
The TargetFramework property should be resolved correctly.
The text was updated successfully, but these errors were encountered: