0

I coded web service using ASP.NET and host it in server but when I open in browser give me this :

<%@ WebService Language="C#" CodeBehind="WSAdmin.asmx.cs" Class="WebApplication1.WSAdmin" %> 

and this my web.config :

<configuration> <system.web> <webServices> <protocols> <add name= " HttpGet"/> </protocols> </webServices> <compilation debug= "true"/> </system.web> <connectionStrings> <add name="data" connectionString= "My Connection String" <providerName= "System.Data.SqlClient"/> 
3
  • Is this web.config complete? Would you like to paste complete file? Commented Dec 11, 2019 at 12:07
  • No isn't complete! but this what I add it in web.config Commented Dec 12, 2019 at 10:01
  • And what is the exact problem? What you expected, what are the symphtoms, any errors? Commented Dec 12, 2019 at 10:34

1 Answer 1

1

It seems like your web server does not understand ASMX.

This is usually because the ASP.NET handler is not installed or configured correctly.

Type "turn Windows features on or off" into the start menu, and make sure .NET and ASP.NET under IIS is installed.

Configuring your system as below image is usually enough, though the exact features depend on which .NET framework and features you use. Also in IIS, make sure your site runs under the correct version of .NET.

windows features dialog

Sign up to request clarification or add additional context in comments.

2 Comments

but I host it in server and I Configuration it but give me seem result!!
Make sure application initialization and windows process activation features are turned on. And you have the right .NET framework version set in you application pool. If its on your development server, you can enable all features for IIS, Windows Process Activation and Process Model, then see if it works. If so, start disabling things one by one to see what the minimal set you need.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.