CZEMacLeod / MSBuild.SDK.SystemWeb

This MSBuild SDK is designed to allow for the easy creation and use of SDK (shortform) projects targeting ASP.NET 4.x using System.Web.
MIT License
151 stars 8 forks source link

Unable to add a connected service: Connected Services component 'Microsoft WCF Web Service Reference Provider' throws an error #13

Closed stevenvolckaert closed 2 years ago

stevenvolckaert commented 3 years ago

Hello!

I'm migrating one of our ASP.NET projects running in .NET Framework 4.8, to the SDK-style project format.

This service has a dependency to one WCF web service, an ASMX file to be more exact.

I'd like to regenerate the service proxy for this class, so I right-clicked the Connected Services node in Solution Explorer, and then selected Microsoft WCF Web Service Reference Provider. I've used this provider successfully in the past, in a class library project (also using the SDK-style project format), which targets .NET Framework 4.7.2 and .NET Standard 2.0.

In the ASP.NET project using MSBuild.SDK.SystemWeb/4.0.47 as an SDK, however, clicking the Microsoft WCF Web Service Reference Provider button gives an error, and the user interface doesn't load:

image

Any ideas? I'm running Visual Studio 2019 v16.9.5, which I installed this morning.

Fixing this issue is not urgent for me, as I managed to work around it by adding the connected service in a class library project targeting .NET Framework 4.8, which also uses the SDK-style project format. This project is added as a project reference to my ASP.NET project.

CZEMacLeod commented 3 years ago

@stevenvolckaert I'm not sure about this. When using the MSBuild.SDK.SystemWeb SDK, it is basically working almost exactly as a net48 class-library project with some specifics about output directories, and adds launch profiles. The error specifically looks like a nuget package version is being passed to some UI function in VS as a string which it expects as something that can be parsed directly. I think what is happening is that an 'exact version' string [1.4.1] is being passed rather than something that looks like 1.4.1 which is causing the failure. I would suggest confirming which Nuget packages are directly referenced by your working class-library and see if any of them are being inferred by package restore under the SystemWeb project. Maybe the version number (1.4.1) would make it easier to locate which package it is that is causing the problem. It is great that there is a (relatively) easy work-around for this. If you get more information, please feel free to add it to this issue. If we can detail the issue - we may be able to get MS to fix the issue in VS (as I imagine it can be replicated in other ways too). At the very least, we can create a wiki page on it. I am considering adding a docs folder, and GitHub pages site for this project, so that we can all contribute PRs for documentation of the more 'corner' cases.

CZEMacLeod commented 3 years ago

I am looking to try and capture information from the issues into documentation. I feel it might be useful to capture the current state of the issue as perhaps a known limitation or similar - obviously with a link to this issue. If we can get a root cause as well as the workaround, it would be great to capture that for others. Documentation?

stevenvolckaert commented 3 years ago

@CZEMacLeod thanks for your suggestions, much appreciated! I'll see if I can try out your suggestions this week; I'll report my findings here when I did.

CZEMacLeod commented 2 years ago

@stevenvolckaert Did you get any further with this? Is there anything you would like added to the documentation? Is the issue still open?

stevenvolckaert commented 2 years ago

Hi @CZEMacLeod! I didn't go further with this, I've been on holidays for the past 4 weeks.

I just checked the behavior with VS 2019 v16.10.4: I confirm this issue also presents itself in this VS version (with the same error message).

However: The workaround works for me; so I'll close this issue.

Thank you for you help! Much appreciated! 🙏