i tried to look around but i did't find a solution.
I have a web space on aruba and i want to publish the default mvc 4 internet website (you know...home, about, contacts).
I tried to publish but it dont't work.
I read about putting .aspx (useless cause no aspx pages here) or .chstml (i tried) on the route config, but nothing happend. Always HTTP Error 403.14
Does anyone tried to publish an mcv 4 website on aruba? What changes do i have to do?
I'm using Windows 2008 Hosting with, with ASP.NET 4 and Classic Pipeline
If you referring to Aruba.it hosting solutions, they doesn't support mvc projects..
Look at there Windows hosting solution
It support asp.net not asp.net mvc...
If they were support it they would have wrote it
If ASP.NET works for you, you can bundle the MVC dll's with your project (so that theres a System.web.mvc.dll in your project's bin folder.
And it should just work.
Aruba supports Mvc4. You just have to remember to publish all the dll as told by Mvison (so mvc dll, sql ce dll, and so on) and also give the write permission to that folder, otherwise they won't allow them to run (think it's a safety policy)
Related
We have a website that was written in classic ASP, then I started to extend it using web forms. These extensions exist in a subfolder of the main folder. Now we've decided we'd prefer to use MVC3. Also, as we'd like to convert all our site to MVC3 over time, we are hosting the MVC code in the application root. I've found some other questions where people have a similar issue to mine, but no solution. The issue is simply that my web forms app can't seem to be stopped from inheriting the web.config settings from the root folder, and as a result, it won't run, it either complains about missing dlls, or complains about running the wrong version of .NET, or complains I need to remove some settings ( which I try and can never get to work right ). The app in the subfolder is also hosting a webservice that is called by our application, and it also runs HTTP handlers to protect our imaging content, so it's got a bit of stuff in it. Do I need to run my MVC site in a subfolder ? Is there any way to have MVC in the folder above a web forms app ? I'd prefer to set things up so they share session data, but that's looking likely to be impossible at this stage...
So to be clear the folder structure is:
<root>
contains asp site and MVC site.
<subfolder>
contains webforms application
</subfolder>
</root>
and my issue is getting the subfolder to run, preferably in the same session as the MVC app.
There is no reason you can't run regular .aspx files on an MVC site. You are correct though, web.config settings are inherited from the parent (chain), but you just add a new web.config in your directory with relevant settings.
What you will have to do is play with the routes, because by default MVC will route all requests into your controller classes. But if you google around its fairly simple to add an exception to the routing.
If you post some of the specific errors we can probably help further.
Oh and do you mean Classic ASP? i.e. not Classic ASP.NET? Because you'll have fun sharing session data between ASP & ASP.NET.
I think, this is quite common situation nowadays, so its surprising, that I have troubles finding nice and clean solution for it (even here at SO).
I have my ASP.NET MVC3 web application using Entity Framework 4.1 with code-first approach (using DatabaseInitializer to seed default data). I also tried two database options: SQL Express 2008 R2 and SQL Compact 4. Everything is working fine on local.
Now I want to host my app so I found hosting (middle one called 'optimal') and finally (after some issues) got into state, where I am getting medium-trust error (I believe).
The application attempted to perform
an operation not allowed by the
security policy. To grant this
application the required permission
please contact your system
administrator or change the
application's trust level in the
configuration file.
Let's take as fact that I can't configure that hosting any way and I do not think, that they are going to switch me to full-trust.
What do I have to do, to make my application work on medium-trust hosting?
Edit: I have found some answers that are usually propagating setting medium trust at local dev and just do it like that, so my question could now be something like:
What are "top 5 reasons" why your ASP.NET MVC3 EF 4.1 app won't work at medium-trust?
Edit: I have added bounty to this becuase I would like to see some discussion.. or at least more oppinions/experiences, containing more than just "set medium trust at local dev". Maybe there is nothing to discuss here, but I am just curious because I already spent more time on this than I would like.
I've seen other people complain of the same error when the server did not have .NET 3.5 Service Pack 1 and were able to work around it by putting the DLLs in their bin folder.
There's also a little more info here about a few things to check:
log4net throwing Security Exception in ASP.Net MVC web application
Do you have the latest EF Code First library? Everything before the RC was not medium trust compatible.
If you are going to use SQL CE 4, it is medium trust compatible but did you deploy the SQL CE database engine files?
Are you sure your problem is EF Code First? AKA - Have you tried just deploying a simple MVC site first and getting it running? Here's an article on setting up MVC in medium trust and another on bin deploying MVC3 for hosts who aren't running/supporting MVC3 yet.
I apologize for the vague title - I am new to ASP.NET MVC coming from PHP, and I have teamed up with a .NET developer that has a webforms background.
When working with MVC in PHP, all of my files are visible on the server - that is to say, I can go into any of my model, view and controller files and edit any of the code remotely without a problem.
In .NET MVC, I couldn't find the controller or model files, so I asked the developer how the webpage is being put together, and he told me about how .NET compiles code into .DLL files and that I am unable to access this. I wanted to view a controller to see how it was pulling together my views, but didn't even see a controller folder on the server.
To me, something about this doesn't sound right, but I am not sure because of my lack of experience in .NET. Can someone provide input as to if this is the typical .NET scenario, and if not, what is he doing wrong? Should I take this as a red flag? Keep in mind that .NET MVC is new to both of us.
Thanks!
There is no code files because these code files was compiled into DLL files during Publish process. It's not strange - it's even better because of performance reasons. It's common scenario for all ASP.NET and ASP.NET MVC applications.
You can deploy yor application via XCopy deployment (to have all .CS files etc.): simply copy all files to destination folder. Then your site will be compiled (into App_temp destination) by runtime on first run. Your .CS files will still be in place.
You can read more about Publishing procees here:
Walkthrough: Publishing a Web Site
Publishing Web Sites
I was lead to believe that MVC apps were BIN-deployable, so could be deployed to any ASP.net 3.5 compatible server. I'm trying to deploy to a Windows Server 2003 x64 with 3.5 (no SP1) and am having trouble getting it working.
I get the following when hitting the homepage, which redirects to the /Account/LogOn view due to our app config.
The page cannot be found
I've got the three (plus Extensions, I can't remember why) MVC dll's set to Copy Local, so they end up in the bin-folder. I'm publishing and then copying over the app to the server:
System.Web.Abstractions.dll
System.Web.Mvc.dll
System.Web.Routing.dll
System.Web.Extensions.dll
Does anyone know what I'm doing wrong? The app works on another machine we have with 3.5 SP1, and on development machines, also SP1 and with MVC installed.
I've gone over everything I can think of, ensured the permissions are correct, etc.
IIS 6 does not handle .mvc extensions correctly. Among other things you have to map .mvc to the ASP.NET handler. Here is a walkthrough for you: http://haacked.com/archive/2008/11/26/asp.net-mvc-on-iis-6-walkthrough.aspx
Have you set up wildcard mapping on the server that does not work? See "Deploying ASP.NET MVC to IIS 6" for an example. You basically need to map all requests to the ASP.NET ISAPI DLL and tell IIS not to try to verify that the file exists. Don't know if that's your issue, but it has bitten me a few times in deployments.
With IIS6, you can't do extensionless URLs like /Account/LogOn. You have to do something like /Account.aspx/LogOn The ".aspx" can really be almost any arbitrary extension, but you need that extension. Your routes need to take the extension into account as well.
Check to make sure the app pool your site is running under is configured to run ASP .Net 2.0, sometimes it defaults to 1.1 which causes issues similar to yours.
I'm struggling to get around the 404 errors from asp.net mvc beta when deploying on IIS 6. I had this working in one of the previews by mapping .mvc in IIS but this no longer works. I've read Omar's post and several others on the web and tried their solutions but no luck so far.
The home page opens without a problem on IIS 6 but others 404 and the site runs well on IIS 7.
Has anybody deployed asp.net mvc beta to IIS 6 with success? If so, what adjustments did you need to make to the code and/or IIS settings to get it to work?
I found a solution to my problem from Steve Sanderson's blog (Thanks Steve):
Use a wildcard mapping for aspnet_isapi.dll. This tells IIS 6 to process all requests using ASP.NET, so routing is always invoked, and there’s no problem. It’s dead easy to set up:
open IIS manager (run -> inetmgr -> OK)
right-click your app, go to Properties
then Home Directory tab, then click Configuration.
Under Wildcard application maps, click Insert (not Add, which is
confusingly just above)
then enter
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll for
“Executable”, and uncheck Verify that file exists.
I can't seem to write comments yet. So I'll write a new answer.
There are a few similar questions going around on stackoverflow.
I'm using MVC 3. I know the question was MVC 2 related. But since this is the first stackoverflow post I bumped in to, I think it's worth mentioning that:
when you use MVC 3, you need to add a new extension mapping with the executable of the .NET 4 framework (C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll)
<edit>I just found out that I even don't need to set up the extension mapping. </edit>
It still didn't work for me then :) I still had to 'Allow' ASP.NET v4.0.30319 in the Web Service Extensions section in IIS:
open IIS
click on the server node
open the Web Service Extensions section
select the ASP.NET v4.0....
right click --> Allow
Good to go!
Url rewriting can help you to solve the problem. I've implemented solution allowing to deploy MVC application at any IIS version even when virtual hosting is used.
http://www.codeproject.com/KB/aspnet/iis-aspnet-url-rewriting.aspx