ServiceStack Razor Engine not rendering Layout (_Layout.cshtml) - iis

I've been trying to deploy a quite simple website based on ServiceStack with Razor view engine to a newly installed Windows Server 2012 box.
It works fine on my Win 7 developer machine, but once on win 2012 iis 8 this happens:
GET /Home : Renders and returns just my Homes.cshtml view, with no sign of my _Layout.cshtml, so no stylesheets or scripts are loaded.
GET /Customers : Nothing. Just the "standard" ServiceStack page. No sign of either Customers.cshtml or _Layout.cshtml
GET /System : Renders and returns my Systems.cshtml, no sign of my _Layout.cshtml
Anyone got an idea?
Seems configuration of iis8 might not be all that compatible with my iis7 developer configuration.

Seems Visual Studio did not pack all the views correctly in the publish package. A little fiddling with the build actions and it worked fine. Some of the views had build action "None", while others had "Content". (So much hassle for so little)

Related

Visual Studio 2013 Asp.net Razor v3 website unable to host to IIS windows 7.5

I am trying to host a asp.net razor v3 website to IIS, but it is not working. I tried multiple options including first creating the website then publishing to IIS, or directly creating a new website under IIS using visual studio 2013. It gives me HTTP Error 503. The service is unavailable.
Methods to reproduce Error:
Option 1
1) Create a new asp.net web site (razor v3) in visual 2013, and click publish to publish to a directory. Then, add that directory as a website in IIS.
Option 2
1) On the new website window, in visual studio 2013, go to browse and select IIS, and create a virtual directory directory under IIS to save the site.
Then, go to the browser and try to access the hosted site: localhost/sitename, it always produces some kind of errors. Like 503. What am I missing? Please help, looks like I am missing some steps or some configuration changes.
Also, I am trying this with the default razor v3 webiste content and without modifying anything. So, I have not touched any files or anything, I am just trying to upload to IIS.
The correct answer I found was that for some reason you must use the IIS Express 8.5 to test/host that site.
Even the installations on the fresh copies of Windows with Full IIS prior to version 8 did not work on my test machines.

HTTP Error 404.17 - Not Found (.Net 4)

I've just got a new server setup on Windows 2008 Web edition. I'm trying to set the first asp.net 4 application up on it but am having nothing but problems.
The latest is that I'm getting the 404.17 error, which says "the requested content appears to be script and will not be served by the static file handler.".
I've done a lot of research on google but most suggestions seem to be to run aspnet_regiis -i to install asp.net 4. I've done this several times both on the Framework and Framework64 folders, but with no success.
I tried changing from the default application pool to a .net4 application pool, which appeared to work at first and I instead got a server error to do with permissions. I fixed that, and immediately the 404.17 error returned.
Other suggestions I've read say to go into the "turn windows features on and off" and make sure .net 4 is selected there under IIS. However on this server clicking "turn windows features on and off" takes me to the standard windows 2008 server manager. I click "add features" there, and only ".NET Framework 3.0 Features (Installed)" is listed and selected. .NET 4 isn't shown there, yet it is selectable through the application pools.
What else can I try to get the website running as I'm at a complete loss now. Its annoying because my old server was easy to manage - I did it all through the server itself without a control panel (Windows 2003), now on my new server I have to manage most of it through Plesk because there is no dns.
Any help would be much appreciated.
I too had the same problem but solved it with simple solution. My program was in framework 4.0 but in application pool was mapped to framework 2.0.
Just changed the frame work in application pool to 4.0.
It worked.
I've finally figured out the problem, and it was to do with Plesk itself.
After delving through some of the thousands of links throughout the plesk control panel I found a page for "Website Scripting and Security". Under there it was set to .NET 2.0. However, even though I'd installed .NET 4 on the server, Plesk didn't know about it. Although the application pool I'd set the website to run under through IIS was .NET 4, it still wouldn't work for some reason.
I then found another page under "tools and settings" for server components, and on that page is a refresh button. Hit that and it suddenly realised that .NET 4 was installed, went back to the website scripting and security page, selected .NET 4, and hey presto, I got a server error (never have I been so glad to see a server error).
I then just had to give the application pool identity read access to the web folder, and the website worked.
I wish I'd paid an extra £15 per month for Windows 2008 Standard edition now so I could manage it all manually without Plesk.
Ensure that you are running this application under a Virtual Directory, also ensure that your IIS has ASP, ASP.Net, ISAPI Extensions And Filters, Static Content installed.
Change the .net framework from 'plesk' panel:
go to Domains
select then domain
Go to 'Domain and Websites & Domains'
Hide Advanced Operations
Go to 'Asp.net Settings'
Go to 'Change Version'
select 4.0
If you don't have the 4.0 option then you must install the framework on your server first.

