WCF 4 Router Service configuration issue - wcf

I've created a WCF 4 Router Service and am hosting it in IIS7. It works fine on my development machine, but when I deploy to the QA server is returns the following message:
The configuration section 'routing' cannot be read because it is missing a section declaration
The section it's complaining about is the standard WCF4 routing section:
<routing>
<filters>
<filter name="MatchAllFilter1" filterType="MatchAll" />
</filters>
<filterTables>
<filterTable name="ServiceRouterTable">
<add filterName="MatchAllFilter1" endpointName="WCF_XXXService" />
</filterTable>
</filterTables>
</routing>
This should be stock standard, but I'm receiving the above error from IIS. Does anyone have any suggestions on how I can fix this issue?

Ok, finally found the solution here:
The root configuration files (the
machine.config file and the root
Web.config file) for the .NET
Framework 4 (and therefore ASP.NET 4)
have been updated to include most of
the boilerplate configuration
information that in ASP.NET 3.5 was
found in the application Web.config
files. Because of the complexity of
the managed IIS 7 and IIS 7.5
configuration systems, running ASP.NET
3.5 applications under ASP.NET 4 and under IIS 7 and IIS 7.5 can result in
either ASP.NET or IIS configuration
errors.
We recommend that you upgrade ASP.NET
3.5 applications to ASP.NET 4 by using the project upgrade tools in Visual
Studio 2010, if practical. Visual
Studio 2010 automatically modifies the
ASP.NET 3.5 application's Web.config
file to contain the appropriate
settings for ASP.NET 4.
READ MORE HERE:
aspnet4 breaking-changes

A quick Google turned up this:
If you upgrade a site to .NET 4, and don’t upgrade the application pool to use .NET 4, you will get this. The machine.config file for .NET 4 declares this section, and earlier version did not have it (unless you manually added it).
In IIS 7, with the site select, choose Basic Settings in the right pane. This will bring up a dialog that contains the name of your application pool. Then select the application pools tree node and the application pool from the list that shows up. Choose Basic Settings from the right pane here, and you can change the framework version.
From here

Can you try re-running aspnet_regiis from the FrameworkXXX\microsoft.net\v4.0.30319 folder and reset IIS?

Check the .Net framework associated with the site's app pool.
If you need to change it, run iisreset -force after to ensure changes take effect.

Related

Deploy ASPNET Core (ASPNET 5) application on IIS Virtual Directory

I want to deploy a ASPNET Core (old ASPNET 5) application to IIS.
I was able to deploy to a new Web Site following this guide. But I want to deploy it to a virtual directory.
I tried to follow the same steps (but using Virtual Directory instead of Web Site), but I was unsuccessful. The page does not respond, and DNX is not launched.
I am using runtime 1.0.0-rc1-update1.
Check if in web.config file in handlers section in aspNetCore handler you have not directoryPath="*" statement. If there is just delete it, but only this statement not an entirehandler. Check on image below.
I remember that I had a problem with that.
web.config
in my expreience for launch aspnet core project on iis you should try to this steps:
1- dont use source for lunch because iis need web.config so just lunch after publish, publish create a web.config to you
2- be sure that install the core modules to your iis
3- dont use shared app pool , create a new one and set Clr version to "No managed code"
i hope this can be useful

Deploying MVC 4 application on IIS 7.5 Error HTTP 500.19

