Web deployment stops at first dll - visual-studio-2010

I am trying to deploy a webapp to a win2003/iis6 server using msbuild and msdeploy, but the process halts at the end of transferring the first dll, returning this message:
Web deployment task failed. (Unable to write data to the transport
connection: ...
This message is followed with the message that the remote server closed the connection (in Dutch). The folder structure is created, config and aspx files as well. I am using these MSBuild options:
/p:DeployOnBuild=True /p:DeployTarget=MsDeployPublish /p:CreatePackageOnPublish=True
/p:MSDeployPublishMethod=RemoteAgent /p:MSDeployServiceUrl=remote-server
/p:DeployIisAppPath="Site/app" /p:UserName=user /p:Password=myPassword
Where do I start digging? Regards.

Related

Deploy to Azure using publish profile : Works when publishing on VS2017 fails when using Jenkins

I downloaded the Publishing Profile from my App Service and created a profile on my WebApi.
When I execute "publishing" using VS 2017, it works fine.
When I try to execute deploy command on Jenkins if fails. The error message I have is :
Deployment task failed. (Connected to the remote computer ("XXXXXXXX") using the Web Management Service, but could not authorize.
Make sure the site name, user name, and password are correct. If the issue is not resolved, please contact your local or server administrator.
Connected to the remote computer ("xxxxxxxxxxx") using the Web Management Service, but could not authorize.
The remote server returned an error: (401) Unauthorized.
I have a step on Jenkins using PowerShell command line like :
msbuild My.WebApi /P:AllowUntrustedCertificate=true /P:DeployOnBuild=True /p:PublishProfile=$myPublishProfile
It builds without errors
$myPublishProfile is a valid Path
This Jenkins instance runs on a Server, not on my machine.
Jenkins has its own SMC user and server auth user.
App Service has WEBSITE_WEBDEPLOY_USE_SCM set to False
I am using the same Publishing Profile to build on Jenkins and on Visual Studio.
If both are using the same Publishing Profile, why I am getting the Auth error ?
Is there is any other config I should do to perform Deploy from Jenkins ?
When you publish using visualstudio the password is stored in an encrypted file on your disk. If you need to publish with the msbuild-command you can add credentials on the commandline or in the publishprofile
append theese properties on the commandline:
msbuild ... /p:UserName=XXX /p:PassWord=YYY
or include in the profile
<UserName>XXX</UserName>
<Password>YYY</Password>

Build solution and start IIS Express with .bat file (without opening Visual Studio)

For local development purposes, I'd like to just run a .bat file to build my solution and run it on iis express.
Here's what I've got:
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvars32.bat"
devenv "C:\Path\To\Solution.sln" /build debug
echo "Web build completed. Launching IIS..."
CD "C:\Program Files (x86)\IIS Express\"
iisexpress /path:C:\Path\To\Webroot /port:58389 /clr:v4.0
This does indeed successfully build the solution and start iis express.
Here's my output:
[vcvarsall.bat] Environment initialized for: 'x86'
Microsoft Visual Studio 2017 Version 15.0.28010.2050.
Copyright (C) Microsoft Corp. All rights reserved.
1>------ Build started: Project: PDS.Utilities, Configuration: Debug Any CPU ------
2>------ Build started: Project: PDS.Ibex, Configuration: Debug Any CPU ------
...
========== Build: 11 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
"Web build completed. Launching IIS..."
Copied template config file 'C:\Program Files (x86)\IIS
Express\AppServer\applicationhost.config' to 'C:\Users\CXSVH9\AppData\Local\Temp\2\iisexpress\applicationhost2018116141435830.config'
Updated configuration file 'C:\Users\CXSVH9\AppData\Local\Temp\2\iisexpress\applicationhost2018116141435830.config' with given cmd line info.
Starting IIS Express ...
Successfully registered URL "http://localhost:58389/" for site "Development Web Site" application "/"
Registration completed
IIS Express is running.
Enter 'Q' to stop IIS Express
When I fire up localhost, I get the following output in Command Prompt:
Request started: "GET" http://localhost:58389/login.aspx
Request ended: http://localhost:58389/login.aspx with HTTP status 200.0
Request started: "GET" http://localhost:58389/login.aspx
Request ended: http://localhost:58389/login.aspx with HTTP status 200.0
200's. So, that's good.
But in the browser, I get the message: "Requested view is not available" (a message peculiar to my environment, I'd guess — I just started with this codebase).
Of course, if I start the project from inside Visual Studio, everything works fine. But, as a frontend dev, I'd rather skip that and just fire the project up with a script and use VS Code to edit my static files.
Any thoughts on why this is not loading assets from my web project?
The really frustrating thing is I had this working before, but accidentally deleted my original .bat file and can't get things sussed again.
UPDATE
When I clear cache in the browser, it does GET all my assets with 200's. But still, "Requested view is not available."
Let me somewhat sheepishly answer my own question: I needed to start an additional web service that our website depends upon. This was as simple as writing another batch file to start that web service using the same technique above, but changing the path and the port to their appropriate values.

HTTP Error 502.5 - Process Failure - .net core 2.0 to AWS EB

I'm getting this error after deploying my API to AWS Elastic Beanstalk.
Steps to reproduce
File -> New -> Project
ASP.NET Core Web Application
ASP.NET Core 2.0
Web API
F5: OK
Publish to AWS Elastic Beanstalk... (via AWS Tollkit for Visual Studio 2017)
HTTP Error 502.5 - Process Failure
Additional info
Visual Studio 2017
64bit Windows Server 2012 R2 v1.2.0 running IIS 8.5
I've already tried looking up many other questions, but to no success.
Log
2018-01-15T13:27:21.000Z Error 0:(0) IIS AspNetCore Module - Application 'MACHINE/WEBROOT/APPHOST/DEFAULT WEB SITE' with physical root 'C:\inetpub\AspNetCoreWebApps\app\' failed to start process with commandline 'dotnet .\WebApplication2.dll', ErrorCode = '0x80004005 : 8000808c.
<PropertyGroup>
<PublishWithAspNetCoreTargetManifest>false</PublishWithAspNetCoreTargetManifest>
</PropertyGroup>
Adding the above code to the .csproj solved the problem.
I faced the same issue. After contacting AWS support, it turns out that there was a bug in my code [Release version].
I suggest the following steps to debug locally:
Publish your solution to a file
Open Command Prompt in the published folder
Run "dotnet Your.Main.App.dll"
Most probably you will see an exception
Sometimes we forget to test our solutions in Release mode.
Cheers!

Not able to web deploy to ec2 instance

I am trying to web deploy to a ec2 instance using the msbuild
C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
/p:Configuration=Release;MsDeployServiceUrl=ec2-instance
name.compute.amazonaws.com:8172/msdeploy.axd;MSDeployPublishMethod=RemoteAgent;username="adminuser";password="password";DeployIisAppPath=Sitename;CreatePackageOnPublish=true;DeployOnBuild=true;DeployTarget=WebPublish
"my.Web.csproj"
I get a
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web
.Publishing.targets(3847,5): error : Web deployment task failed.(Could not comp
lete the request to remote agent URL ':8172/msdeploy.axd/MSDEPLOYAGENTSERVICE'.) This error indicates that you cannot connect
to the server. Make sure the service URL is correct, firewall and network sett
ings on this computer and on the server computer are configured properly, and t
he appropriate services have been started on the server.
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.P
ublishing.targets(3847,5): error : Error details:\r
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.P
ublishing.targets(3847,5): error : Could not complete the request to remote age
nt URL ':8172/msdeploy.a
xd/MSDEPLOYAGENTSERVICE'.
I have
1.Open ports in security group for 8172
2.Reinstalled web deploy 3 in target
3.Made a admin user and using that
Help would be really appreciated.
The URL its using is incorrect. Since you are publishing over the web you are using web management service and hence the url should be in either one of the following formats:
Publishing as an admin:
https://myserver.com:8172/msdeploy.axd
If you are publishing as an owner of one site on the server and have permissions just to your own site then:
https://myserver.com:8172/msdeploy.axd?site=<sitename>

MSBuild - Remote Agent URL Error

I have been using the "Publish Web" dialog in VS2010 for over a year. In the "Service URL" section I have:
http://server.workapps.com
...and my deploys work no problem for ALL my apps.
Now I am trying to create a CI environment using Teamcity and ran into the problem where by my stated property:
/p:MsDeployServiceUrl="http://server.workapps.com"
...started erroring.
To debug I started using command line MSBuild.exe until I got the correct settings but again here MSBuild is translating my property:
"/p:MsDeployServiceUrl="http://server.workapps.com"
...into a request that errors with:
"Remote agent (URL https://server.workapps.com:8172/msdeploy.axd?site=uat.workapps.com) could not be contacted.
FYI on the server Web Deploy is set to run on http:80 and I am trying to deploy a MVC Web Applciation (c#).
Can anyone tell me why it is not using the URL I gave and adding https and ports on?
Please see my parameters below:
/p:Configuration=Debug
/p:DeployOnBuild=True
/p:DeployTarget=MSDeployPublish
/p:MsDeployServiceUrl="http://server.workapps.com"
/p:username=Administrator
/p:password=NotOriginalPassword
/p:AllowUntrustedCertificate=True
/P:CreatePackageOnPublish=True
/p:DeployIisAppPath=uat.workapps.com
/p:MSDeployPublishMethod=WMSVC
Thanks Paul
It would appear I need to use the following:
/p:MSDeployPublishMethod=RemoteAgent
as opposed to WMSVC.

Resources