Getting 404 publishing web service on Windows Server 2008 - c#

I wrote a web service in VS 2012 and it works fine while debugging in VS. I am now trying to publish it to the web server. I keep getting "The resource cannot be found." HTTP 404. This is what I have done:
Verified code works in local debugger
Propped code to web server to the web site that is known to be working and hosting other regular .net applications (but none of them are web services - just regular sites/applications).
Installed HTTP Activation
Added .svc to MIME Types
Restarted IIS
Deploying to Windows Server 2008
.Net 4.0
Using VS 2012 for dev/debugging
What am I missing?

Related

.net core web api app doesn't work when run locally - unable to verify first certificate

A fellow developer created a Web API .NET Core 2.2 solution that is being hosted on Azure. He is able to run it fine locally on his machine (the machine it was created on). We are using https for the web api calls. I am also using Visual Studio 2019 Community Edition.
The web api work when we publish to Azure.
The problem is when I try to run it locally on my machine the web apis do not work. Looking at it with Postman I get this:
Error: unable to verify first certificate.
So it is obviously a certification error. I have done a few searches and found a few pages that walked you through creating a certificate but I haven't had any success so far with them.
So I am stuck and help would be most appreciated.
Some of the sites I have gone to are:
https://medium.com/#the.green.man/set-up-https-on-local-with-net-core-and-docker-7a41f030fc76
https://www.hanselman.com/blog/DevelopingLocallyWithASPNETCoreUnderHTTPSSSLAndSelfSignedCerts.aspx
ASP.NET Core + IIS Express how to setup SSL Certificate

Uploading Files to SharePoint 2010 via Windows Service using CSOM 404 not found error

Hi all I am currently working on application that needs to create document sets on SharePoint 2010 and upload files into these document sets. The application will be deployed as a Windows Service. When I debug the application in Visual Studio it works perfectly but when I deploy it as a Windows Service I get the following error:
System.Net.WebException: The remote server returned an error: (404) Not Found.
at System.Net.HttpWebRequest.GetResponse()
at Microsoft.SharePoint.Client.SPWebRequestExecutor.Execute()
at Microsoft.SharePoint.Client.ClientContext.GetFormDigestInfoPrivate()
at Microsoft.SharePoint.Client.ClientContext.EnsureFormDigest()
at Microsoft.SharePoint.Client.ClientContext.ExecuteQuery()
at PensionerPayroll.BusinessLayer.SharePointHelper.CreateDocumentSet(ClientContext context, List`1 fieldNames, String[] fieldValues, String documentLibraryName)
at PensionerPayroll.BusinessLayer.Controllers.FolderSweeper.CreateECMEntry(String[]
fieldValues, String[] fileNames, String metadataFileName)
at PensionerPayroll.BusinessLayer.Controllers.FolderSweeper.SweepFiles()
I have tried to deploy the Windows Service using both my own credentials and service account credentials, both of which have the highest permissions to the SharePoint Site. I have installed the Microsoft SharePoint 2010 SDK on the server that will host the Service. The application is built on the .NET framework 4.6. Could the problem be the .NET framework version?
The main cause for this type of error is that you don't have the IIS header configured properly. The (404) Not Found will appear because you are hitting a different IIS web site and not the one you want redirect to. You can go into IIS Manager and click on Sites there should be a column called bindings and a column called ID. Make sure you stop the default site.
IIS will check in the order of ID for the first website if it matches.eg.
ID 1: Bindings: *:80

MVC .NET Web service no access to Sharepoint Site on deploy mode

I'm developing a web service MVC .NET application that access to a Sharepoint 2013 site, I'm using the Microsoft.Sharepoint.dll not the client dll. When I run my web service on VS2015 in the IIS Express in release and debug mode I donĀ“t have any problem, but when I deploy the app to my local IIS the web service return an error
The Web application at http://[URL to SharePoint]/ could not be found.
I've tried running it with different URL such as http://localhost/sites/mysite and by domain name http://domain/sites/mysite, and I got the same results, on my VS IIS Express runs without problems but on the deploy IIS not.
The app is running on Framework 4.5 and AnyCpu compilation, I've tried downgrading the framework to 3.5 but without success. What could be the problem?, Is there any special permissions on the VS IIS that I need to enable on my local IIS?
I resolved deploying my application on a new web site in the IIS with the same applicattion pool used by my Sharepoint web site

running a VS2005 code on Windows 2012 server

We have a C# code developed using VS2005 in a local machine. That code was hosted in a Windows 2003 server with IIS 6. Now that we are upgrading the server to Windows 2012 R2 (IIS 8.5 with IIS 6 Compatibility mode enabled), how do we make the code work on the new server.
I don't know much about VS/C#. The code is placed in C:\Intepub\wwwroot folder.
I tried to create an application in IIS Manager. But nothing works.
I get the below error:
HTTP Error 404.3 - Not Found
The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map.
I hope I am missing some simple logic. Kindly help me get through this.
Note: All we have is the code and VS2005/ that local environment is no more available.
As #Nanhydrin suggested, adding .net framework 3 to Windows 2012 server helped me fix the issue. in 2012 server, it can be done by using Add Roles and Features in server manager.

Debug C# web service

I have a web service project and simple test application. I can debug the web service from Visual Studio 2008. However, there exist a real client application, but it is on another machine. ASP.NET Development Server does not allow connections if they are not from localhost, or so it seems. Is there a way to debug a web service, if client application is on another machine?
Edit
The tool that I used is Trace Utility from Microsoft SOAP Toolkit. Further explanation can be found here (works on XP; see continuation story for Windows 7 solution). There was problem with it though. My remote client fetches the WSDL first, and then creates URL based on values in soap tags found at the end of WSDL. So client gets redirected to localhost, which is not good.
I found my problem though, but I'll leave the question open until I find the time to try debugging via IIS.
Install a virtual directory into the IIS on your local machine. If you don't have IIS, install it. Once IIS is installed and configured on your local machine, you should be able to use either the IP or create a dns alias for that IP to access the web service that way.
I'm using SoapUI basic version to fake the SOAP requests to the web service, which is running in debug mode in Visual Studio, from the local computer.
You can use IIS (or Cassini Web server) - for debugging, attach VS 2008 to correct process (for example w3p.exe(IIS6 or greater) or aspnet_wp.exe(IIS 5)).

Categories