I am trying to deploy my asp.net mvc4 web app on IIS 7.5 under Windows 7 professional.
I have copied all the necessary files using publish method from Visual Studio 2010 express into folder D:\IIS\MyWebsite
This folder contains the typical structue MVC 4: folders App_Data, Content, Images, Views, Controllers, bin, App_GlobalResources, Scripts and some files at root like: Global.asax, Web.config.
I create a website with a name, let's me say as an example, MyFirstMVC on port 81 and associated to a custom app pool, let's say, MyAppPool (using ApplicationPoolIdentity) which is in integrated mode and using NET Framework 4 as my web app is developed in NET Framework 4.
When I run it below error is raised:
Error HTTP 500.19 - Internal Server Error
and above the example I can see in configuration source section below messages:
49: <modules runAllManagedModulesForAllRequests="true" />
50: <handlers>
51: <remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" />
I have tried to add IIS_IUSRS to my root folder 'MyWebsite' and give it full control permissions but it does not work. I have tried some things discussed here:
How do I resolve "HTTP Error 500.19 - Internal Server Error" on IIS7.0
Also I have observed that once opened inetmgr when I select the root node of the Connection tree on the left, then in the panel on the right, there is no ASP.NET group, only IIS and management so I am not sure it is normal, maybe is there something wrong with ASP.NET¿?
SOLUTION:
Finally, I have solved it by running following command as in internet information services ASP.NET was missed:
%windir%\Windows\Microsoft.NET\Framework64\v2.0.50727\aspnet_regiis.exe -i
%windir%\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -i
in my case the path is pointing to Framework64 because I am running on a Windows 7 professional x86_64.
I had same issue. MVC4 application with IIS7 under VS 2012 (windows 7 with 64 bit).I solved the issue with below command.
Run -> CMD (administration mode)
C:\Windows\Microsoft.NET\Framework64\v4.0.30319>aspnet_regiis.exe -i
I had a similar situation but was receiving a 404 error. I'm running VS 4.5, IIS 7.5 and the website is MVC 4.5. I ran only the one line above which resolved my problem as well. thanks!
%windir%\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -i
NOTE: i figured it was something like this since I received an error when trying to review ".NET Complication" within the webapp of IIS.

HTTP Error 404.3 - Not Found" while browsing wcf service on Windows Server 2008(64bit)

I am developing an application based on .Net Framework 3.5 sp1 and hosted on windows server 2008(64bit).
While browsing wcf service (.svc) locally every things is ok but while browsing with full domain URL, it got an error.
local address is like this: http://localhost/MyService.svc
and domain address is like this: http://MySite.ir/MyService.svc
by the way pages (.aspx) and other files work correctly both on localhost and with domain address.
any Idea would be appreciated
Here is detailed 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.
Detailed Error Information
Module: StaticFileModule
Notification: ExecuteRequestHandler
Handler: StaticFile
Error Code: 0x80070032
Requested URL: http://MySite.ir:80/MyService.svc
Physical Path: D:\inetpub\vhosts\MySite.ir\httpdocs\MyService.svc
Logon Method: Anonymous
Logon User Anonymous
Please make sure you've activated WCF components from here.
Or alternate and easy way is, go to control panel -> Turn Windows feature on or off -> and make sure you've all the options ticked as mentioned in below screenshot.
You might need to activate each box and accept in case you get errors when activating all features at once
OK, here is the answer:
Go to Handler Mappings | Add Handler Manager --> And then add below information
Request Path: *.svc
Type: System.ServiceModel.Activation.HttpHandler, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Name: svc-Integrated
If anyone has this issue on Windows Server 2012, Bill Moon's answer here solved it for me:
"For Windows Server 2012... From the Server Manager, click on Add roles and features, select the appropriate server, then select Features. Under .NET Framework 4.5 Features, you'll see WCF Services, and under that, you'll find HTTP Activation."
I have windows 10 in my laptop and using visual studio 2015 for WCF development. WCF is running fine in visual studio but when hosted in IIS I got the same error.
I checked IIS handler. svc extension was missing. So I tried to add new handler in IIS as suggested by Mori in first answer. I didn't find type "System.ServiceModel.Activation.HttpHandler".
So I opened "Turn windows features On or Off" and installed features as highlighted in screen shot.
This worked for me.
If you're using .Net 4.x, the PublicKeyToken is 31bf3856ad364e35.
However, following this post about installing WCF Services properly in IIS, the handler was set up for me.
I wanted to add this as a comment to the answer but didn't have enough rep for it. I tried running ServiceModelReg and aspnet_regiis.exe with various flags and added HTTP Activation feature but it still didn't work. Even using the Handler mapping UI in IIS didn't work since it could not find System.ServiceModel.Activation.HttpHandler. What finally worked was adding the handler Mori mentions manually to my web.config file.
<system.webServer>
<handlers>
<add name="svc-Integrated" path="*.svc" verb="GET,HEAD,POST,DEBUG" type="System.ServiceModel.Activation.HttpHandler, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" modules="ManagedPipelineHandler" scriptProcessor="" resourceType="Unspecified" requireAccess="Script" allowPathInfo="false" preCondition="integratedMode" responseBufferLimit="4194304" />
My project was running .Net 3.5 and IIS 7.5 on Windows 7 and IIS 7.0 on Win Server 2008 R2.
Try unchecking WCF HTTP activations from "Turn Windows featured on or off" window (See here) and re-install by going to
%windir%\Microsoft.Net\Framework\v3.0\Windows Communication Foundation\
and execute ServiceModelReg -i

