wcf
wcf copied to clipboard
svcutil dosen't work with .NET6
After installing the new Visual Studio 2022 with its .NET 6 features the dotnet-svcutils tools doesen't work anymore.
What i did:
dotnet-svcutil.exe https://myDomain.org/MyService?wsdl --outputFile SvcClient.cs --targetFramework netstandard2.0 --serializer XmlSerializer --namespace *,My.Service --enableDataBinding
Output before updating the svc-util:
Microsoft (R) WCF Service Model Proxy Generation Tool for .Net Core platform
[Microsoft.Tools.ServiceModel.Svcutil, Version 2.0.1]
Copyright (c) Microsoft Corporation. All rights reserved.
This tool collects information about how it is used in order to improve the tool. This functionality can be disabled by setting the environment variable "DOTNET_SVCUTIL_TELEMETRY_OPTOUT" to 1.
Resolving project references ...
Bootstrapping application ...
Error: Microsoft (R) Build Engine version 17.0.0+c9eb9dd64 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.
C:\Program Files\dotnet\sdk\6.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.EolTargetFrameworks.targets(28,5): warning NETSDK1138: The target framework 'netcoreapp2.0' is out of support and will not receive security updates in the future. Please refer to https://aka.ms/dotnet-core-support for more information about the support policy. [C:\Users\myself\AppData\Local\Temp\dotnet-svcutil-lib_Temp\2021_Nov_12_14_32_32\SvcutilBootstrapper\SvcutilBootstrapper.csproj]
CSC : error CS8630: Invalid 'nullable' value: 'Enable' for C# 7.3. Please use language version '8.0' or greater. [C:\Users\myself\AppData\Local\Temp\dotnet-svcutil-lib_Temp\2021_Nov_12_14_32_32\SvcutilBootstrapper\SvcutilBootstrapper.csproj]
Build FAILED.
C:\Program Files\dotnet\sdk\6.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.EolTargetFrameworks.targets(28,5): warning NETSDK1138: The target framework 'netcoreapp2.0' is out of support and will not receive security updates in the future. Please refer to https://aka.ms/dotnet-core-support for more information about the support policy. [C:\Users\myself\AppData\Local\Temp\dotnet-svcutil-lib_Temp\2021_Nov_12_14_32_32\SvcutilBootstrapper\SvcutilBootstrapper.csproj]
CSC : error CS8630: Invalid 'nullable' value: 'Enable' for C# 7.3. Please use language version '8.0' or greater. [C:\Users\myself\AppData\Local\Temp\dotnet-svcutil-lib_Temp\2021_Nov_12_14_32_32\SvcutilBootstrapper\SvcutilBootstrapper.csproj]
1 Warning(s)
1 Error(s)
Time Elapsed 00:00:01.58
An error occurred while bootstrapping svcutil. This usually happens when processing references. You might be able to work around this problem by not providing reference parameters, and manually removing any types redefined in the generated proxy code.
If you would like more help, type "dotnet-svcutil -h"
After updating to the new svcutil (version 2.0.3) the same problem occures with a much longer log. Let me know if you ned that log to .
Then i cloned the Repository and added the .NET 6 Framework as additional build Target and tested with that local build.
new csproj
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AssemblyVersionFile>$(IntermediateOutputPath)\$(TargetFramework)\$(MSBuildProjectName).$(TargetFramework).version.cs</AssemblyVersionFile>
</PropertyGroup>
<!--Package Properties-->
<PropertyGroup>
<IsPackable>true</IsPackable>
<IsShipping>$(Ship_SvcUtilPackages)</IsShipping>
<MajorVersion>2</MajorVersion>
<MinorVersion>0</MinorVersion>
<PatchVersion>4</PatchVersion>
<PreReleaseVersionLabel>preview1</PreReleaseVersionLabel>
<DotNetUseShippingVersions>true</DotNetUseShippingVersions>
<GenerateAssemblyInformationalVersionAttribute>false</GenerateAssemblyInformationalVersionAttribute>
<NoDefaultExcludes>true</NoDefaultExcludes>
<EnableXlfLocalization>true</EnableXlfLocalization>
</PropertyGroup>
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>netcoreapp2.1;netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
<RootNamespace>Microsoft.Tools.ServiceModel.Svcutil</RootNamespace>
<PackAsTool>true</PackAsTool>
<ToolCommandName>dotnet-svcutil</ToolCommandName>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\lib\src\dotnet-svcutil-lib.csproj" />
</ItemGroup>
</Project>
With these changes i was able to use the dotnet-svcutil tool without problems.
Is there any plan to support .NET6?
Similar problem with the dotnet cli:
dotnet dotnet-svcutil --help
It was not possible to find any compatible framework version The framework 'Microsoft.NETCore.App', version '5.0.0' (x64) was not found.
- The following frameworks were found: 6.0.0 at [..../shared/Microsoft.NETCore.App]
(...)
Any news on this?
After further research, the issue appears to be when targeting netstandard2.0
. If you target netstandard2.1
(and net6, etc), it works.
netstandard2.0 results with this error (as shown in the original message in this thread)
CSC : error CS8630: Invalid 'nullable' value: 'Enable' for C# 7.3. Please use language version '8.0' or greater. [C:\....\dotnet-svcutil-lib_Temp\2021_Nov_12_14_32_32\SvcutilBootstrapper\SvcutilBootstrapper.csproj]
1 Warning(s)
1 Error(s)
Seems like the simple solution is to add to the generated csproj file <LangVersion>latest</LangVersion>
but looking through the source here, I can't seem to figure out where that csproj file is actually generated at.
Hello, there is some progress in remove this bug?
@paulviks0x30 - While we wait for them to fix (or merge my pull request), you can pull / build from my fork. That fixed it for me, probably will fix your issue if the error message you see in this thread (lang version) was your error also. @imcarolwang had issued a run on it about 8 days ago, so they may merge the fix, but not sure how long.
Thanks @TWhidden for the fork, works fine for me. Would like to see the fix in a release, is there any update/plan on when a fix will be released @imcarolwang ?
Thank you @TWhidden for helping with the fix! @zFAdler, there's another PR#4772 I submitted earlier which also address this issue but in a different approach. We need to determine a proper fix for the released build.
@HongGit Could you help review the PRs and share your comments?
When will this be available in a release?
@HongGit & @imcarolwang—any comments/updates will be greatly appreciated.
@HongGit, @imcarolwang Can you give any update on when the new version will be available? Is there anything currently holding back the release?
+1
+1
Similar problem with the dotnet cli:
dotnet dotnet-svcutil --help
It was not possible to find any compatible framework version The framework 'Microsoft.NETCore.App', version '5.0.0' (x64) was not found.
- The following frameworks were found: 6.0.0 at [..../shared/Microsoft.NETCore.App]
(...)
Just ran into this issue as well. Would be nice to have a net6 compatible version.
+1
+1
Same issue here
Any news on this 👀 ?
+1
+1
apparently an unofficial refusal of support
@HongGit or @imcarolwang Can you please release the update? The PR has been merged for a while now, we're all just waiting for the release 😕
As you can see more and more developers need this update... And there will probably be many more migrating to .NET 6 and wondering why it doesn't work anymore...
Sorry for the delay, we're working on it, it's coming soon!
Same problem here...
Sorry for the delay, we're working on it, it's coming soon!
Any update about the release date please?
The version with .NET6 support is finally released, you can try out by reinstalling the tool with commandlines below.
Uninstall existing version:
dotnet tool uninstall --global dotnet-svcutil
Install the new version:
dotnet tool install --global dotnet-svcutil --version 2.1.0
Can confirm this is working perfectly. Thanks!
related I believe #4961
Close as dotnet-svcutil 2.1.0 is already released.
Hello,
I have the same issue, by trying to add a WCF Service Reference from visual studio, in a project with netstandar2.0.
If I change the TargetFramework to .net6 it works.
I know that you close the issue, but maybe this can help you to find the issue.
Microsoft (R) WCF Service Model Proxy Generation Tool for .Net Core platform [Microsoft.Tools.ServiceModel.Svcutil, Version 2.1.0] Copyright (c) Microsoft Corporation. All rights reserved.