When I click on the Publish method following options show up:
What is the significance of each method?
Web Deploy - If you have IIS on server machine running and configured to receive Web Deploy requests, it will send all requested by IIS files. IIS will immediately start running new web page.
Web Deploy Package - If you have IIS on server machine running and configured to receive a Web Deploy Package it will pack your whole web page, and will upload them to server machine. IIS will immediately start running new web page.
FTP will upload files to FTP server (can be any OS that handles FTP), but be aware that this is NOT safe and whole upload process can be captured and compromised.
File system will deploy all items required for launching a web service, with any method supported by current project configuration, into provided directory on your machine.
Web Deploy:
Deploys your app to a local or remote IIS server immediately (one click publishing), assuming you have access and the server is configured properly.
Web Deploy Package:
Similar to Web Deploy, but creates a zipped deployment package on the local file system to be deployed later to a local or remote IIS server.
FTP:
Copies the required app files to an FTP server. You might use this to deploy your app to the (non-Azure) cloud.
File System:
Copies the required app files to the local file system. Useful for testing or if you want more control over how the deployment is done.
The two web deploy methods are smarter than the more old-school FTP/file system approaches. For example, they can apply config file transforms during the deployment, and they are faster because they only transfer changes. They are also more secure.
More info here.
Related
When uploading the ASP.NET Core publish file to a server error using another process, and when stopping, IIS allows uploading my file.
How to upload my publisher file without stopping IIS?
Based on this issue here: https://github.com/aspnet/IISIntegration/issues/238
If you are publishing to an IIS server, have you tried using the MSDeploy profile instead of FileSystem? If it is an MSDeploy profile, you can set the following property in the pubxml (under Properties\Publish Profiles)
<EnableAppOffline>true</EnableAppOffline>
This will take care of bringing the site down before publishing. You should not run into issues with deleting files with this profile.
Publishing to a folder does not know if it is getting published to a live site or just a folder on the machine. Hence, it does not handle stopping the site before publishing. MSDeploy profiles are specifically meant to handle these scenarios (publishing to IIS etc).
Unfortunately, it seems that there is no way to patch dlls without restarting the app pool yet.
If you don't want to stop iis then you could try to recycle the iis application pool which is used by the web application you are trying to redeploy.
Open IIS Manager
Right-click the AppPool
Choose the recycle option from the action
I want to explore a folder of a network drive(\11.11.11.11\Shared) that is share to all user within network. I have hosted my application into IIS of my local machine that is also in the same network.
We have to only explore the folder of like we done using Run Command and putting the address.
It will work when I run the application though visual studio. But if host the published code into IIS then it will not work.
I am always getting the success response in both the cases(on IIS as well as Visual Studio running mode).
In IIS create web application.
Assign app pool of your choice to application.
Under web application add virtual directory and map network folder to this virtual directory.
Give read/list permissions on your network folder to app pool's identity.
Set directory browsing on web application.
Problem
Getting a deployment error when trying to publish to an Azure Web App from TFS CI. A file is locked and this prevents the build from updating.
Symptoms
Publishing manually (Web Deploy publish from within Visual Studio) usually succeeds.
Stopping the Web App and publishing allows it to succeed, however this defeats the point of our CI if we need need to stop and start the Web App each time.
CI publish to Web roles and Worker roles don't appear to have this issue, we only get it on publishing to Web Apps (formerly Web Sites, the current Azure Portal term is now App Service).
Only publishing from a CI build via TFS fails consistently in this way.
Error
Web deployment task failed. (Web Deploy cannot modify the file
'msvcr100.dll' on the destination because it is locked by an external
process. In order to allow the publish operation to succeed, you may
need to either restart your application to release the lock, or use
the AppOffline rule handler for .Net applications on your next publish
attempt. Learn more at:
http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_FILE_IN_USE.)
The information at the link isn't very helpful.
ERROR_FILE_IN_USE
Diagnosis – A destination file cannot be overwritten or deleted because it is currently in use.
Resolution – Make sure that the destination file is not in use before performing a sync. If you are syncing content to a web site
hosted on IIS 7 or later (using the appHostConfig, iisApp, or
contentPath providers), consider taking the application offline during
the sync by enabling the appOffline rule.
Attempted resolutions
We were using New Relic - have since removed New Relic and this issue still persists. The binary appears to be a Microsoft library but it's unclear how it is relevant to the application (it's not referenced).
Some other SO questions have addressed similar issues with publishing but none of these relate to getting this issue from TFS CI.
azurew website continious deployment - Web Deploy cannot modify the file 'XXX' on the destination because it is locked by an external process
How to take web app offline while publishing?
One answer in the above question suggests using the EnableMSDeployAppOffline configuration in the publish profile, and adding this configuration works OK for doing a publishing manually from within VS but it doesn't fix the problem when publishing automatically from TFS/CI.
Edit
How to take web app offline while publishing? deals with taking the app offline using the EnableMSDeployAppOffline configuration - unfortunately this config only seems to be supported when doing WebDeploy through Visual Studio (not CI).
You can use the Web Deploy v3 in CI to deploy your web app.
In Web Deploy V3, we added support to automatically take an ASP.Net
application offline before publishing to it. This is useful if a user
wants to ensure that their application does not have a lock on a file
(e.g. SQL CE sdf files which only allow one connection to the file at
a time) being overwritten, or if they want to ensure that visitors to
their site cannot affect the publish process. When the publish process
is completed, the App_Offline.htm file will be removed and the site
will be online again.
Or you can add a PowerShell script like following to deploy the web app to Azure:
param($websiteName, $packOutput)
$website = Get-AzureWebsite -Name $websiteName
# get the scm url to use with MSDeploy. By default this will be the second in the array
$msdeployurl = $website.EnabledHostNames[1]
$publishProperties = #{'WebPublishMethod'='MSDeploy';
'MSDeployServiceUrl'=$msdeployurl;
'DeployIisAppPath'=$website.Name;
'Username'=$website.PublishingUsername;
'Password'=$website.PublishingPassword}
Write-Output "Stopping web app..."
Stop-AzureWebsite -Name $websiteName
Write-Output "Publishing web app..."
$publishScript = "${env:ProgramFiles(x86)}\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools\Publish\Scripts\default-publish.ps1"
. $publishScript -publishProperties $publishProperties -packOutput $packOutput
Write-Output "Starting web app..."
Start-AzureWebsite -Name $websiteName
Reference from: https://msdn.microsoft.com/en-us/Library/vs/alm/Build/azure/deploy-aspnet5
The new "Deploy AzureRM Web App" task has an option to take the app offline which will prevent this error.
See screenshot for checkbox
I am new to dot net web services and I have created a web service which I was somehow able to deploy to IIS.
Now, I've made some code changes to it and again clicked on "Created Deployment Package". Should I just copy paste these new dlls to the location where my Web service is deployed or is there some-other way to redeploy the code changes for web service to IIS?
Yes simple and easy is copy the dll to iis and you are done, even you may not require deployment package.
in general i publish the site to a local folder and then copy it to server.
but in case you are using local machine iis you can publish directly to respective iis folder.
I am working on VS 2010 with .net 4 (OS: Windows XP). I want my application to have update feature. I have only one computer. How can i deploy the application it to test the update feature?
Currently i am publishing my application in a folder in my documents
I tried publishing to local FTP using XAMPP but it was unable to check for updates on FTP.
Now i have installed IIS to make a local HTTP server to deploy my application there but it asks for Front Page Server Extension then was asking Front Page.
All i need is that my application can update it self. Original requirement was patch update but i don't know how to do that. I think using ClickOnce is enough.
Create a network share on your local machine and publish to that; when you install the application, make sure to install it via the network share too.