ASP.net 4.0 default.aspx problem on IIS6

I installed .net framework 4 on my windows 2003 enterprise x64, wrote simple asp.net 4.0 application (default.aspx page only). The application works great if request is to default.aspx, not to the root site:
contoso.com/ - doesn't work (Get 404 error)
contoso.com/default.aspx - works.
Default.aspx is in list of default documents in IIS.
Please help.
Found a fix in a seemingly unrelated location - try setting the "EnableExtensionlessUrls" registry key to 0:
ASP.NET 4 Breaking Changes -> ASP.NET 2.0 Applications Might Generate HttpException Errors that Reference eurl.axd:
In the Windows registry, open the following node:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ASP.NET\4.0.30319.0
Create a new DWORD value named EnableExtensionlessUrls.
Set EnableExtensionlessUrls to 0. This enables extensionless URL behavior.
Save the registry value and close the registry editor.
Run the iisreset command-line tool, which causes IIS to read the new registry value.
You will find the answer here
http://johan.driessen.se/archive/2010/04/13/getting-an-asp.net-4-application-to-work-on-iis6.aspx
.Net 4.0 doesn't enable itself to run with IIS so you have to run the command (while in the folder c:\windows\system32):
cscript iisext.vbs /EnFile C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll
or in your case since you are running x64
cscript iisext.vbs /EnFile C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll
Change the ASp.Net Version from 4.0 to 2.0 and apply it. and revert back The Asp.Net version to 4.0. This Will address the issue.
I don't have enough points to comment apparently, but I wanted to say that the solution from Will WM worked for me. Adding EnableExtensionlessUrls to the registry corrected the problem.
As a side note, if your run aspnet_regiis at anytime, it will remove this value and you will need to add it again.
I use the following regex as first rule with Ionics Isapi Rewriter for web sites running on ASP.NET 4 on IIS 6 to remedy the problems caused by the breaking change introduced with ASP.NET 4 :
RewriteRule ^(.*)/eurl.axd/[a-f0-9]{32}(.*)$ $1$2
This let me again use extensionless urls.
Note that the second group captures the querystring if present and restitutes it to the rewritten url.
And yes, it's a feature, not a bug.
Are you sure it's default.aspx not default.asp in the list of default documents?
You will also get this error on ASP.NET 2.0 virtual directories in IIS6 if you have another virtual directory on the same site that is set to 4.0 and the DefaultWebSite is set to use ASP.NET 4.0.
The solution is to change the DefaultWebSite back to the ASP.NET 2.0. Your 4.0 virtual directory will still do fine underneath that web site.

WCF RIA Silverlight deployment issues

