Zip file error when releasing from VSTS to Azure Web App - asp.net-core

I have created release definition in VSTS that takes a built .net core 3.0 web apps and push the builds out to an Azure Web App. It worked for more than 6 months but recently fails on the deploy step.
Possibly unsupported ZIP platform type, 62
##[error]Error: Offset is out of bounds
Also I read this response. I checked the zip files in working directory and can decompress them.

I found it!
The Malware detection tool remove the published files.

Related

HTTP Error 502.5 - Process Failure asp .net core 5

I'm having problems visit my site on a browser and this is the error I'm getting (see pic). I'm able to open the project in cli with dotnet project.dll command, what I want is to open it in a browser (like: server.com\project). I published the project in a folder and I also chose self-contained deployment mode. I couldn't find a right solution to questions that were asked. I'm using .net core 5.
The most common reason for this is that you haven't installed the .NET Core runtime on the server.
Check the download page from here Download .NET 5.0 Runtime and SDK

VSTS Continuous Deployment of ASP.NET MVC Core 2.0 app to Azure Web Apps not deploying, no errors

No matter how many times I attempt to deploy my recently migrated ASP.NET MVC Core 2.0 app from VSTS CD, I only see old builds that were created before I migrated the project and VSTS CI build steps.
No error messages. Everything is making happy noises. However, I have the build number injected into the appsettings.json so I can see which build is in production, AND I've made several tiny aesthetic changes just to know for sure there's a new build of the software out on production and I am 100% confident the latest build is not being served.
I migrated my web app from ASP.NET MVC Core 1.1.2 to ASP.NET MVC Core 2.0.0. The last two successfully deployed 1.1 builds were #259 & #260.
I updated the VSTS build process using the "preview" 2.0 steps and got it producing successful builds. This new build is #270.
The VSTS release process reported no errors when deploying to Azure Web Apps Websites in a Staging slot.
I swap the slots without any errors.
However, I only see builds #259 and #260 as I try and re-try to re-release build #270 manually and re-swap the slots after VSTS CD gives me a successful response.
At this point, I'm considering going into Kudu and just deleting everything to force Azure Web Sites Web Apps to give me an obvious error message.
Before I do that, however, I wanted to ask if there's anything obvious I'm missing? Unlike the CI feature, VSTS CD has no verbose logging (AFAICT) and I can't locate any logging on Azure Web App's side regarding deployment attempts.
Here's a history of the builds ... all successful:
For context, here's the overall pipeline:
Here's the definition for Azure App Service:
Update 8/24 10am:
This morning, based on #starain-MSFT's comment, I did the following:
In Azure, I stopped both staging and production slots.
Back in VSTS in the release definition, in the "Azure App Service Deploy" task, I checked and yes, "Publish using Web Deploy" was already checked.
I added a checkmark to "Remove additional files at destination".
I created a new release (#110).
I check the logs for the "Deploy Azure App Service" release task:
2017-08-24T14:53:01.7169084Z ##[section]Starting: Deploy Azure App Service
2017-08-24T14:53:01.7419076Z ==============================================================================
2017-08-24T14:53:01.7419076Z Task : Azure App Service Deploy
2017-08-24T14:53:01.7419076Z Description : Update Azure Web App Services, Web App On Linux , Function Apps, Mobile Apps using Web Deploy / Kudu REST APIs
2017-08-24T14:53:01.7419076Z Version : 3.3.13
2017-08-24T14:53:01.7419076Z Author : Microsoft Corporation
2017-08-24T14:53:01.7419076Z Help : [More Information](https://aka.ms/azurermwebdeployreadme)
2017-08-24T14:53:01.7419076Z ==============================================================================
2017-08-24T14:53:03.7273244Z Got connection details for Azure App Service:'beastmuffin'
2017-08-24T14:53:04.4099686Z [command]"C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe" -verb:sync -source:package='d:\a\r1\a\BeastMuffin-CI\drop\270.zip' -dest:contentPath='beastmuffin',ComputerName='https://beastmuffin-staging.scm.azurewebsites.net:443/msdeploy.axd?site=beastmuffin',UserName='********',Password='********',AuthType='Basic' -enableRule:AppOffline -userAgent:VSTS_3ba069a5-b836-4fd5-9b7a-158f8f07399f_release_1_110_110_1
2017-08-24T14:53:05.4251931Z Info: Using ID '5285835e-1d30-414e-bcb6-288c207678ac' for connections to the remote server.
2017-08-24T14:53:16.2964958Z Info: Deleting file (beastmuffin\Accessibility.dll).
2017-08-24T14:53:16.2964958Z Info: Deleting file (beastmuffin\Accessibility.xml).
... about 3000 lines later ...
2017-08-24T14:54:43.0840845Z Info: Deleting file (beastmuffin\zh-Hant\System.Spatial.resources.dll).
2017-08-24T14:54:43.0840845Z Info: Deleting directory (beastmuffin\zh-Hant).
2017-08-24T14:54:43.0840845Z Total changes: 3009 (0 added, 3009 deleted, 0 updated, 0 parameters changed, 0 bytes copied)
2017-08-24T14:54:43.0980858Z Successfully deployed web package to App Service.
2017-08-24T14:54:44.9961584Z Successfully updated deployment History at https://beastmuffin-staging.scm.azurewebsites.net/deployments/1101503586484042
So, it looks like it deleted the old files, but did not deploy / add the new build's files to Azure -- HOWEVER the COMMAND to deploy (per the logs) did not throw any exceptions.
Just to confirm nothing really got deployed, I visit the site and see this now:
So, I'm guessing there's no files in the production slot at the moment.
Update 8/24 1pm:
One new pertinent detail as I continue to debug this.
The new (preview) App Service Editor shows that the .zip file has been moved to the /wwwroot folder, however it does not unzip it.
Based on the logs and the .zip file, I'm beginning to think that the "Deploy Azure App Service" task doesn't yet support ASP.NET MVC Core 2.0.
To that end, I've opened a support issue on the vsts-tasks GitHub repo:
https://github.com/Microsoft/vsts-tasks/issues/5111
This issue was resolved out on GitHub (github.com/Microsoft/vsts-tasks/issues/5111).
In a nutshell, the new Build step "dotnet publish" (under preview as I write this) allows you to zip up the artifacts.
However, I already had the old "archive files" build step that I never removed from the previous build definition for ASP.NET MVC Core 1.1.
So, the result was the build was zipping up the zipped publish. During release, the publish was unzipped once, leaving the inner zip file unzipped as it moved it to the Azure website destination.

.Net core - How to create multi-platform executable from a console app

I'm starting to work with .net core 1.1 on a Web API project. The way I'm currently starting my server for the API is by publishing with dotnet publish and then running with dotnet MyProject.dll. Now I have a requirement to start the server from an executable file on Windows and on Linux. I wrote a .net core console app that does just that but the question is how do I wrap in in an executable file for .exe for Windows and what ever it is for Linux...?
I'm just entering the link given in the comment, to mark it as the correct answer.
Self-contained deployment without third-party dependencies

MsBuild Web deploy ERROR_FILE_IN_USE

I have a TFS build using Web Deploy to publish changes to a high traffic website. Build places an AppOffline.htm when it starts. A lot of times build fails due to some dll file in use. Tried recycling app pool and stating/stop website before build, still fails.
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Web\Microsoft.Web.Publishing.targets (4255): Web deployment task failed. (The file 'xxx.dll' is in use.
Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_FILE_IN_USE.)
Only way to publish successfully is to stop the website for whole duration while publish is going on.
Check for any files marked read only.
Some have said anti-virus can occasional cause this error as well. Try ignoring your web files.
I'm also seeing an issue where a VS2015 Web Publish to an Azure Web App has recently started to throw an error advising that a DLL file is locked...
See
https://github.com/Microsoft/vsts-tasks/issues/1607#issuecomment-272504519

Do you know ASP.NET Core run on AppHarbor cloud?

I made a small application with ASP.NET Core, I pushed to github and copied from github to App Harbor cloud and there should compile and publish, in the log file i see that when makes build on App Harbour cloud says that doesn't find .sln file. The question is that this cloud knows to build, run ASP.NET Core.