Web deployment task failed with configuration: debug - azure

I get the following error:
Web deployment task failed. (Could not complete an operation with the specified provider ("appHostConfig") when connecting using the Web Management Service. This can occur if the server administrator has not authorized the user for this operation. appHostConfig http://go.microsoft.com/fwlink/?LinkId=178034 Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_USER_NOT_AUTHORIZED_FOR_DEPLOYMENTPROVIDER.)
When I try to publish my project to Azure with "Configuration: Debug". If I use "Configuration: Release" there are no problems.
I have tried deleting and recreating the Azure website and re-installing the SDK.
I followed a tutorial to setup Azure so I think it is unlikely that I setup something wrong.
I've googled around and found people with a similar error however they don't seem to have a relation to the Debug/Release configuration...

It did worked!
But, just for making things easier, you can right-click in your project, and at properties, go to Package/Publish web and Unckeck the option
"Inculde IIS Settings as configured in IIS Express"
Remember (important!) you are in the right configuration (combo at the top) Release/Debug you are trying to publish.

I got the same error ERROR_USER_NOT_AUTHORIZED_FOR_DEPLOYMENTPROVIDER in VS2013 while deploying to Windows Azure Websites (WAWS) and nothing nowhere to find to fix it.
It just so appears that my project deploys just great again after comparing the project file with a brand new one and finding the following difference, which I commented out to get it working again:
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<!--<IncludeIisSettings>true</IncludeIisSettings>-->
</PropertyGroup>
So, right click the project and click Unload Project, right click it again and click Edit project.csproj and find the PropertyGroup with the condition matching whatever you're trying to deploy (Release|AnyCPU in this case) and make sure that line is commented out.

Related

EscapeTextForRegularExpressions error while webdeploying to azure

In my asp.ent MVC4 project, I am using webdeploy to deploy to azure and I deployed this project to the app service on azure several times before. but out of a sudden I have this error.
"EscapeTextForRegularExpressions" task was not given a value for the required parameter "Text"
I Have found an answer:
Add this file into the web project in its root folder.
File Name : *.wpp.targets
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<ExcludeFromPackageFolders Include="Internal">
<FromTarget>*.wpp.targets</FromTarget>
</ExcludeFromPackageFolders>
</ItemGroup>
</Project>
Never the less I cannot understand the real cause of the problem
According to your description, I found a similar issue noted the IncludeIisSettings within *.csproj. Per my test, if I specified the <IncludeIisSettings>true</IncludeIisSettings> with my csproj, then when I use the Web Deploy method from the Publish wizard of VS, I could encounter the similar issue as follows:
After remove the IncludeIisSettings or set the value to false, then I could deploy my web application to azure web app successfully.
I have another answer maybe can help someone:
You must open the Solution explorer then right-click the project, select properties, on Package/Publish Web check your Configuration is on Release and not on Active (Debug) in the drop-down, this was the solution in my case.

Error WAT200: No default service configuration "ServiceConfiguration.cscfg" could be found in the project

After installing Visual Studio Enterprise 2017 (Version 15.1 (26403.7)) my Azure Cloud Service does no longer build and gives me the 'Error WAT200: No default service configuration "ServiceConfiguration.cscfg" could be found in the project'. Although it still works fine with Visual Studio Enterprise 2015. (The right TargetProfile is also specified...)
I ran into this last night.
It actually happens when you rename Cloud Service configurations away from Cloud and Local.
In my case, I had deleted the Cloud configuration and created a new, differently named one.
By ensuring that the configurations are called Cloud and Local, the Cloud Service projects will build again using "Resharper build", and (most likely) under "Lightweight solution load".
The configurations can be renamed by right-clicking one of the service roles under the Cloud Service node in Solution Explorer, choosing Properties, then opening up the "Service Configuration" dropdown and clicking <Manage...>.
Now, in the resulting dialog, the configurations can be renamed:
The following bug report got me on the right track:
https://youtrack.jetbrains.com/issue/RSRP-450390
The best way is to change the service configuration prefix in ccproj of your project, add yourprojectname.configurationname
Dot is the life saver.
<ServiceConfigurationPrefix>yourproject.ServiceConfiguration</ServiceConfigurationPrefix>
Add these in itemgroup:
<ServiceDefinition Include="yourproject.ServiceDefinition.csdef" />
<ServiceConfiguration Include="yourproject.ServiceConfiguration.cscfg" />
Make sure you have renamed your cscfg files from the folder it resides.
Reload
Bingo. It works.
Ok I found it, after disabling the 'Lightweight Solution Load' (which in VS 2017 u can disable by right click on the Solution and then Disable Lightweight Solution Load), the error disappears and the Cloud Service builds again.
Similar to Rishikesh mentioned, but I added a service config entry
<ServiceConfiguration Include="ServiceConfiguration.cscfg" />
to the ccproj. Then copied a configuration, e.g. Production and named it ServiceConfiguration.cscfg. Then reloaded the project. That got the ReSharper to build, but MORE importantly for me at the moment was to figure out how to the get Azure DevOps pipeline to build the solution with multiple Classic WebRole projects in it. That was failing for the SAME reason.

How to take web app offline while publishing?

Very often, when I hit Publish in VS13, I get the site to compile but when uploading I get the error saying that a file is busy.
Updating file (MyAzureSite\PrecompiledApp.config).
C:...\v12.0\Web\Microsoft.Web.Publishing.targets(4255,5):
Error ERROR_FILE_IN_USE: Web deployment task failed.
(The file 'PrecompiledApp.config' is in use.
Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_FILE_IN_USE.)
When I follow the link provided, it's suggested that I should go for enabling the appOffline rule. "Sure!", I think to myself. But how?! I've googled it, only to get a bunch of hits on the file that's supposed to replace the site while publishing. However, I get no info on how to get rid of my little problem.
I went the easy way and downloaded a publishing profile from my Azure web site and now I'm using it (you know, ALT+B+H).
Right now I resolve the problem by going to the portal for Azure and manually take the site off-line. Then I can publish and after that I take the site on-line. Highly impractical and painfully tedious.
What is causing this and how do I kill it?
You actually configure it in the publishing profile (.pubxml). Just add the element to the PropertyGroup like this:
<PropertyGroup>
<EnableMSDeployAppOffline>true</EnableMSDeployAppOffline>
...
</PropertyGroup>
More in this MSDN document
The Azure App Service Deployment Task has a checkbox for this (from version 2.0 onwards), under Additional Deployment Options: Take App Offline. Check that and you should be good to go.
Take Application Offline: Select the option to take the AzureRM Web App offline by placing an app_offline.htm file in the root directory of the Web App before the sync operation begins. The file will be removed after the sync operation completes successfully.
Screenshot:

How can I stop Visual Studio's Web Publish from removing write permissions from my target web site?

I have a web app (actually Orchard CMS) that I am customizing and I want to push directl from my build server to my hosting provider, using Web Publishing aka MSDeploy.
The problem is, when I publish the site (from Visual Studio, haven't tried it from the build server yet) it removes the write permission from the target web site, which makes Orchard instantly fall over because it can no longer access its database (etc).
We can debate the wisdom of this, but the bottom line is that Orchard requires write access, and web publishing insists on removing that access, which breaks the site. Not good. I have to log in to the service provider's control panel and reset the permissions each time I publish, which kind of makes the process less than automatic.
So, how do I get Web Publishing to leave the ACLs alone? I can't find any settings for this in the solution anywhere.
You can add turn off the ACL setting functionality by adding this to the .pubxml file:
<IncludeSetACLProviderOnDestination>False</IncludeSetACLProviderOnDestination>
See http://msdn.microsoft.com/en-us/library/ff398069.aspx
The article also mentions you can change this for all publish configurations via a local .wpp.targets file. Make sure to consider that option if you use multiple publish configurations
In some cases you may find that after publishing a project using Web Deploy the ASPNet IUSR cannot write to the root directory or any files within it (except App_Data).
By default Web Deploy sets the ACL of the ASPNet IUSR to read only. To prevent this from causing problems when you publish your application, you will need to locate the project file and make some changes. The project file will end with the extension .vbproj for applications written in Visual Basic or .csproj for applications written in C#. In the project file find:
<propertygroup condition=" '$(Configuration)|$(Platform)' ==
'Release|AnyCPU' "></propertygroup>
and change it to:
<propertygroup condition=" '$(Configuration)|$(Platform)' ==
'Release|AnyCPU' ">
<includesetaclproviderondestination>False</includesetaclproviderondestination>
</propertygroup>
This will ensure that ACL is not modified by Web Deploy.
If you already deployed to a 3rd party hosting provider, you may need to contact them to get your permissions reset before doing another deployment.

AjaxControlToolkit.dll not working on windows azure

Following dlls are not working when I deploy my asp.net application in azure:
1. DropDownCheckBoxes.dll
2. AjaxControlToolkit.dll
They work perfectly in the non-cloud application deployed on the server as well as local.
Any thoughts?
Could you explain why you think these assemblies are not working in Windows Azure? Are you having issues in a web role or in a web site?
Most issues occur because the assembly is not included in the package. Could you try the following for both assemblies:
Right click the assembly
Select Properties
Change Copy Local to True
Redeploy the application.
Checked the "Remove additional files at destination" checkbox when publishing it to Azure and it will work. I had the same problem, none of the other solutions work. Here is the thread I found the solution in also, so simple but who would've known! Also I did not have to uninstall and re-install, all I did is check the checkbox during publishing:
[http://social.msdn.microsoft.com/Forums/windowsazure/en-US/e29cc03b-c822-4ba9-b044-51107c367848/ajaxcontroltoolkit-is-not-working-when-deployed-to-azure?referrer=http://social.msdn.microsoft.com/Forums/windowsazure/en-US/e29cc03b-c822-4ba9-b044-51107c367848/ajaxcontroltoolkit-is-not-working-when-deployed-to-azure?referrer=http://social.msdn.microsoft.com/Forums/windowsazure/en-US/e29cc03b-c822-4ba9-b044-51107c367848/ajaxcontroltoolkit-is-not-working-when-deployed-to-azure][1]

Resources