Archived Support Site

This support site is archived. You can view the old support discussions but you cannot post new discussions.

Problem deploying from cli

mjmoore's Avatar

mjmoore

08 Mar, 2016 01:23 AM

I am attempting to do a deploy using the AppHarbor cli and get the following error. Other than disabling precompilation, is there any way to resolve?

Microsoft (R) ASP.NET Compilation Tool version 4.0.30319.33440
Utility to precompile an ASP.NET application
Copyright (C) Microsoft Corporation. All rights reserved.

D:\temp\xtsjslnr.quc\output_PublishedWebsites\WebMatrixWebsite\obj\release\csautoparameterize\original\web.config(37): error ASPCONFIG: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.

[ConfigurationErrorsException]: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS. (D:\temp\xtsjslnr.quc\output_PublishedWebsites\WebMatrixWebsite\obj\release\csautoparameterize\original\web.config line 37) at System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(Boolean ignoreLocal) at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject) at System.Configuration.BaseConfigurationRecord.GetSection(String configKey) at System.Web.Configuration.RuntimeConfig.GetSectionObject(String sectionName) at System.Web.Configuration.RuntimeConfig.GetSection(String sectionName, Type type, ResultsIndex index) at System.Web.Configuration.RuntimeConfig.get_Compilation() at MTConfigUtil.GetCompilationConfig(String vpath) at System.Web.Compilation.WebDirectoryBatchCompiler..ctor(VirtualDirectory vdir) at System.Web.Compilation.BuildManager.BatchCompileWebDirectoryInternal(VirtualDirectory vdir, Boolean ignoreErrors) at System.Web.Compilation.BuildManager.BatchCompileWebDirectory(VirtualDirectory vdir, VirtualPath virtualDir, Boolean ignoreErrors) at System.Web.Compilation.BuildManager.PrecompileWebDirectoriesRecursive(VirtualDirectory vdir, Boolean topLevel) at System.Web.Compilation.BuildManager.PrecompileWebDirectoriesRecursive(VirtualDirectory vdir, Boolean topLevel) at System.Web.Compilation.BuildManager.PrecompileWebDirectoriesRecursive(VirtualDirectory vdir, Boolean topLevel) at System.Web.Compilation.BuildManager.PrecompileWebDirectoriesRecursive(VirtualDirectory vdir, Boolean topLevel) at System.Web.Compilation.BuildManager.PrecompileWebDirectoriesRecursive(VirtualDirectory vdir, Boolean topLevel) at System.Web.Compilation.BuildManager.PrecompileWebDirectoriesRecursive(VirtualDirectory vdir, Boolean topLevel) at System.Web.Compilation.BuildManager.PrecompileAppInternal(VirtualPath startingVirtualDir, IEnumerable1 excludedVirtualPaths) at System.Web.Compilation.BuildManager.PrecompileApp(VirtualPath startingVirtualDir, IEnumerable1 excludedVirtualPaths) at System.Web.Compilation.BuildManager.PrecompileApp(ClientBuildManagerCallback callback, IEnumerable1 excludedVirtualPaths) at System.Web.Compilation.BuildManagerHost.PrecompileApp(ClientBuildManagerCallback callback, List1 excludedVirtualPaths) at System.Web.Compilation.BuildManagerHost.PrecompileApp(ClientBuildManagerCallback callback, List`1 excludedVirtualPaths) at System.Web.Compilation.ClientBuildManager.PrecompileApplication(ClientBuildManagerCallback callback, Boolean forceCleanBuild) at System.Web.Compilation.ClientBuildManager.PrecompileApplication(ClientBuildManagerCallback callback) at System.Web.Compilation.Precompiler.Main(String[] args)

Website precompilation failed with exit code 1. Precompilation can optionally be disabled in your AppHarbor application settings

  1. Support Staff 1 Posted by rune on 08 Mar, 2016 04:07 AM

    rune's Avatar

    Hi,

    It looks like you were able to figure this one out in the meantime?

    I've followed up your other request regarding the C# 6.0 language features and compilation -- while the CLI deploy approach might work it's likely preferable in the long run if we can fix the build issues and let AppHarbor handle that part (as this is generally a lot safer, integrates better with version control and unit tests while ensuring that the application defines exactly the dependencies and files required to build and run).

    Best,
    Rune

  2. 2 Posted by mjmoore on 08 Mar, 2016 05:40 AM

    mjmoore's Avatar

    I agree that it would be best to not have to use the CLI deploy approach, I was exploring it as a backup alternative in the event that I couldn't get the normal Appharbor build process to work.

    regarding this approach, I did not resolve the problem with the precompilation errors, I just diabled precompilation in the AppHarbor settings. While this approach did allow me to get the app deployed, not being able to precompile the views really slow down the initial loads of the views. Is there a way to enable precompilation and allow the deploy to take place?

  3. Support Staff 3 Posted by rune on 08 Mar, 2016 04:40 PM

    rune's Avatar

    Hi,

    Just to make sure I'm understanding you correctly -- it's only when you're trying to deploy with the CLI that you experience issues with the precompilation, right?

    It's a bit curious why/how the application would work when deployed, but fail when being precompiled. The error message I saw on one of the builds was related to invalid configuration (configuration that isn't allowed at the web.config level). However the precompilation should match the runtime behavior, so I'm a bit curious to see a build where this is occurring. If you could point me to a build that can be deployed but not precompiled I'd be happy to take a closer look and see if anything sticks out!

    Best,
    Rune

  4. 4 Posted by mjmoore on 08 Mar, 2016 04:53 PM

    mjmoore's Avatar

    Yes, the problem with that this thread is referencing only applies to deploying from the CLI.

    The error shown in the first post of this thread is associated with commit 17b47710. Following getting this error I changed the precompilation setting on the app at AppHarbor and re-deployed from the CLI (commit bf7804f6). That deploy completed successfully, with no error. Nothing was changed in the code between the two commits. The only change was to the AppHarbor precompilation setting.

  5. Support Staff 5 Posted by rune on 11 Mar, 2016 12:37 AM

    rune's Avatar

    Hmm ok, that is fairly odd. Sounds like it's all good now, but if you ever see this issue again please don't hesitate to reach out!

    Best,
    Rune

  6. rune closed this discussion on 11 Mar, 2016 12:37 AM.

Discussions are closed to public comments.
If you need help with AppHarbor please start a new discussion.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac