MSDeploy, IIS 6, Is the Deploy context menu available - iis-6

When using IIS6, should the 'Deploy' context menu item be available when right clicking on a web site?
I've installed the Web Deploy 2.1 (web installation tool) and rebooted but still it doesn't show. Maybe it doesn't show, and you just use the Web Deploy command line instead?
Any information appreciated.

No, The "deploy" context menu is only available in IIS 7 and 7.5. You'll have to do things via command line.
If you want to migrate from iis6 to iis7 you can follow the instructions here: http://learn.iis.net/page.aspx/427/migrate-a-web-site-from-iis-60-to-iis-7/ Note part 3 which goes into the actual web deploy commands.
Part 3 – Migrate your site to the
target by using a package file
Always make a backup of the destination server. Even if you are
just testing, it allows you to easily
restore the state of your server.
%windir%\system32\inetsrv\appcmd add backup “PreWebDeploy”
Run the following command on the source server to create a package
(compressed) file of the server:
msdeploy -verb:sync -source:metakey=lm/w3svc/1 -dest:package=c:\Site1.zip > WebDeployPackage.log
Copy the package file to the destination server.
Run the following command on the destination server to validate what
would happen if a sync operation were
run:
msdeploy -verb:sync -source:package=c:\Site1.zip -dest:metakey=lm/w3svc/1 -whatif > WebDeploySync.log
After verifying the output, run the same command again without the whatif
flag:
msdeploy -verb:sync -source:package=c:\Site1.zip -dest:metakey=lm/w3svc/1 > WebDeploySync.log

Related

dll grpc_csharp_ext.x64.dll in use when deploying with msdeploy

I'm using msdeploy on gitlab with this args:
[string[]]$msdeployArgs = #(
"-source:package='$packageFile',IncludeAcls='False'",
"-dest:auto,ComputerName='https://$($server):8172/MsDeploy.axd?site=$($iisWebsite)',UserName='$($deployUsr)',Password='$($deployUsrPwd)',IncludeAcls='False',AuthType='Basic'",
"-verb=sync",
"-disableLink:AppPoolExtension",
"-disableLink:ContentExtension",
"-disableLink:CertificateExtension",
"-allowUntrusted",
"-retryAttempts=2",
"-enableRule:AppOffline",
"-setParam:name=""IIS Web Application Name"",value=""$iisApplicationName"""
)
and I have always an error:
Info: Using ID '41f89bfc-34bd-41c2-a820-ad75f7966651' for connections to the remote server.
Info: Adding ACLs for path (test)
Info: Adding ACLs for path (test)
Info: Adding ACLs for path (test/App_Data)
Info: Using ID '33b1c88c-c667-44b0-9b2e-ffeedf0a3e0f' for connections to the remote server.
Info: Updating file (tes\App_Data\Anonymous.xml).
Info: Updating file (test\Areas\Web.config).
Info: Updating file (test\bin\grpc_csharp_ext.x64.dll).
Error Code: ERROR_FILE_IN_USE
More Information: Web Deploy cannot modify the file 'grpc_csharp_ext.x64.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.
Error count: 1.
msdeploy errorCode: -1
how can i please ignore this error or force to deploy ??
Regards
grpc_csharp_ext.x64.dll is locked by IIS, so here are your options:
Restart IIS on the remote server before deploying (you can create a script to automate this process, Jenkins can also come to aid here)
If you have this issue locally, when building your project in Visual Studio - the easiest option would be to add iisreset /stop at pre-build
event, and iisreset /start at the post-build event, see here: Visual Studio 2013.2 can't build because IIS is locking an assembly)
Downgrade grpc to version 2.25.0 (or below), as this issue related to version 2.26.0 and up
Upgrade grpc to version 2.30.0, as this version implemented SkipGrpcNativeLibsCopying in Grpc.Core.targets file to resolve this issue. see more detail here: https://github.com/grpc/grpc/issues/21867 and here https://github.com/grpc/grpc/pull/22894, but be aware of the warning mentioned here: https://github.com/grpc/grpc/pull/22894/commits/c6723399b8d7ed580e72220b7d880f57d1d5eae9

Access denied error using vsts

I'm trying to create a wcf service in a lab using vsts.
I have created a build definition that works using a msbuild task. It then uses robocopy to copy the relevant dlls to a remote directory inside a lab using the Publish Artifacts step.
However, I need the content to be created as a windows service, and started after it has been published. It seems like something is running since I see a created log file about 9 minutes after a successful publish, but i cannot see my service inside the services menu, or in IIS.
When I try to run a bat script (using the run script step) that does an sc create, I get an access denied error even though on the vsts build definition I have given the step permission to modify the environment.
This is the full error:
2018-05-17T13:00:13.7702615Z ##[section]Starting: Run script GloBill/InstallBackEnd.bat
2018-05-17T13:00:13.7705444Z ==============================================================================
2018-05-17T13:00:13.7705561Z Task : Batch Script
2018-05-17T13:00:13.7705655Z Description : Run a windows cmd or bat script and optionally allow it to change the environment
2018-05-17T13:00:13.7705748Z Version : 1.1.3
2018-05-17T13:00:13.7705824Z Author : Microsoft Corporation
2018-05-17T13:00:13.7705924Z Help : [More Information](https://go.microsoft.com/fwlink/?LinkID=613733)
2018-05-17T13:00:13.7706023Z ==============================================================================
2018-05-17T13:00:13.7775377Z ##[command]C:\agent\_work\1\s\GloBill\InstallBackEnd.bat
2018-05-17T13:00:13.8030595Z
2018-05-17T13:00:13.8031049Z C:\agent\_work\1\s>sc create GloBillBackEnd ../Services/GloBill.WS.exe
2018-05-17T13:00:13.8048684Z [SC] OpenSCManager FAILED 5:
2018-05-17T13:00:13.8048781Z
2018-05-17T13:00:13.8048901Z Access is denied.
2018-05-17T13:00:13.8048957Z
2018-05-17T13:00:13.8064609Z ##[error]Process completed with exit code 5.
2018-05-17T13:00:13.8073202Z ##[section]Finishing: Run script GloBill/InstallBackEnd.bat
I'm running out of ideas.
The problem was that I was trying to deploy a release from a hosted agent that resided on another machine.
I had to configure a new agent solely for deploying, then i had to tweak my installation script a little by adding the -executionpolicy bypass command.
Here is the new script:
(%1 is the file path)
Powershell.exe -executionpolicy bypass -File %1 -username Username -password ****** -exepath *exe* -serviceName *svcName*

trouble publishing website TFS 2013

I have a TFS 2013 build that I'm trying to get to publish to a folder on the build server. I've installed WebDeploy, but I always get the error:
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Web\Microsoft.Web.Publishing.targets (4274): Web deployment task failed. (Could not connect to the remote computer ("localhost"). On the remote computer, make sure that Web Deploy is installed and that the required process ("Web Management Service") is started. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_DESTINATION_NOT_REACHABLE.)
I've set up a website on the build server and that's where I'm trying to publish the website. Actually I don't even care about publishing it per se - I just need my build output to go to a folder locally automatically. Right now we have to manually open the solution and choose Publish... to get the output that subsequent InstallShield builds need for input. Here are my MSBuild arguments. Does anyone have any idea what could be missing?
/p:SrcDir=C:\Builds\TFS\WebApps\Src
/p:RevKeyname=WebAppsRevNr
/p:DeployOnBuild=true
/p:DeployTarget=MsDeployPublish
/p:MSDeployServiceURL=https://127.0.0.1:8172/msdeploy.axd
/p:CreatePackageOnPublish=True
/p:DeployIisAppPath="WebApp"
/p:MsDeployPublishMethod=WMSVC
/p:AllowUntrustedCertificate=True
/p:AutoParameterizationWebConfigConnectionStrings=False
/p:Authtype=NTLM /p:username=""
I've checked both net start wmsvc and net start msdepsvc and both are running. Any ideas?
Thanks!
UPDATE
I've tried everything that Andy suggested and now when I run this from the command line I get this bizarre error message:
"C:\Workspace\VS2013\WebApps\Main\Src\webapps.sln" (default target) (1) ->
"C:\Workspace\VS2013\WebApps\Main\Src\CoreWebApps\CoreWebApps.csproj"
(default
target) (7) ->
(AutoParameterizationWebConfigConnectionStringsCore target) ->
C:\Program Files
(x86)\MSBuild\Microsoft\VisualStudio\v14.0\Web\Microsoft.Web
.Publishing.targets(2295,5): error : Could not open Source file: Could not
find
a part of the path
'C:\Workspace\VS2013\WebApps\Main\Src\CoreWebApps\Areas\Adm
in\Views\Web.config;Areas\Admin\Views\Web.config'.
[C:\Workspace\VS2013\WebApps
\Main\Src\CoreWebApps\CoreWebApps.csproj]
Any idea why it's looking for Web.config;Areas\Admin\Views\Web.config'.? That makes no sense.
Please try below items to narrow down the issue:
Try to use IP or Machine Name instead of "localhost"
Logon your build agent machine, then manually execute the same
MSBuild command within the same arguments(which you provided in build
definition) to build and deploy your solution, then check result. You
need to ensure you can manually run the same MSBuild command within
deploy argument to build and deploy your solution successfully from
build agent machine. Then use the same deploy arguments in TFS Build
definition.
Double check Web Deploy settings to make sure that the name of the
website is exactly that of what's in IIS.
Install Web Management Tools before Web
Deploy : Install the Web Management Services (Roles -> Web Server >
Management Tools > Management Services). Then uninstall Web Deploy, and then install Web Deploy again.
You can also reference this thread for your troubleshooting.
Update:
For the issue "Could not open Source file: Could not find a part of the path" you can reference below similar articles for the troubleshooting.
https://social.msdn.microsoft.com/Forums/en-US/8f959964-c951-4f9a-8486-8283a925c9f6/build-error-could-not-open-source-file-though-i-know-it-exists?forum=windowsazurewebsitespreview
https://our.umbraco.org/forum/getting-started/installing-umbraco/60222-Umbraco-721-Build-fails-after-deploy-to-Azure-WebSite (See the last two answers)

ASP.NET 5 site fails to publish to azure appservice because of a long path

I'm trying to publish a relatively new ASP.NET site to azure appservice from Visual Studio.
I'm getting the following error message during the preview:
The "Dnu" task failed unexpectedly.
System.Exception:
Microsoft .NET Development Utility Clr-x86-1.0.0-rc1-16231
Copying to output path C:\Users*****\AppData\Local\Temp\PublishTemp*****************.********.WebApi114
Error: The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.
at Microsoft.DNX.Tasks.Dnu.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext()
Path is long indeed. How do I fix it?
Error is from windows file API, not control by Azure App Service. Sadly I think you will have to find a way to shorter your file path in order to fix this issue.
I was running into the same issue trying to build an Angular2 app locally. So I tend to agree with Xiaomin that it may be a local issue. What worked for me was to run the dnu publish command from a command prompt with the output flag set with a shorter folder destination provided. For example, navigate to the location of the project you want to publish in a command prompt and type:
"dnu publish --runtime active -o c:\Sample"
The above command will post your output to c:\Sample.
You can interrogate the options as follows:
"dnu -help"
"dnu publish -help"

Automated deploys, remote scripts, MSBuild and MSDeploy

I'm looking for some help/direction and am generally baffled as this must be a common issue that people face (i.e. there should be an straight forward solution!).
I'm deploying a web site remotely using TeamCity, MSBuild and WebDeploy/MSDeploy. I also wish to run some scripts on the remote server that I'm deploying to. ... How do people generally do this?! I just want to automate some everyday tasks remotely on ther server e.g. backing up files or similar.
Is it a case of:
Using MSDeploy to remotely run some scripts like here, but then how do I transfer the scripts to the remote server as part of the automated deploy??
Starting some sort of PowerShell session and remoting into the server this way?
Some sort of ssh-ing or another way?
FYI these are the params I use for MSBuild and MSDeploy to the remote server (they work fine):
/p:Configuration=TeamCityLiveRelease
/p:OutputPath=bin
/p:DeployOnBuild=True
/p:DeployTarget=MSDeployPublish
/p:ContinueOnError="false"
/p:MSDeployPublishMethod=WMSVC
/p:MsDeployServiceUrl=https://MY.SITE:PORT/msdeploy.axd
/p:DeployIisAppPath=my.iis.site.here
/p:AllowUntrustedCertificate=True
/p:Username=FOO
/p:Password=baaa
Ideally I'd like to write a nice command line script and do something like (about as pseudo as it comes sorry!):
Log in to "http://some.server.ip" -username "user" -password "something"
run script "echo this is a remote script running"
I think psexec is the tool you're looking for: http://technet.microsoft.com/en-us/sysinternals/bb897553
In case anyone is interested: it is possible to use MSDeploy to carry out scripts on a remote computer (a script called MYSCRIPT.bat here). If you have an admin account on the remote server then it can be done using the following arguments:
"c:\program files\iis\microsoft web deploy\msdeploy.exe"
-verb:sync
-source:runCommand="C:\MYSCRIPT.bat",
waitInterval=5000,waitAttempts=1
-dest:auto,
computerName=https://IP.ADDRESS.HERE:PORT/msdeploy.axd?site=IIS.SITE.NAME.HERE,userName=MYUSERNAME,password=MYPASSWORD
-verbose
-allowUntrusted