1

I am trying to deploy my MVC3 app on a shared host. I've got .Net4 on the shared host and I have worked through the various bin deploy steps cited all over the internet. The problem is that I don't get an error when I try to access the site, I just get a message saying directory browsing is not allowed. I have uploaded the files but its like the server doesn't know what to do when it gets there. I would appreciate any tips anyone has to give regarding this...I need to show a demo today.

Thanks !

Edit: So I managed to figure out that my host placed my account on a server running IIS6 and therefore cannot process extensionless urls, so I modified my routing table to append a .aspx to the controller name so that IIS can process the request. Now I get this error (which I guess has to do with EF4) when I try to access the url

Attempt by method 'System.Data.Entity.ModelConfiguration.Utilities.DbConnectionExtensions.GetProviderInvariantName(System.Data.Common.DbConnection)' to access method 'System.Data.Common.DbProviderServices.GetProviderFactory(System.Data.Common.DbConnection)' failed.
[MethodAccessException: Attempt by method 'System.Data.Entity.ModelConfiguration.Utilities.DbConnectionExtensions.GetProviderInvariantName(System.Data.Common.DbConnection)' to access method 'System.Data.Common.DbProviderServices.GetProviderFactory(System.Data.Common.DbConnection)' failed.]
   System.Data.Entity.ModelConfiguration.Utilities.DbConnectionExtensions.GetProviderInvariantName(DbConnection connection) +52
   System.Data.Entity.ModelConfiguration.Utilities.DbConnectionExtensions.GetProviderInfo(DbConnection connection, DbProviderManifest& providerManifest) +63
   System.Data.Entity.DbModelBuilder.Build(DbConnection providerConnection) +157
   System.Data.Entity.Internal.LazyInternalContext.CreateModel(LazyInternalContext internalContext) +51
   System.Data.Entity.Internal.RetryLazy`2.GetValue(TInput input) +117
   System.Data.Entity.Internal.LazyInternalContext.InitializeContext() +407
   System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType) +17
   System.Data.Entity.Internal.Linq.InternalSet`1.Initialize() +62
   System.Data.Entity.Internal.Linq.InternalSet`1.GetEnumerator() +15
   System.Data.Entity.Infrastructure.DbQuery`1.System.Collections.Generic.IEnumerable<TResult>.GetEnumerator() +40
   System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) +315
   System.Linq.Enumerable.ToList(IEnumerable`1 source) +58
   WebShop.Controllers.HomeController.Index() in C:\Users\owner\Documents\My Web Sites\WebShop\WebShop\WebShop\Controllers\HomeController.cs:18
   lambda_method(Closure , ControllerBase , Object[] ) +62
   System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +17
   System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +188
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +27
   System.Web.Mvc.<>c__DisplayClass15.<InvokeActionMethodWithFilters>b__12() +56
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +267
   System.Web.Mvc.<>c__DisplayClass17.<InvokeActionMethodWithFilters>b__14() +20
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +190
   System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +329
   System.Web.Mvc.Controller.ExecuteCore() +115
   System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +94
   System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +10
   System.Web.Mvc.<>c__DisplayClassb.<BeginProcessRequest>b__5() +37
   System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +21
   System.Web.Mvc.Async.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _) +12
   System.Web.Mvc.Async.WrappedAsyncResult`1.End() +55
   System.Web.Mvc.<>c__DisplayClasse.<EndProcessRequest>b__d() +31
   System.Web.Mvc.SecurityUtil.<GetCallInAppTrustThunk>b__0(Action f) +7
   System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(Action action) +23
   System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +59
   System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +8683441
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +184

Anyone know how I can sort this out? Thanks

Obi
  • 3,091
  • 4
  • 34
  • 56
  • 2
    which version of IIS is your host running? – Jason Jan 26 '12 at 17:07
  • Check these answers:- http://stackoverflow.com/questions/2374957/asp-net-mvc-on-iis-7-5 http://stackoverflow.com/questions/2659544/cant-run-asp-net-mvc-2-web-app-on-iis-7-5 – Paul Alan Taylor Jan 26 '12 at 17:08
  • Have you contact your provider? Whre do you host your site? I have some nice article for you, http://aspnetmvceuropeanhosting.hostforlife.eu/post/European-ASPNET-MVC-3-Hosting-Deploying-ASPNET-MVC-3-Application-on-Shared-Hosting-Environment.aspx. Have you deploy your files properly? –  Jan 27 '12 at 06:53
  • @Oliver Jansen I have contacted the provider and the fault isn't mine apparently. The application is not in integrated mode by default and there is no way to change it on the providers control panel so the provider is sorting that out...I need a new provider though, I can't do this everytime I decide to go MVC and their response time is crap! Thanks guys. – Obi Jan 27 '12 at 09:35
  • Then you can find another provider on Microsoft site, http://www.microsoft.com/web/Hosting/Home. And http://www.hostforlife.eu seems to be good choice. They are Mircrosoft partner too. You can find it on Microsoft site. I believe they have good support time and knowledgeable staff. Good luck. :) –  Jan 28 '12 at 02:43

1 Answers1

0

It's not enough to move files to the host, you have to tell IIS your files are an application. That's the most common reason for the directory browsing error. Your hoster should have help pages on deploying ASP.NET applications.

RickAndMSFT
  • 20,912
  • 8
  • 60
  • 78