Period in ServiceStack Routes works in IIS6.0 but not in Dev server?

I am using service stack and I need to have periods included in my routing for example to indicate a version number, eg
/Model/v1.0/Save
When I deploy the service onto IIS6 it works perfectly, however when i run it locally through Visual Studio I get an error of
Request handler not found.
If I remove the period then it works!!
I have looked through all the questions and there was a similiar one,
ServiceStack Handler Not Found When Periods Present in Path
BUT the answer implies that it cant be done and I have seen it working. Secondly in the link referenced in the answer the Service Stack rest tests seem to show that a Version number with a period is a valid route??
See here
https://github.com/ServiceStack/ServiceStack/blob/master/tests/ServiceStack.ServiceHost.Tests/RestPathTests.cs#L210
Please can someone give me some guidance on this one!
Thanks
I just answered this similar question, and i think the same should apply in this case: Visual Studio Development Server (Cassini) does incorrect routing for dots.
If you create a file system Web site in Visual Studio 2010 and the Web site is in a folder that contains a dot (.) in the folder name, URL routing will not work reliably. An HTTP 404 error is returned from some virtual paths. This occurs because Visual Studio 2010 launches the Visual Studio Development Server (Cassini) using an incorrect path for the root virtual directory.
There are 3 workarounds, and only the "use IIS instead of Cassini" workaround seems to work for ServiceStack.
The problem will go away if you edit your project Web properties and check "Use IIS Express" instead of "Visual Studio Development Server".
The cases to use IIS Express are explained in the announcement, and there is a download link.

Visual Studio 11: Server-side includes in ASP .NET Development Server

I am testing a static website project in VS11 beta to check its capabilities to handle HTML, CSS, JS code and the great built-in browser (Page inspector) for live manipulation of the page. All those wonders I watched on a channel 9 video. 8-)
Unfortunately, my website has SSI for header, footers and common partials which VS's page inspector or any browser doesn't render at debug time. It appears to me ASP .NET Development Server has to be configured for SSI which I don't have any clue how and I can't find help anywhere. I know better way to do is to use the server-side script, but same website is already deployed on a hosting server running IIS 7.0 and working like a charm.
Any thoughts?

iOS5 app will not download with itms-services on IIS, but works on Apache

I've rebuilt an iPad app to run on iOS 5. I put a link to the code on an internal apache server:
itms-services://?action=download-manifest&url=https://internal.mysite.com/pages/manifest.plist
and it downloads fine to all of our devices running iOS 4 and iOS 5. I then put it on our Intranet site running IIS and Sharepoint
itms-services://?action=download-manifest&url=https://intranet.mysite.com/pages/manifest.plist
And only iOS 4 users can download it. iOS 5 users receive: Cannot connect to intranet.mysite.com when they click the link.
I've updated the MIME settings on IIS, but that didn't help. We've removed all provisioning profiles from the devices, but still it doesn't work.
The manifest.plist is updated as well to point to the intranet site and everything works on iOS 4. Seems like iOS 5 and IIS don't get along ... any ideas?
Make sure your IIS site allows anonymous access

Resources