IIS-based Web Service - asp.net

I have created an ASP.NET Web Application in Visual Studio Community 2019. I am trying to deploy a web service in IIS but I keep getting the 404 Not Found error. The application pool in the IIS manager looks like this
I create a connection
and then publish the application but I get this error
The .NET Framework is 4.7.2
What did I do wrong?

As per your screen shot application is hosted with virtual directory Webapp.
URL Should be http://Localhost/webapp/webservice1.asmx

First change url to http://Localhost/webapp/webservice1.asmx. Then check Mapping to an ASMX service using routing in ASP.NET MVC for solving the mapping problem.

I suggest publishing the site to the folder. Then create a new site in IIS Manager and show its physical path to that folder. Give your site some path like localhost:3600. Then when you open that path in the browser and search http://localhost:3600/WebService1.asmx, it will definitely work(at least it worked for me)

Related

Is there any way to see actual application error in a website hosted in IIS?

A legacy .Net webform application is hosted in IIS is running fine in old server having .Net framework 2.0 in it. I don't have source code of the application. I have just existing published DLL which i have copied from old server to a new server having .Net 4.7 framework by default and hosted it in new server's IIS.
While browsing the application, it is showing an default configured Error.aspx page which developers may have configured. So, in case of any error the application will navigate to Error.aspx page.
I am not able to figure out the actual .net error.
How can i get the actual error or is there any way to debug that ?
You can find errors in iis log (default path is %SystemDrive%\inetpub\logs\LogFiles).
Also you can enable detailed error message in browser. Link

How to host ASP.NET Web API 2 project on IIS 10

I am trying to host an ASP.NET Web API 2 project on IIS 10, and I keep getting a page saying Service Endpoint not found.
The project I am using for testing is the sample ProductsApp project here Getting Started with ASP.NET Web API 2. If I run the project in debug, then the page shows up as expected while it is being hosted through VS2012 IIS express at localhost:54170
I am then publishing that project to file using VS2012.
After publishing to file, then I made a new site on IIS 10 at localhost:8080 and point the physical path to the folder that I published the ProductsApp project to.
At this point if I go to browse the site it comes up with a page that all it says is Service Endpoint not found.
I've changed my DefaultAppPool Identity to LocalSystem, so I don't think it's a permissions issue.
How do I get the site to show up like it does when I'm debugging from VS2012, but from IIS 10?
I wasted so much time yesterday trying to figure this out, but this morning with a little fiddling I found my answer which I'm surprised I wasn't able to find anywhere else I looked.
To fix my problem this is all I had to do.
Instead of hosting the ASP.NET content as its own site I just needed to add an application to my default web site with the physical path pointing to the folder that was published from VS2012.
This is obviously my first time using ASP.NET, so I didn't have any of the ASP.NET features installed in IIS. I went to Turn Windows features on or off -> Internet Information Services -> World Wide Web Services -> Application Development Features, then selected all of the ASP folders (ASP, ASP.NET 3.5, ASP.NET 4.6). Edit: Looking back at this, all that was required was turning on the feature ASP.NET 4.6. At the time I didn't know what I was looking for, so I tried to nuke the problem by installing everything with "ASP" in the name.
The DefaultAppPool Identity didn't need to change to LocalSystem, so I changed it back to ApplicationPoolIdentity.
Now I have the ASP.NET site up and running on my localhost.

How to publish ASP.NET Core 5 Web Site to IIS?

I installed Visual Studio 2015 RC and created the sample Web Site project.
I published it in Visual Studio using its publishing tool to file system. The output is:
I tried to target IIS both this folder and wwwroot folder but nothing changed. I always receive an Access is Denied error.
Checked the permissions. They are OK. I'm always able to run my other web sites...
I want to publish it targeting clrcore. But I already tried to publish it using clr and failed there too. It is the same error.
How is the publishing process should be when I want to run a coreclr website in IIS? And I don't even know if it is possible to serve a coreclr project on IIS.
By the way there is nothing about .NET Core in application pools dialog in IIS. So I don't know what could my poor IIS do here.
There are full instructions from MS:
http://docs.asp.net/en/latest/publishing/iis.html
TL;DR
You need to install HTTP platform Handler. Other than that, if you could get a standard MVC 5 app to work, you should be ok. The only change I needed to make was installing the plstform handler.
Of Course, In VS I publised to a folder, then copied the contents to the Web server. The root folder to the site must point to the wwwroot and the approot will be at the same level.
As far as I know, You can't host ASP.NET Core 5 Web Site on IIS, it works with self hosting only.

How to host an ASP.NET MVC project in IIS?

I have an ASP.NET MVC solution with multiple project under it, it works fine locally after uploading the site on the server I get the System.Reflection.ReflectionTypeLoadException error
I am also trying to run the solution on IIS and the error I am getting is Not Found
The requested URL / was not found on this server.
I have also copied all the DLL to the output folder, what could be the issue is the problem most likely from a missing DLL, is it from the remote hosting security level or am I missing something else in the project please advise.
After calling the hostgator (where the site is hosted) and addressing the issue, I was told that custom DLL is not allowed in our hosting as you may see I have taken screenshots of the DLLs I wonder what are the customs DLL in my project as hostgator technician put it
I assume you're running v3 of ASP.NET MVC. In which case, have you set the Application Pool .NET Framework version in IIS to C# 4.0? Indeed, is ASP.NET MVC and .NET Framework 4.0 installed on your server?
Does your application rely on any external libraries which were not included in the deployed application?
Are you able to debug your application at all? Ie the Application_Start. It's possible that something is going awry during that which is causing this.
Basically, more information would help!

Runtime Error with referenced WCF Service

I have created a reference to an IIS hosted WCF service in my ASP.NET website project on my local workstation through the "Add Service Reference" option in Visual Studio 2008. I was able to execute the service from my local workstation.
When I move the ASP.NET web site using the "Copy Web Site" feature in Visual Studio 2008 to the development server and browse to the page consuming the service, I get the following error:
Reference.svcmap: Specified argument
was out of the range of valid values.
Has anyone experienced this same error and know how to resolve it?
EDIT: My development server is Win2k3 with IIS 6
The problem may be due to a mismatch with the solution/project folder structure and the IIS web site folder structure. I ran into similar problems a good while ago and ended up changing how I deploy web services. Here and here are some discussions of similar problems to yours, they ended up not using the Add Service generated client and rolled their own client. Also, I can vouch for using the "Publish web site" method for deploying my services. Here is a good article on web service deployment models.
#Sixto Saez: I was able to use the following resource similar to the one you provided to generate a proxy class using the ServiceModel Metadata Utility Tool (svcutil.exe).
Here is the exact command line:
svcutil /t:code http://<service_url> /out:<file_name>.cs /config:<file_name>.config
Here is the reference I found that suggested using the method.
Also, I was able to consume the service by creating a reference using the Visual Studio 2008 "Add Web Reference" command. It generates code based on .NET Framework 2.0 Web Services technology.
Unforunately, the WCF service web site and I can not use the svcutil solution (Unless you know of a way how...). Do you deploy you service or your web site with the service reference using Visual Studio 2008 publish web site feature?

Resources