It seems the world is awash with people having problems deploying RIA WCF services, and now I'm one too. I've already tried a bunch of things, but to no avail. I need WCF RIA to support a Silverlight 3 application I've built.
The short story is, using the new WCF RIA services (Nov 09?) I open VS 2008, create new project (silverlight application), enabling ".NET RIA services". Add new item to web project - Linq2SQL dbml file (from SQL 2005 DB prepared earlier) and compile. I add a new item to the web project - domain service (link the tables I need) and compiled. Using the domain context I "Load" data with a standard RIA get query in the MainPage and add a TextBlock to display returned data. Build & run (cassini) - success. Using VS to publish to IIS on local PC - success.
Using VS to publish to test server (IIS6) - browse to location and the Silverlight app loads but Fiddler tells me I've got a 404 on all the the WCF .svc requests. Use Fiddler to "launch IE" on the service request and it's true - 404.
I have already run aspnet_regiis, ServiceModelReg and added mime types for .xap, .xaml, .xbap and .svc. I have included the System.Web.Ria and System.Web.DomainServices DLL with copy local true.
I need help with either
a) a solution
b) an approach to find a solution
I had some troubles with this also, although once I figured them out it's relatively straight forward.
First, run through http://timheuer.com/blog/archive/2009/12/10/tips-to-deploy-ria-services-troubleshoot.aspx (although it seems you have most of that covered off).
Check that you have your DomainServiceModule in the web.config in the new system.webServer bit and the old bit for IIS6:
<httpModules>
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add name="DomainServiceModule" type="System.Web.Ria.Services.DomainServiceHttpModule, System.Web.Ria, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</httpModules>
Finally, I had to create my services manually, by creating .svc files where SL is looking for them (from fiddler) and filling them in with:
<%# ServiceHost Service="NameOfSerice" Factory="System.Web.Ria.DomainServiceHostFactoryEx" %>
Make sure that you also visit the .svc file directly (without the /binary on the end) as you can get some nice errors there (well once you solve your 404 of course!)
HTH,
Jordan.
I fought this issue for a little while myself where it could not find the .svc file. I soon realized it wasn't just my .svc, it was all .svc files. It then appeared to be an IIS6 issue. It turns out that the ASP.NET v4.0x Web Service Extensions are set to "Prohibited" by default. Went into Web Service Extensions config and set ASP.NET v4.0x to "Allowed" and life was all good.
I ran into the same problem. Worked fine with the cassini server under Windows 7. Deployed to Windows Server 2008 R2 with IIS7, and it would not work. Fiddler reported that an 'EndPointNotFoundException' was being thrown.
My solution, since I have full control of the server, was to install Visual Studio 2008 Express, Silverlight 3 SDK, and the WCF RIA Services Beta for VS2008. This meant that the necessary DLLs were already installed in the GAC. I don't think this affected the result, but I turned off 'Copy Local' for the RIA DLLs that were referenced by the Web app.
Probably an unorthodox solution, but it worked for me!!! Actually, I did this at the suggestion of Microsoft Support.
By the way, support for this through Microsoft is very sparse at this time. They are actually trying to figure out right now internally who is going to support this technology: WCF team or Silverlight team. I know it's still in beta, but be warned that a 'GoLive' license doesn't mean its fully supported. I had someone from the WCF team who went out of his way to help me on this, but gave me a disclaimer several times during the call, that it wasn't really supported through those channels yet.
If someone is interested, how to deploy a complete Silverlight solution to IIS with your own batch script, read my answer in this post:
Is there a Management Service (WMSVC) UI in IIS 7 on Windows 7?
I did this, because there was no way, the in-bulit webdeploy feature of VS 2010 was working. The batch script makes it possible, that you can run and debug on IIS.
I know, this is not the explicit answer to this question, but it is a very similar question.
I think you would only use FactoryEx if you extended the Factory as described here. Also, according to my help files, the full name is System.Web.Ria.Services.DomainServiceHostFactory, but the parser can't create that type either, although I have System.Web.Ria in the GAC.
I agree - deploying WCF RIA over https is a challenge - I have yet to get it to work.