MVC 5 application Deployment on IIS7 getting error 404.8 - iis

I have created a MVC5 Web Application and tried to deploy on IIS7 on a separate machine having windows 2007 . everything is set ok but when I am Browsing it its giving
404.8 The request filtering module is configured to deny a path in the URL that contains a hiddenSegment section
please Suggest something .
I have tried it by publish also

By default IIS will reject requests where the path contains "bin", "app_code", "app_data", and a few other reserved names. See http://www.iis.net/learn/manage/configuring-security/use-request-filtering (section "Filter Out Hidden Segments") for more information.

It is Solved by installing .Net 4.5 framework separately I have missed it previously .
for my Other Friends who are facing same problem . you should have these .
entity framework
razor framework
.Net framework 4.5

I had the same issue.Just do the following steps resolved my issue.
Go to IIS manager
Select your web site
Double click on the Request filtering icon under IIS.
Right click the file that error raised and remove it.

Related

IIS 6 to IIS 8 Migration Errors after using Microsoft Web Deploy

I have recently been trying to migrate some websites from a 2003 server with IIS 6 to a 2012 server with IIS 8 installed. I am using Microsoft's Web Deploy tool and have been successful in copying a few web sites one at a time using the following command (changing the site identifier # for each site).NOTE: The reason the mumbo jumbo with replacing the drive exists is because our new server has a different data drive on it, and MSDeploy didn't like that. Could that be breaking things as well?
msdeploy -verb:sync -source:metakey=lm/w3svc/#,computername=SourceServerNameHere -dest:metakey=lm/w3svc/# -replace:objectName=metaProperty,scopeAttributeName=name,scopeAttributeValue=Path,targetAttributeName=value,match="F:",replace="E:" -enableLink:appPoolExtension > migration.log
The main issue is that when I try to navigate to any site one of three errors happens..
1. 503 Service Unavailable
2. 401.2 Unauthorized
3. 404.17 Not Found
These errors start from 1, and progress to 3 as I am trying to troubleshoot the IIS configurations. But this kind of defeats the purpose of using the Web Deploy Tool. Has anyone had any luck migrating sites being completely successful, or does the tool not actually support "IIS 6.0 or higher migration?"
Thanks in advance.
EDIT: So I have been able to get the main page of my site working by reverting the Handler Mappings and Default Documents to their parent configurations, and making sure that the AppPools don't conflict with versions, etc. The problem with this, is that I have to figure out how to do this for every app and app pool under the sites... Does anyone else have a similar problem?
Try using the iisApp provider instead of the MetaKey provider. For example,
msdeploy -verb:sync -source:iisApp=Site1/ContosoApp,computerName=Server1 -dest:iisApp="Site1/ContosoApp",computerName=Server2
https://technet.microsoft.com/en-us/library/dd569054(v=ws.10).aspx
I ended up contacting Microsoft Support to get this sorted out and ended up spending 3 hours on the phone with them...There were multiple issues that came up during the deploy tool's migration.
The bulk of the issues were corrected by changing the application pools to 64-bit and commenting out abomappercustom handlers in the applicationhost.config.

How to configure an MVC6 app to work on IIS?

So I'm building an MVC6 app in Visual Studio 2015 and have managed to figure most stuff out, however, I haven't yet worked out deployment.
In MVC4 (what I was using before), our process* was publish to a folder, then setup the website in IIS (Right-Click on Sites -> Add Website).
Actually, our process is set it up in IIS and TeamCity, but not for test apps like this :).
I followed this process and obviously it's trivial to setup the IIS website and publish to the correct folder...but that does not actually work for me.
We're running IIS 8 on Windows Server 2012 and we've installed the .Net 4.6 runtime on the server.
The following steps have worked for me and should help you host your project on IIS.
Using Visual Studio 2015 Preview as your IDE,
Create an ASP .NET 5 Starter App.
Check that it is working outside of IIS.
Once complete, publish the application. In this example, I have selected the location C:\PublishWebApp.
3.1. When publishing your application, make sure that you have:
Disabled precompilation
Selected amd64
(See image below)
Upon a successful publish, go to C:\PublishWebApp.You should see the folders approot and wwwroot inside.
Now open the IIS Manager (I am assuming you have the ASP .NET 4.5 feature enabled)
Create a new website.
6.1 : Select the wwwrooot folder as the website's physical path. In this example, it is C:\PublishWebApp\wwwroot.
Check the website to see that it is working. If you encounter any errors, please post them here.
If the precompile option is ticked in the Publish Web Settings window pictured above, then you must
Go to the wwwroot folder of your published web application. In this example, it is C:\PublishWebApp\wwwroot.
Locate web.config.
Inside the folder of your published application, there is an packages folder inside of the approot folder which should contain a folder named after your application, with a folder for the version underneath. Inside that folder should be a folder named root. In web.config, set the value for the key kre-app-base to the root folder. For reference, see the line of code below. In this example, the application name is WebApplication10.
<add key="kre-app-base" value="..\approot\packages\WebApplication10\1.0.0\root" />
I Spent hours on debugging the issue finally got it worked, steps:
1) Publish your MVC6 application using visual studio into file system, make sure you are selecting correct DNX Target version in my case its dnx-clr-win-x64.1.0.0-rc1-update1.
In the output folder map "wwwroot" folder to your applicaiton in IIS (DO NOT Map it to sup-applicaiton, only ROOT application in IIS works with DNX for example "Default Web Site").
I have just spent a day trying to get this working. i found this here (search for posts by GuardRex) invaluable, complete the steps the accepted answer gave, that's the start of it.
Pretty much if you try to add an application to a site there is bunch of workarounds and extra configuration needed that is detailed in the link.
For starters:
1)Make sure you have the HttpPlatform handler installed here
2)Seems obvious but make sure .net5 is installed on your server here
I know this is if you are adding an application to a site, but there's some pitfalls and much needed refinements needed for the deployment process at the moment that everyone should be aware of.

