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

svcutil dosen't work with .NET6 #4766

Closed
zTGross opened this issue Nov 12, 2021 · 29 comments
Closed

svcutil dosen't work with .NET6 #4766

zTGross opened this issue Nov 12, 2021 · 29 comments
Assignees
Labels
dotnet-svcutil This issue is regarding the dotnet-svcutil tool. tooling An issues related to any tool shipped from this repo.

Comments

@zTGross
Copy link

zTGross commented Nov 12, 2021

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?

@moinessim
Copy link

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]

(...)

@HongGit HongGit added dotnet-svcutil This issue is regarding the dotnet-svcutil tool. tooling An issues related to any tool shipped from this repo. labels Nov 18, 2021
@bhstrifork
Copy link

Any news on this?

@TWhidden
Copy link

TWhidden commented Jan 8, 2022

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.

TWhidden pushed a commit to TWhidden/wcf that referenced this issue Jan 8, 2022
@core1983
Copy link

Hello, there is some progress in remove this bug?

@TWhidden
Copy link

@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.

@zFAdler
Copy link

zFAdler commented Jan 26, 2022

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 ?

@imcarolwang
Copy link
Contributor

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?

@mxa0079
Copy link

mxa0079 commented Feb 19, 2022

When will this be available in a release?

@mxa0079
Copy link

mxa0079 commented Mar 4, 2022

@HongGit & @imcarolwang—any comments/updates will be greatly appreciated.

@zFAdler
Copy link

zFAdler commented May 4, 2022

@HongGit, @imcarolwang Can you give any update on when the new version will be available? Is there anything currently holding back the release?

@felixpelletier
Copy link

+1

1 similar comment
@drlivsi
Copy link

drlivsi commented Aug 11, 2022

+1

@LarsCelie
Copy link

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.

@ragoso
Copy link

ragoso commented Sep 3, 2022

+1

1 similar comment
@finflaex
Copy link

+1

@JoseA-Alvarez
Copy link

Same issue here

@antonina-lobach
Copy link

antonina-lobach commented Sep 26, 2022

Any news on this 👀 ?

@AndrzejKrol
Copy link

+1

1 similar comment
@adam-sajdak-ap
Copy link

+1

@finflaex
Copy link

apparently an unofficial refusal of support

@zFAdler
Copy link

zFAdler commented Sep 26, 2022

@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...

@imcarolwang
Copy link
Contributor

Sorry for the delay, we're working on it, it's coming soon!

@federico-r-figueredo
Copy link

federico-r-figueredo commented Oct 9, 2022

Same problem here...
Screenshot from 2022-10-09 16-57-48

@NurhakKaya
Copy link

Sorry for the delay, we're working on it, it's coming soon!

Any update about the release date please?

@imcarolwang
Copy link
Contributor

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

@gabrielmaldi
Copy link

Can confirm this is working perfectly. Thanks!

@kbegiedza
Copy link

related I believe #4961

@HongGit
Copy link
Contributor

HongGit commented Dec 7, 2022

Close as dotnet-svcutil 2.1.0 is already released.

@HongGit HongGit closed this as completed Dec 7, 2022
@ffalsino
Copy link

ffalsino commented Dec 9, 2022

Hello,

I have the same issue, by trying to add a WCF Service Reference from visual studio, in a project with netstandar2.0.

image

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dotnet-svcutil This issue is regarding the dotnet-svcutil tool. tooling An issues related to any tool shipped from this repo.
Projects
None yet
Development

No branches or pull requests