I migrated my web app hosting a WCF Service from Windows 10 to Windows Server 2012. I followed the steps below:
Copied the folder where the Web App's files are to the new machine.
Installed all ASP.NET and WCF features.
Created a new application targeting the folder containing the files of the application.
When I try to run the service I get
HTTP 404 Error, The Resource cannot be found.
When I just target the svc file I get
Metadata publishing for this service is currently disabled.
I don't get this message when hitting the same URL in the original machine. Instead I get the regular screen telling me that I have created a service.
When hitting the root folder on a browser, in the original machine I get a white screen but in the new machine I get
A default document is not configured for the requested URL, and directory browsing is not enabled on the server.
As far as I can say, all configuration parameters are the same in both machines.
I want to add a detail that might help. When I restart the site on the original machine, the first time I request the service, I wait a few seconds for the site to compile and run. On the new machine this doesn't seem to happen. It may be that the code-behind is not loaded at all.
Please check if your IIS has svc handler added.
WCF services don’t run on IIS with the default configuration, because the webserver doesn’t know, how to handle incoming requests targeting .svc files. You can teach it in two steps:
Add a new MIME type:
Extension: .svc
MIME type: application/octet-stream
Add a new Managed HTTP Handler:
Request path: *.svc
Type: System.ServiceModel.Activation.HttpHandler
Name: svc-Integrated
Refresh your website/web application
References:
http://gyorgybalassy.wordpress.com/2012/09/24/publishing-a-wcf-service-on-iis8/
http://proq.blogspot.hk/2012/09/wcf-on-iis-and-windows-8.html
http://forums.iis.net/t/1200413.aspx?+svc+missing+can+t+find+Module+to+load+within+Handler+Mapping+IIS+8+0
Enable FTP Server from Control Panel->Programs and Features
http://www.kebabshopblues.co.uk/2013/09/20/hosting-a-wcf-service-library-project-in-iis-8-0-windows-8-0-net-4-5/
From Control Panel|Programs and Features, enable the following:
Internet Information Services (a number of contained items will be selected automatically, but not all, most notably the FTP Server);
‘HTTP Activation’ under ‘.Net Framework 4.5 Advanced Services | WCF
Services’ (there is a fairly similar option ‘Windows Communication
Foundation HTTP Activation’ under the ‘.Net Framework 3.5 (includes
.NET 2.0 and 3.0’ which I guess would be necessary if you were
targeting an earlier version of .Net);
There may be some features that support WCF that are not yet enabled in IIS. I have followed your steps to deploy the existed WCF service and consume the service successfully. Here are my features I have enabled in IIS.
Result.
Feel free to let me know if there is anything I can help with.
Related
I have deployed my newly created web app developed in Asp.net core 2.1 on a windows based shared plesk hosting.
When i tried to browse the site, it give me this error
403 - Forbidden: Access is denied.
You do not have permission to view this directory or page using the credentials that you supplied.
I have searched it on google but all the help is coming for .net framework not for the .net core framework. Existing solution has suggested me to put this code in web config
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
but in .net core 2.1 there is no web.config in the project..
Bottom line issue is still there, don't know what to do.
First of all ensure that the your shared hosting provider support .NET Core hosting as it requires .NETCore Hosting Bundle installed and .NET CLR Version set to No Managed Code
Next publish your ASP.NET Core web app which will generate web.config file and then upload the published files on the server.
You may need to look at hosting's website or get in contact with them to determine whether they support .NET Core, at what runtime version and what needs to be done to have it set up for a website. They may need to do it manually and you may need to downgrade to their version.
The simplest way to handle this with shared hostings is to publish fresh template that works locally, copy it over to hosting (or use Web Deploy to do this directly from Visual Studio) and if it errors, write a ticket that your .NET Core site isn't working and it's up to them to install and set up everything that is necessary.
If they can't get it working, then you won't be able to either. Nothing else you can do, but to change hosting provider.
Literally just stumbled on this question after finding a resolution to the exact same problem.
My scenario is:
I was trying to move hosting providers - website already live, running from old host's webspace.
New host was a shared windows-based web hosting provider, running Plesk.
I was therefore trying to publish my .Net Core 2.0 project to my new host.
...and I kept getting a "403 - Forbidden Access" error.
Here's what I found, which I think might have been part of the problem that the OP faced.
Even though I had published the website to the remote server correctly, the 403 error kept coming until the new host's technical support pointed me to one of their knowledgebase posts, which exactly described my scenario and the issues I had, along with how to overcome them.
Essentially, I didn't have my domain name's DNS settings configured yet (as it was still in use, pointing to my previous hosting provider's webspace) and as such, the DNS are getting 'confused'.
The short-term workaround was to add a temporary entry to my hosts file on my PC, which directed the traffic for my website to the IP address of the NEW web hosting provider. (Once full go-live, these are deleted).
Something like this:
123.123.123.123 mywebsite.com
This allowed me (on my PC) to bypass the DNS settings on my domain name, and to reference the web content on the new web host's webspace, to continue setting-up and configuring the website, prior to full migration
Here's the link to their knowledgebase article, which I'd have never of thought of, until they mentioned it. (And then it made perfect sense!!)
I am trying to move a web site, with several web applications over to a new server running server 2012. The application was written in .net 3.5. I have been struggling through some issues but am now stuck on The resource cannot be found
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested URL: Any web app I tried URLs
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.1087.0
I have tried running the app pool as .net 2.0. Enabled 32-bit applications. Set the security of the entire inetpub folder to allow all users full permission, still I am stuck. I also tried setting the application pool back to the default user. I get a 500 error then. The user I am running the app pool under is in the IIS_* group. The application pool is setup identical to that of the old server. The file does exist at the url I am trying and it is named correctly as I have tried it on several different applications within the site. It appears this is .net to blame more than IIS. Due to enterprise security I can't get remote debugging enabled on the server. Is there any logging that I can check to see why the page won't load?
I should preface this by stating that my experience with IIS is very limited. I am trying to deploy a Web API service on IIS 7.5 on an Azure server running Windows Server 2008 R2 Datacenter. Whenever I post to the service using Postman I get an "HTTP verb used to access this page is not allowed" error. Looking at the response headers through fiddler I see the following line under the Miscellaneous category: "Allow: GET, HEAD, OPTIONS, TRACE".
I deployed this application using a WebDeploy package and configured it so it would be a virtual directory under the Default Web Site. My current IIS configuration is as follows:
Some of the things I've tried include:
Verifying that WebDAV is not installed
Edited the following Handler mappings for the Default Web Site and the Sync project to allow all verbs: ExtensionlessUrlHandler-Integrated-4.0, ExtensionlessUrlHandler-ISAPI-4.0_32bit, ExtensionlessUrlHandler-ISAPI-4.0_64bit, and ISAPI-dll
The default Web Site and the Sync app are both running under the DefaultAppPool which is set to .NET Framework 4.0.
The Sync App is targeting .NET framework 4.5
I've looked at Request Filtering for the Default Web Site and the Sync app and made sure that the POST verb is allowed under the HTTP Verbs section.
I am at a loss as to what to look at next so any hints are greatly appreciated.
After working with a colleague, we managed to get the web api service running to an extent. It currently shows an error message but it's one that we created which means the code is actually being hit. We had to give database permissions to the IIS_APPPOOL\DefaultAppPool user and re-register .net 4 with iis via the aspnet_regiis command.
I have built an ASP.NET MVC 3 web application (with exlusively Razor/cshtml pages) that runs fine on my local machine with IIS Express. Now I'm trying to publish it to a remote server that is running Windows Server 2003 and IIS 6 and has just been upgraded to .NET Framework 4.0.
I was able to successfully publish all the files to the proper directory on the remote server using Visual Studio 2010's Publish dialog (Publish method: FTP), and I've followed the instructions for including all the DLLs needed to run ASP.NET MVC on a machine that doesn't have it installed, but now I'm pretty much stuck.
The first issue is that I don't have access to the remote server's IIS. I may be able to get the hosting company to add a virtual directory or change a setting, but I'm not sure they know what they're doing, and at the moment, I wouldn't know what to tell them anyway.
The second issue is that I need my web app to live inside an existing site (the web app is basically a protected members area of the main website). So, pretend the main site is http://www.foobar.com. I'd like my web app to be accessed by entering the URL http://www.foobar.com/members.
Questions
Is it possible to publish my web app without access to the remote server's IIS?
If not, what exactly do I need to tell the hosting company to add or change in IIS?
Do the settings under the Web tab of project properties affect publishing or just local debugging? At the moment, I have it set to use IIS Express, and the Project URL is "http://localhost:7373/". Do I need to change these?
Given that the remote server is running Windows Server 2003 and IIS 6.0, is it possible to use Web Deploy or am I limited to FTP?
If I can use Web Deploy, what do I put for the Service URL? All I have right now is a URL in the format of ftp://www.foobar.com/www and a username and password.
If I need to use FTP, what steps do I need to take to get the app working once the necessary files have been uploaded to ftp://www.foobar.com/www/members? I'm not worried about database, security certificates, registry, GAC, etc., I just want to know the steps necessary to get the home page of my web app to come up when I put http://www.foobar.com/members.
Have you had a look at this article by Scott Hanselman?
In addition to that article, please read the following thread on StackOverflow on pretty much the same environment as yourself.
Edit
Your first step should be to get the hosting company to set up the virtual directory with the following parameters (IIS 6):
ASP.NET Version: 4.0.30319 (or later)
Local Path: [root ftp path for main website]\Members
[ ] Script source access (unchecked)
[x] Read (checked)
[ ] Write (unchecked)
[ ] Directory browsing (unchecked)
[x] Log Visits (checked)
[x] Index this resource (checked)
Application Name: Members
Execute Permissions: Scripts only
Application Pool: ASP.NET 2.0
My RESTful WCF Web service appears to break itself if I leave it alone for a while! I can leave my PC with everything working and when I return and test the service with a simple url request it'll offer me the .svc file for download instead of initiating the request on the server!
This WCF service sits in it's own IIS Application folder under the root. I can get the service going again by opening up the IIS sub-folder in Visual Studio, deleting the web.config file and then adding it in again.
My first thought was that HTTP handler mappings for .svc have been borked so I re-ran ServiceModelReg.exe -i, but that hasn't resolved the issue.
Looking at the Handler Mappings for this IIS Application they appear correct and are inherited from the the web root. It's worth mentioning that this site also has another Application folder running WCF services from a .svc fle and is still functioning fine!
Now that I've checked the obvious am a bit flumoxed about where to look next! Hoping someone has suggestions...
Are you running IIS6 or IIS7? And what .NET-version?
IIS6:
http://blog.stevensanderson.com/2008/07/04/options-for-deploying-aspnet-mvc-to-iis-6/
IIS7:
Test this:
"%windir%\Microsoft.NET\Framework\v3.0\Windows Communication Foundation\ServiceModelReg.exe" -r -y
Do you really need .svc-extension in the rest url?
This might solve the problem:
http://west-wind.com/weblog/posts/570695.aspx
Try
Go to programs and features, then turn windows features on or off.
Microsoft.net Framework 3.5.1.
Ensure both options are checked
Windows Communication Foundation HTTP Activation
Windows Communication Foundation Non HTTP Activation
Hope this helps.
Check out this article on getting your extension mapped correctly:
IIS Hosted Service Fails
EDIT: Are you hosting the service in your application? Maybe your app pool getting hung?
Well I did figure this out eventually. Just a weird quirk of IE/IIS. I was testing by putting my REST URI in IE's address bar and expecting to see a page of JSON if everything worked. This is what would happen the first time the service was used. On further attempts IE would offer to download a file called 'FooService.svc' that actually contained my JSON data - I was never being offered to download my server-side svc file.
Ho hum, computers eh. Can't live with 'em, ...
enable 32 bit run for connected app pool in IIS 7
It's resolved my problem.