Cant get a basic ASP.Net 5 website working on Azure

I have a very basic ASP.Net 5 application that I created following this guide https://www.asp.net/vnext/overview/aspnet-vnext/create-a-web-api-with-mvc-6, and it works grate from VS.
However I cant get that to work on azurewebsites. I keep getting the yellow runtime error page on the browser and this exception on the log file:
<EventData>
<Data>3005</Data>
<Data>An unhandled exception has occurred.</Data>
<Data>11/22/2014 9:39:33 PM</Data>
<Data>11/22/2014 9:39:33 PM</Data>
<Data>9e1c1ecb36f647ddb1f4b1856b2a105c</Data>
<Data>1</Data>
<Data>1</Data>
<Data>0</Data>
<Data>/LM/W3SVC/46675609/ROOT-1-130611659736590153</Data>
<Data></Data>
<Data>/</Data>
<Data>D:\home\site\wwwroot\</Data>
<Data>RD00155D431959</Data>
<Data></Data>
<Data>21084</Data>
<Data>w3wp.exe</Data>
<Data>IIS APPPOOL\glMigrations</Data>
<Data>DirectoryNotFoundException</Data>
<Data>
Couldn't find package 'KRE-CoreCLR-x86.1.0.0-beta1'. Locations probed:
D:\home\site\approot\packages\Migrations\1.0.0\packages\KRE-CoreCLR-x86.1.0.0-beta1
D:\home\site\approot\packages\Migrations\packages\KRE-CoreCLR-x86.1.0.0-beta1
D:\home\site\approot\packages\packages\KRE-CoreCLR-x86.1.0.0-beta1
D:\home\site\approot\packages\KRE-CoreCLR-x86.1.0.0-beta1
D:\home\site\packages\KRE-CoreCLR-x86.1.0.0-beta1
D:\home\packages\KRE-CoreCLR-x86.1.0.0-beta1
D:\packages\KRE-CoreCLR-x86.1.0.0-beta1
at AspNet.Loader.KRuntimeLocator.GetPathToSpecificKrePackage(DirectoryInfo appPhysicalPath, String krePackage)
at AspNet.Loader.KRuntimeLocator.LocateKRuntime(MapPathHelper mapPathHelper, Boolean& isCoreClr, String relativeAppBasePath)
</Data>
I tried with the core and the full version and got the same results.
Any advice will be appreciated.
I came across the same error when deploying to a local IIS server. The issue turned out to be caused by the project build settings not having "Produce outputs on build" ticked. I've just tried running my test project on Azure Website and managed to get it working.
I also had another issue deploying to the default "Free" plan website, as I was using the X64 KRE and only the "Basic" and "Standard" plans support X64.
I wrote a Blog Post on how I got ASP.NET 5.0 working on local IIS, which I've updated with the Azure website findings, as my rep here is not high enough to post pictures.
Edit:
In case the link to my blog post breaks the following is a basic description of the steps I took to get ASP.Net 5.0 running on IIS and then Azure Websites
Created an ASP.NET 5.0 Site using the Visual Studio 2015 Preview template running on Windows 10 Technical preview
For the local IIS I then ensured that IIS had all the required features, which you can obviously skip for azure
I then changed the "Build Settings" of the project to enable "Produce Outputs on Build" for both "Debug" and "Release" configurations
Next I updated the project.json file to use the url I had configured in IIS, again this may not be necessary for azure
I then created a Publishing profile to the local IIS server, which worked nicely.
Having seen this post, I then attempted to deploy to Azure by simply creating a new publishing profile targeting Azure Websites
I came across a similar error at this point, as I was targeting the X64 KRE, and the default Azure Website had been created as a "Free" site which does not support X64.
I then changed the Azure Website to the "Basic" plan, and enable X64 cpu.
Finally I redeployed using the earlier created Azure Publishing profile, Which this time resulted in a working site

