Unable to deploy web app from Visual Studio - visual-studio

I'm trying to deploy an Azure web app using Visual Studio, but am receiving the following error. I've deployed this app and many others without problems in the past.
Web deployment task failed. ((5/3/2016 9:40:16 PM) An error occurred when the request was processed on the remote computer.)
(5/3/2016 9:40:16 PM) An error occurred when the request was processed on the remote computer.
An error was encountered when processing operation 'Create File' on 'D:\home\site\wwwroot\ApplicationInsights.config'.
The error code was 0x80070013.
The media is write protected.
at Microsoft.Web.Deployment.NativeMethods.RaiseIOExceptionFromErrorCode(Win32ErrorCode errorCode, String maybeFullPath)
at Microsoft.Web.Deployment.FileStreamEx.CreateInstance(String path, FileMode fileMode, FileAccess fileAccess, FileShare fileShare, Nullable`1 fileLength)
at Microsoft.Web.Deployment.FilePathProviderBase.Add(DeploymentObject source, Boolean whatIf)
I'm getting the error on all my web apps, what could be wrong?

I've been deploying different types of Web Apps to Azure quite frequently (without any issues) so maybe I can suggest some steps to troubleshoot your scenario.
First of all, make sure you have the latest updates for your version of Visual Studio. If you don't have VS2015 yet, get the free Community Edition of VS2015 to try kit out.
Try deploying a brand new project right after clicking File | New | Project.
Try deploying using multiple methods: Publish menu, FTP, continuous deployment via source control.
Try creating a new Web App in a different pricing tier and/or a different region.
Hopefully, you'll get it to work trying one or more of the above suggestions, and then report back here about what worked and what didn't. Feel free to ask any follow-up questions any particular step that you may need help with.
Best of luck!

Adding to #Shahed, sometimes, if you are updating a Web App through Visual Studio Publish, it might fail if some file is being used by a running process. I found out that if I Restarted the Web App on the Portal, the VS Publish worked like a charm.

Related

Publish From VS to Azure Gives Generic Error

Until recently, I had a web solution that I could publish to my Azure webservice from VS2019 without issues. I just got a new PC, and now I get an error message even though the publish seems to work. Something's erroring, but I can't figure out what. I've tried on both VS2019 and VS2022.
When I publish, I get the following error in VS:
An error has occurred
Publish has encountered an error. We were unable to determine the cause of the error. Check the output log for more details.
There are no errors in the output window. In fact, the Output window says "Publish Succeeded" and "Web App was published successfully." And if I look at the live website, it does indeed have my changes.
The fact that there's an error is concerning though, and I don't know how to find more details. I'm worried something in the process isn't completing successfully. Normally VS opens the live website in Chrome after successfully publishing, but it doesn't do so in this case.
What might be the problem? Or what logs can I look at to view more info about the problem?
To check the recent releases of VS 2019 & VS 2022, created the web apps and published to Azure App Service - worked successfully:
Earlier, I also faced similar kind of issues when publishing the Azure Functions Projects, Web Applications to the Azure Services where I has observed the few things to recheck and publish again. Those worked for me every time when I got up these issues.
And When I got this error, it will show the path (like C:\Users\Hari\AppData\Local\Temp\tmp5775.tmp to see diagnostic log which doesn't help me much.
Check the below Steps to find the root cause of that error:
Check your .csproj framework version is same in the Properties of the project on VS IDE.
Update the VS IDE either 2019 or 2022 to the latest release > Clean the Solution > Rebuild > Run Locally > Publish to Azure.
The Priority cause for this error is VS IDE Timeout limit on the release mode. If the internet speed is poor or unstable or Server is slow or Server timeout, then this issue will occur most probably.
Even if the project size is large and if the VS IDE takes more time in release mode, then also there might be a chance of this error occurrence.
Still if the issue persists, raise the ticket in GitHub Repository of Azure App Service-VSIDE

Unable to Launch IIS Express Web Server - VS 2015 Community

I am developing a web project and I am not being able to test it using the IIS Express from the Visual Studio 2015.
I have googled this error and I found many references to it on the internet, but I believe that my case is different, because there is no other error message displayed besides "Unable to Launch IIS Express Web Server".
I've looked at the Windows Event Viewer and I got these errors below:
The worker process failed to initialize correctly and therefore could not be started. The data is the error.
The Module DLL C:\Program Files (x86)\IIS Express\aspnetcore.dll failed to load. The data is the error.
I also tried to launch the IIS Express directly using: c:\Program Files (x86)\IIS Express>iisexpress.exe /trace:error and I was successfull, so I think that the problem must be somewhere within Visual Studio and that my port (8080) is free.
Does anyone knows what else I can do?
If you are working with .NET core/ASP.NET core application then
please make sure you have installed these-
.NET Core SDK
VS 2015 Tooling Preview 2
If it is appeared to be solution-specific then-
Look for applicationhost.config file at <solution-name>\.vs\config\applicationhost.config location
Try removing this file and run solution again.
See if this helps.
I had the same error few days ago. I tried many things but i think Repairing DotNetCore.1.0.0-VS2015Tools.Preview2.exe fixed the issue.
Also, check whether you can run the web app in Kestrel web server. If you can run then worth checking web.config file for the presence of aspnetCoreModule tag properly.
This link might be helpful -- https://github.com/aspnet/Home/issues/1583

Publish from TFS 2013 to WebSite IIS : Failed with no error

At my company, we have received Team Foundation Server 2013 and Visual Studio 2013 to manage our code and deployment.
I'm trying to make it work but I can't figure out what I miss.
So here is the scenario :
I have a Web Application with no DB for the moment.
It's added to TFS and I have checked in everything.
There is a Build Controller on TFS.
On the Web Server, Web Deploy is installed and Management Services is there and allow remote management. The services are running. I have create a website but the folder with the source is empty for now.
My objective is to build on TFS and deploy from there in one single operation with the build definition.
Here is my problem, the build is working fine and everything is put in the drop folder. But it deploy nothing on the webserver and It raised no error on the build.
I tryied two techniques for the MSBuild arguments:
1) I create a publish profile in VS, when I publish from there it works but with this argument it does nothing:
/p:DeployOnBuild=true;PublishProfile=PublishIGU
2) I use this argument :
/p:DeployOnBuild=True /p:DeployTarget=MsDeployPublish
/p:MSDeployServiceURL=https://{serverWeb}:8172/msdeploy.axd
/p:DeployIISAppPath=IGUDEV /p:MsDeployPublishMethod=WMSVC
/p:AllowUntrustedCertificate=True /p:UserName=DOMAIN\user
/p:Password=XXXXX
And... it still does nothing.
I read a lot on the internet and follow tutorials but I can't figure this out.
Like I don't have any error message I don't know where to start.
Thank you if you see something that could help me.

Web Deploy Type Access Failures

I have an ASP.NET web application that formerly published just fine to several locations. Now when I try to publish or package the application from Visual Studio, regardless of method (i.e., through the Build menu, through One-Click Publish, or the project's context menu), the operation fails with the following error:
Web deployment task failed. (Attempt by method 'Microsoft.Web.Publishing.Tasks.VSMSDeployDriverInCmd.LogTrace (Microsoft.Web.Deployment.DeploymentTraceEventArgs)' to access type 'Microsoft.Web.Deployment.DeploymentSyncParameterEventArgs' failed.)
Which doesn't give much guidance on how to fix it. I have reinstalled Visual Studio and Web Deploy to no avail. Tried disabling and even uninstalling my Visual Studio plugins - nothing.
Can someone give insight into the cause of this message and how to fix it? Or at least how to diagnose what the real problem is?

Sharepoint project crashes when deploying

I got a lot of projects for Sharepoint which all work fine instead of one. This project can only deployed by one developer of our team, all other devs keep getting an exception when trying to deploy that solution (building that solution works). (Both via Project, RMB in VS)
The error message is:
Error 1 Error occurred in deployment step 'Retract Solution':
A communication error has occurred while invoking commands in SharePoint host process:
The communication object, System.ServiceModel.Channels.ServiceChannel,
cannot be used for communication because it is in the Faulted state.
I enabled logging in VS, but did not find any interesting stuff. Starting in /safemode did not help either. I also deleted the suo-file and all bin, obj and pkg-folders before deploying.
Any idea what went wrong?
(I did see the "Deploying Sharepoint 2010 Webpart crashes Visual Studio" topic but that was something different)
Do iisreset and redeploy the project again .Application pool might be stopped sometimes causes this kind of error.

Resources