How to add a web service reference or connected service in a VS2019 C# SQL CLR?

Viewed 789

I am writing a C# SQL CLR project (or "SQL Server Database Project", as it is apparently called now) in Visual Studio 2019 and I need to call a web service from it.

In VS 2017 and earlier it was easy to add a web service reference, but in VS 2019, there is no such option. I tried adding a "Connected Service", but it tells me "No Connected Service is supported for the current project type."

I am looking for a solution or at least a good workaround for this issue...

Thanks.

1 Answers

I got this working and I am posting my solution here for others that might need it:

  1. Create a separate Class Library project in the same solution as the CLR project
  2. Add the web service references to the class library
  3. Reference the class library from the CLR to use its web references.
Related