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

System.ServiceModel.ClientBase is incompatible between System.ServiceModel.Primitives 6.0.0 and 8.0.0 #5400

Open
wasker opened this issue Jan 13, 2024 · 6 comments
Assignees
Labels

Comments

@wasker
Copy link

wasker commented Jan 13, 2024

Describe the bug

I'm upgrading our projects from .NET 7 to .NET 8 and decided to upgrade System.ServiceModel.Primitives as well. Doing so resulted in a bunch of compilation bugs like

Error CS1503 Argument 1: cannot convert from 'string' to 'System.ServiceModel.Description.ServiceEndpoint'

In service clients that were generated with previous versions of tools.

        public Xxx()
        {
        }
        
        // broken
        public Xxx(string endpointConfigurationName) : 
                base(endpointConfigurationName)
        {
        }
        
        // broken
        public Xxx(string endpointConfigurationName, string remoteAddress) : 
                base(endpointConfigurationName, remoteAddress)
        {
        }

        // broken
        public Xxx(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) : 
                base(endpointConfigurationName, remoteAddress)
        {
        }
        
        public Xxx(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) : 
                base(binding, remoteAddress)
        {
        }

Expected behavior

Keep legacy ctor definitions to avoid re-generating service clients between upgrades.

@schneoka
Copy link

schneoka commented Jan 15, 2024

We ran into the same problem.

Using the new dotnet-svcutil instead is not possible, see #5404

@HongGit HongGit assigned imcarolwang and unassigned imcarolwang Jan 17, 2024
@HongGit HongGit self-assigned this Jan 18, 2024
@wasker
Copy link
Author

wasker commented Feb 21, 2024

Any update on that? 6.x has dependencies that are being flagged for vulnerabilities. We can't move to 8.x because it's a breaking change, yet we don't know how long 6.x will be getting updated.

@HongGit
Copy link
Contributor

HongGit commented Feb 21, 2024

@wasker this is a break change because the code was written for .NET framework. As WCF Client 8.0 release did break this from WCF Client 6.0 to WCF Client 8.0. dotnet-svcutil has never generated these methods. However, this is due to this code was generated from .NET Framework.

The temporary work around is to simply remove those from your code. We will work to fix #5404 or any other similar issues. Potentially, you could also use svcutil.exe from.NET Framework SDK tool, and run it with dconly, like svcutil.exe /dconly.

@mcgolledge
Copy link

I'll just add that the missing constructor is documented to exist at .Net 8

ClientBase(String)
Initializes a new instance of the ClientBase class using the configuration information specified in the application configuration file by endpointConfigurationName.

C#

protected ClientBase (string endpointConfigurationName);

@jtecsonmri
Copy link

I'll just add that the missing constructor is documented to exist at .Net 8

ClientBase(String) Initializes a new instance of the ClientBase class using the configuration information specified in the application configuration file by endpointConfigurationName.

C#

protected ClientBase (string endpointConfigurationName);

What version will this method signature be available? Thank you!

@VrindaRK
Copy link

@wasker this is a break change because the code was written for .NET framework. As WCF Client 8.0 release did break this from WCF Client 6.0 to WCF Client 8.0. dotnet-svcutil has never generated these methods. However, this is due to this code was generated from .NET Framework.

The temporary work around is to simply remove those from your code. We will work to fix #5404 or any other similar issues. Potentially, you could also use svcutil.exe from.NET Framework SDK tool, and run it with dconly, like svcutil.exe /dconly.

Could you please update on fix of this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants