ASP.NET MVC3 not working in Windows 8 - asp.net-mvc

is there anything special I need to do to get ASP.NET MVC3 enabled on my Windows 8 Release Preview install? Creating even a blank ASP.Net MVC3 Razor application in VS2010, deploying to the local IIS instance as a new application, and loading the page in the browser doesn't work. I'm met with the following error:
HTTP Error 403.14 - Forbidden
The Web server is configured to not list the contents of this directory.
So I've then gone in to the new VS2010 project, right click, select "Add Deployable Dependencies" and selected "ASP.NET MVC" along with "ASP.NET Web Page with Razor syntax"
Then I re-deploy the project to local IIS application. No change. Still "web server not configured to list contents of the directory".
It's worth noting the VS 2010 Development Web Server works fine.
Any ideas?

Found it. Turns out even though I'm using ASP.NET MVC3 and had the .Net 4.0 framework installed, the Windows 8 "feature" for ASP.NET 4.5 needed to be installed for all this to wire up. Seems a bit counter-intuitive, but changing that did it.

You may want to consider running the MVC3 installer on your host machine so that all dependencies for MVC3 projects are stored in the GAC. If you need the install package you can download it from:
http://www.microsoft.com/web/gallery/install.aspx?appid=MVC3
I can't verify that this works on the Windows 8 preview, but it would be my first instinct upon running into your problem.

Did you ensure that the worker process for the site is configured for .NET 4?
When you say you "Deployed", how did you do that? It sounds like the folder is not being set to an application.

For me .NET 3.5 was not installed for IIS 8 in Windows features. Although I'm pretty sure my app is .NET 4.0... Worth trying though.

I had problems installing MVC3 MS VS 2010. Windows 8 x64. The platform installer shows no errors.
Root cause : aspnetwebpages.msi breaks updating web.config files. I updated two web.config files which appeared to only contain blanks.
Here are my directions:
Ensure C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config is valid. Use web.config.default, copy then rename to web.config to correct if it looks wrong.
Ensure C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\web.config is valid. Use web.config.default, copy then rename to web.config to correct if it looks wrong.
I don't know why the files were bad in the first place.

Related

aspnetcore.dll failed to load

I usually dev on a windows 7 desktop, using visual studio 2015 update 3. I have the same vs2015.3 on my windows 10 laptop. I copied an asp mvc 5 app I am working on to the laptop but it wont run when I try to launch it from VS. I get the "aspnetcore.dll failed to load" error. I looked around and most solutions are to repair the asp net core install, but my laptop does not have asp net core installed on it, because I don't use core yet. My project is targeting .Net 4.6.
My desktop does have Core on it. So do I have to install .net core just because? Or is there some other solution? I am using the default IIS 10.
Found the solution - the applicationhost.config file had references to ASP.NET Core and was trying to load the non-existent module. I deleted the applicationhost.config file and reopened the solution, which forced VS to rebuild it without the ASP.NET Core references. Works fine now.
In my case with Visual Studio 2015, this file was located in .vs\config\applicationhost.config
For earlier versions of Visual Studio using IIS Express, see this question for more information about where applicationhost.config is located: Where is the IIS Express configuration / metabase file found?
Using VS 2015 (Windows 10). Working on a downloaded sample MVC app (from Intuit) targeting .net 4.6.1.
I was getting the exact same behaivior/error:
"The Module DLL C:\Program Files (x86)\IIS Express\aspnetcore.dll failed to load"
Locating the Applicationhost.config file (part of download package) and deleting it, did not solve the problem because IISExpress re-generated the Applicationhost.config file with the same references.
To solve the problem I had to comment out all the (aspnetcore.dll) references:
(configSections)
< section name="aspNetCore" overrideModeDefault="Allow" />
(globalModules)
< add name="AspNetCoreModule" image="%IIS_BIN%\aspnetcore.dll" />
(modules)
< add name="AspNetCoreModule" lockItem="true" />
You can do a search and comment out accordingly.
Installing the recently released Anniversary Update (version 1607) of Windows 10 seems to destabilize IIS by shutting down Application Pools, thus resulting in a 503 error when trying to run an application, which is caused by some DLLs failing to load when the worker process starts.
Check out the Windows Event Viewer (Win+X, V) to see what you need to fix: Open "Windows Logs", then "Application" and look for "Error" level entries with the source "IIS-W3SVC-WP" (may be different if the name of your IIS instance is not the default one). In the details, you will see a short message, like this:
The Module DLL <path-to-DLL> failed to load. The data is the error.
Depending on your configuration, there may be different DLLs causing this kind of problem and they will occur one by one, so you will need to keep checking the Event Logs and fix the issues until your application properly starts up. To be sure, before every attempt, stop IIS and close IIS Manager.
Here are two specific issues we've experienced so far and how to fix them, but you may bump into completely different ones:
1."C:\WINDOWS\system32\inetsrv\rewrite.dll" (reference) ◦Go to "Programs and Features" (Win+X, F) and repair "IIS URL Rewrite Module 2".
2."C:\WINDOWS\system32\inetsrv\aspnetcore.dll" (reference) ◦Go to "Programs and Features" (Win+X, F) and repair "Microsoft .NET Core 1.0.0 - VS 2015 Tooling ...".
Original source
For anyone coming to this later, what worked for me was this:
https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/?view=aspnetcore-2.1&tabs=aspnetcore1x
I had to install the hosting runtime for aspnetcore (my team's using core) and that fixed my local IIS issues.
Deleting the applicationhost.config did not work for me.
My service was forced to run in 32bit mode, and my aspnetcore was 64 bit.
Since I'm currently not using .NET core I could comment out all references to aspnetcore in the applicationhost.config file and then restart iis.

.Net MVC Web Deployment

I have Visutal Studio 2012, MVC 4 & Razor. I am having trouble getting a website up and running with this technology.
The Web Server is a Windows Server 2008 server. I tried deploying using the Web Deploy method but am consistently getting something like 'set ACL" error.
I tried deploying using the File System. All files got deployed, but when I try and run the website, it fails because of missing ASP.NET MVC infrastruccture files.
Two things:
•If I use Web-Deploy, how do I solve the ACL error, because I assume with this method, everything needed will get deployed.
Note that the Web Deploy 3.0 service is on the server and started.
•If I use File System, where can I find the downloads needed to deploy on the server where MVC WILL work.
◦Note that I downloaded the 4.5 Framework and was successfully installed.
You need to be a bit more precise with what you need help with.
What's the exact error.
Often times you need to give the IIS users group access to at least read from the directory where you've deployed. Did you do this already?
Do you have .NET 4.5 and MVC4 installed on the server? If not, are you expecting those DLLs to be "packaged" with your deployment? They generally are not since they are "standard" assemblies. But if you want them to be included in your deployment you can do that by selecting the references in VS and saying "copy." This is not recommended because when you install patches to .NET and MVC on the server, those updates will not carry through to your app, since it'll use the local (old) copies of your assemblies.
This may be more of an IIS issue, but not sure based on the details in your question.
Check that the application pool that the site is running under is using .net 4.0.
Just a thought I would check.

Can not remove Default.aspx from Asp.net MVC 3 Application

I am working on a project that started out using ASP.Net MVC 1 and has since been upgraded to ASP.Net MVC 3. It is my understanding that if I am running my ASP.NET MVC 3 app on IIS 7 using the integrated pipeline that I no longer need the Default.aspx file. However after I have removed the file from the project and physically deleted it I get the following error every time I try to compile in Release mode:
Description: Could not load type 'ProjectName.Default'.
File: Default.Aspx
I have verified that there is no instance of ProjectName.Default or Default.aspx in my project file. I have even done a grep search in all of my files in the project for any mention those names and still have found nothing. What do I need to do to be able to remove Default.aspx from my ASP.Net MVC 3 app and get it to compile in release mode. It compiles just fine in Debug mode by the way.
From the debugging listed here you probably had a cached version of your compiled code. While Visual Studio builds the code behind files into a single DLL, ASP.NET compiles each aspx file into a DLL as well (depending on how you configure it, there can be variations on this). These DLLs are located at %WINDIR%\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files note that this directory is sensitive to .Net version, could be in 2.0 or 4.0, it is also in some way dependent on bit-ness, as there is a similar directory in Framework64.
I tried to clean my solution, delete the project temp files, remove all the leftover crud I could think of. Unfortunately none of this worked so I had to take the brute force approach and checkout a new copy of my project. After doing this I no longer had the error occur when building the new copy that had Default.aspx removed. Unfortunately this solution did not provide me any insight into what leftover file Visual Studio was holding onto.

Odd Things of ASP.NET MVC Deployment on IIS 6

Recently, I am a bit interested in the deployment of ASP.NET MVC application on IIS6 because Phil Haack posted an easier way to deploy ASP.NET MVC application on ASP.NET 4. So I decided to see how different version of ASP.NET MVC works on different version of ASP.NET.
First off, I created an ASP.NET MVC 2 project in Visual Studio 2010 and deploy it to IIS 6 on Windows Server 2003 (only .NET framework 3.5 installed). I set the application to run in ASP.NET 2.0 and no extra stuff. Because I just wanted to see what sort of error would occur. And as expected, some error was reported as following.
Then, I set the Copy Local attribute of System.Web.Mvc assembly to true as following and deploy again.
As a result, the application ran smoothly.
I had read tons of materials talked about the mess of deploying MVC application on IIS 6. And I did fight to tackle the deploying issues in my previous project. At least, if had used Extensionless Url in your application, you should have configured wildcard mapping in IIS. But in this case, I even didn’t have chance to do so.
What the heck was going on exactly? Did I discover a new continent?
Perhaps your IIS is configured with a wildcard module mapping. With other words, the request path ".*" is being send to the asp.net ISAPI module.

How do I get an ASP.Net MVC application running on my host?

Is there something special you usually have to do? I have a DailyRazor .Net Starter account, but it won't run my MVC app. Any ideas?
I have contacted support but they said it should work, but it's not... Thought maybe someone here could help me faster.
I've been through this with Gearhost.
Your host needs to install the following on your IIS server:
ASP.NET 3.5 SP1
ASP.NET MVC 1.0
They need to enable the following settings:
If it's running IIS 6 on Windows 2003:
Enable Wildcard Mappings: (1), (2)
If it's running IIS 7 on Windows 2008, then you don't need to do anything.
Edit:
Regarding your Linq error; that means they probably don't have the correct version of the .NET Framework installed. I'd open a ticket and ask them. If they seem unwilling to help or to upgrade your server, there are plenty of hosts that will, and I can make recommendations if you'd like.
It sounds like the host does not have the latest version of the .net framework installed (3.5) , or if they do, your web application is perhaps set up to use an older version of asp.net.
Also, if they happen to be running on IIS6, there are a few extra steps they may have to do:
http://haacked.com/archive/2008/11/26/asp.net-mvc-on-iis-6-walkthrough.aspx
Try copying the MVC assemblies (System.Web. Abstractions, MVC, and Routing) to your Bin folder.
In reference to your error, you can try adding the System.Linq dll to your bin folder to see if that gets rid of that error. Does your host have .NET 3.5 installed?
You need to copy System.Core.dll to your Bin folder.
Alternatively, ask DailyRazor to install .Net 3.5. (They might not listen, though)

Resources