I want to create a web service in Visual Studio 2019 using C# and .NET, but I could not find option of web service – neither in ASP.NET Core nor the .NET framework. Can someone help me with this?
I want to create a web service in Visual Studio 2019 using C# and .NET, but I could not find option of web service – neither in ASP.NET Core nor the .NET framework. Can someone help me with this?
2
Answers
To create a simple web service using this template:
Step-1: In Visual Studio, create a new project using the ASP.NET Web Application (.NET Framework) template, and select the Empty template when prompted. Type a name and create the project.
Step-2: In Solution Explorer, right-click the project node, choose Add > New Item, and then choose Web Service (ASMX). Add the web service.
Step-3: Open WebService1.asmx and replace the default HelloWorld web method with the following code.
Its likely you have chosen .net core as project type when creating the project. You need to choose Web applications. Check the image below.