Take my site/app offline during publishing
Currently when I publish my site/app it stay's online. It would be better to drop an app_offline.htm during publishing so that my app doesn't behave in a funky fashion.
Just wanted to let you know that we are considering adding support for this in a future version. For those of you who are interested in a work around for the short term I have posted a blog on this at http://sedodream.com/2012/01/08/HowToTakeYourWebAppOfflineDuringPublishing.aspx.
13 comments
-
Tlptr Tlp
commented
bu hatayı cözemiyorum
-
Tlptr Tlp
commented
Server Error in '/' Application.
The view at '~/Views/Home/Index.aspx' must derive from ViewPage, ViewPage<TModel>, ViewUserControl, or ViewUserControl<TModel>.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: The view at '~/Views/Home/Index.aspx' must derive from ViewPage, ViewPage<TModel>, ViewUserControl, or ViewUserControl<TModel>.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[InvalidOperationException: The view at '~/Views/Home/Index.aspx' must derive from ViewPage, ViewPage<TModel>, ViewUserControl, or ViewUserControl<TModel>.]
System.Web.Mvc.WebFormView.RenderView(ViewContext viewContext, TextWriter writer, Object instance) +180
System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer) +107
System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +291
System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult) +13
System.Web.Mvc.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() +23
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +264
System.Web.Mvc.<>c__DisplayClass1e.<InvokeActionResultWithFilters>b__1b() +20
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +176
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() +8836913
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +184 -
Lokesh
commented
would definitely make deployment easy
-
Linda Mickelberry
commented
Absolutely
-
Gareth Bradley commented
Definately a good idea.
-
@Bert in the next version of Visual Studio you will be able to create a transform based on the publish profile. So if you have a publish profile named "TestEnv" then if a web.config transform with the name web.TestEnv.config exists it will be invoked.
-
Bert
commented
I agree. Another suggestion is to be able to link a Configuration with a publishing Profile. In our environment, I use Web.config transformations to change the application database. I then always publish the Test configuration to the test server and the Production configuration to the Production server. With the current WebDeploy I have to make sure that I choose the proper Configuration in the IDE before I publish.
-
RyanCEI
commented
Definitely
-
niksmit
commented
Agree
-
Tien Do
commented
Agree, I also want this feature in next version of MSDeploy.
-
Chris Hurney
commented
Agree with Benjamin Howarth
-
@Benjamin, I agree. I'm thinking that if there was a file named app_offline-template.html (or smtg similar to it) and that is the one which gets converted to app_offline.htm. If there is none then just drop an empty file for the default message.
-
Benjamin Howarth commented
It would be brilliant to be able to provide a project-specific app_offline.html, that way if you're using WebDeploy to manage multiple sites on different servers, you can maintain any "brand consistency" while any individual site is offline.