IIS Error - It is not possible to run two different versions of ASP.NET

I'm getting this error thrown repeatedly on my IIS 6.0 server:
It is not possible to run two different versions of ASP.NET in the
same IIS process. Please use the IIS Administration Tool to
reconfigure your server to run the application in a separate process.
However, I ran an IIS MetaBase Analyzer to view all AppPools and AspNetVersions they're running and do not see any AppPools running different versions of AspNet. Is this a bug in IIS or is there definitely an AppPool running multiple versions of AspNet?
Thanks
Although it's an old question, for the benefit of future users who visit this yet unanswered question, here is the solution that worked for me.
In my case, the following worked.
Symptom :
The ASP.NET tab, for the "Default Website" node of the IIS Admin was showing a version of 1.1.
The ASP.NET tab, for my virtual directory application, was showing a version of 2.0 (which is the right one for my application).
Solution :
I changed the first one from 1.1 to 2.0. The application worked.
Cause :
The cause, however, seems "mysteriously unrelated", as it often happens in Windows. It was working fine with the same old (different) settings until a week back. What happened during the week, was that the machine A running the web server for my web application, had to unjoin a domain B and join another domain C, because the primary domain controller on B failed and had to be replaced with C. Why on earth would that affect IIS Admin or the web application hosted on A, and why it should generate this particular error is beyond me. Such a cause for this error seems undocumented.
It is not possible to run two different versions of ASP.NET in the same IIS process. This would mean you have multiple applications (either sites or virtual directories) using the same appPool, but one of these sites/applications has a different .NET version setting in the .NET tab. You would have to create another appPool to use different .NET versions.
To create another appPool and associate it to your application do (Windows Server 2003):
1.Click Start, point to All Programs, point to Administrative Tools, and then click Internet Information Services (IIS) Manager.
2.In Internet Information Services (IIS) Manager, expand , right-click Application Pools, point to New, and then click Application Pool
3.Right-click on application that uses a different .NET version and click on Properties
4.On menu Virtual Directory choose in the item Application Pool the application pool that you created in point 2.
Regards!

IIS not able to locate the web.config

I have a deployed a web application in IIS. Which used to work without any issues. Recently i have shifted that web application to another machine, Here is the problem. Once i setup the Webapplication when i opened the default document in IIS im getting the File not found error as following
Internal Server Error
\?\C:\inetpub\wwwroot\application\web.config
I have no clue why the IIS is not able to find the web.config. The file is present in the path C:\inetpub\wwwroot\application\web.config but the IIS is looking in the path \?\C:....
Please let me know how to resolve this??
Firstly this is documented on support.microsoft.com so I would suggest that anyone who has this issue read this first as it covers a number of solutions which I won't
Now from personal experience I encountered this error after setting up a new development machine. What I had forgotten to do was install the Url Rewrite 2.0 IIS module. Sadly the IIS error gives absolutely no idea that this is the actually issue.
Therefore to solve this issue investigate the system.webServer setting in our web.config and ensure that you have installed all the iis modules that you use. I did this by systematically removing elements from my web.config until I came across the cause.
In my case, I was running ASP .NET Core website so I had to install .Net Core Runtime from
https://dotnet.microsoft.com/download/dotnet-core/current/runtime
I know it's old post but I resolved the same issue as follows:
If you are using TFS and you are getting this problem then Reason is ".vs" file is not excluded from commit.
Because of that ".vs\config\applicationhost.config" gets the local version of another user/Developer.
To Solve the error, First open that file Update Physical path inside "" xml tag.
Also ask user to exclude this folder from TFS to prevent future issues.
If you are getting mysql localhost error. What I will do will work for you.
Control Panel(View by: Large Icons) >> Programs and Features >>
(Usually upper left corner) Turn Windows Features on or off >>
Internet Information Services >> Web Management Tools and World Wide Web Services
After Restart.

Resources