I have a solution that has 10-20 web projects, and I am trying to use msbuild webdeploy to deploy them.
msbuild "mysolution.sln" /p:DeployOnBuild=true /p:PublishProfile="Debug"
However, I got this error in the middle of deploy:
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Web\Microsoft.Web.Publishing.targets(4295,5): msdeploy error ERROR_EXCEEDED_MAX_SITE_CONNECTIONS: Web deployment task failed. (The maximum number of connections for this site has been exceeded.
In the log, before this error, a few projects were being deployed and files were updated. It seems that msbuild is trying to deploy as many as projects at the same time as possible, and exceeded the max connection number.
So how can I limit the connection number, is there an option in the publish profile?
Update - workaround
I have got a workaround from viet.hoang in Sitecore slack channel. It basically increases the max connection number on the server and/or retry attemps in the publish profile.
Increase max connection number: go to the target server and add adding the following to the registry: [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\IIS Extensions\MSDeploy\3] "MaxSiteConnections"=dword:00000010. Then restart Web Management Service.
Increase retry attempts: in the publish profile there is an option "RetryAttemptsForDeployment", add it and set the value to 20.
The workaround works, no more error in the deployment. But I am still hopeful that someone will be able to provide some insights and a proper solution that doesn't require registry modification and can throw other types of errors quickly without retry 20 times.
Method 1 - Limit connection via MSBuild
There is a way to limit how many thread MSBuild can use.
msbuild.exe mysln.sln /maxcpucount:3
The "maxcpucount" limits the MSBuild threads, thus limit how many projects can be published at the same time. If it is not defined, MSBuild will actually use up to the number of processors on the computer.
Reference: https://msdn.microsoft.com/en-us/library/bb651793.aspx
Method 2 - Lift limit on the server
Add a registry value to the server
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\IIS Extensions\MSDeploy\3]
"MaxSiteConnections" (DWORD Value) : 0
Then restart "Web Management Service".
When you set the registry value to 0, it means unlimited connection.
Reference: Nicolas_nguyen1's comment in this Microsoft document
I had the same problem when host by web deploy from visual studio 2017. after researching through online i had come across a solution . please follow the link: https://youtu.be/nOonbx9FgJQ
Related
So I am getting the rather common HTTP Error 502.5 - Process Failure now that I've hosted my project on a server VM running Windows Server 2016. While troubleshooting, I've attempted most of the solutions proposed for the same error:
ASP.NET Core 1.0 on IIS error 502.5.
Nothing else helped, so I'm looking at the answer that received the most upvotes. This mentions running the following command to receive a more meaningful message describing the error:
C:\fullpath\dotnet C:\fullpath\PROJECT.dll
I am honestly not sure how to execute that. What I did was navigate to the published project's containing folder on the server through the cmd, and issue the command like so:
dotnet .\My_Project Integration.dll
But the console prints this in response:
No executable found matching command "dotnet-.\My_Project"
Notice how the DLL is titled 'My_Project Integration.dll, however the word 'Integration' is absent from the console response. I do not know whether the underscore is to blame here, but any help is appreciated getting the command to run.
And of course, if you know of a solution to the actual 502.5, that is welcome as well.
You've likely got this issue: https://github.com/aspnet/Home/issues/1931. The ASP.NET Core IIS Module reads the Web.config to determine what to execute to run the app.
You said running dotnet ".\My_Project Integration.dll" worked successfully and enabling stdout showed the same issue of the path being truncated after the space.
Two options:
Remove the space from your project (this would be the easiest option)
Update your Web.config
If you do #2, your Web.config needs to have something like this for the arguments attribute:
arguments='".\My_Project Integration.dll"'
I faced very strange behaviour - after I overwrite .NET exectables with new versions from network drive it cannot start.
When try to start from Windows Explorer it shows me following error:
[Window Title]
C:\Programs\zzz\clients.net\zzzNet.exe
[Content]
C:\Programs\zzz\clients.net\zzzNet.exe
The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log or use the command-line sxstrace.exe tool for more detail.
I tried to execute following commands:
SxsTrace Trace -logfile:SxsTrace.etl
SxStrace Parse -logfile:SxSTrace.etl -outfile:SxSTrace.txt
And got following result:
=================
Begin Activation Context Generation.
Input Parameter:
Flags = 0
ProcessorArchitecture = AMD64
CultureFallBacks = en-US;en;ru-RU;ru
ManifestPath = C:\Programs\zzz\clients.net\zzzNet.exe
AssemblyDirectory = C:\Programs\zzz\clients.net\
Application Config File = C:\Programs\zzz\clients.net\zzzNet.exe.Config
-----------------
INFO: Parsing Application Config File C:\Programs\zzz\clients.net\zzzNet.exe.Config.
INFO: Parsing Manifest File C:\Programs\zzz\clients.net\zzzNet.exe.
INFO: Manifest Definition Identity is (null).
ERROR: Line 0: XML Syntax error.
ERROR: Activation Context generation failed.
End Activation Context Generation.
It is quite simple .NET application (1 exe + 8 dll files). It was built for .NET 3.5 Client Profile.
I not defined any special "manifest" there. Just clicked "New Windows Forms Project" in Visual Studio and developed it.
Also app.config does not contain anything special - only primitive standard settings - appSettings and userSettings sections.
On PC where I developed it all is perfectly works. Problems only began when I copy these binaries to this particular VM and try to start.
Also please note - these executables were not installed in GAC or such, I just copied them into a folder on VM and started. And when it was 1st time all was working fine.
So, the problem pattern is following:
Copy .NET execuatbles to new VM (it is Win 7 x64), run it, all is working fine. Close it.
Build new version of .NET execuatbles on host PC, copy new .NET execuatbles to VM (with files overwriting).
Try to start - got mentioned problem.
After some shaman-style actions (like OS reboot, etc) it begin to work but why that happened at all?!
Why replacing .NET executables with new versions is causing SUCH HUGE PROBLEMS?!
Also the BIG QUESTION - is there any special procedure to replace .NET executables to keep them working? Because it is a new app development, I do not want lost so much time on every new executables installation. :-\
Could you please help? Because it looks completely weird!
Thank you in adance.
PS. I checked all VS projects - all they have PlatformTarget=AnyCPU. Also in run-time I can see ProcessType=MSIL (I show this info in AboutBox for application). So, there is no mix of x86/x64 binaries.
It seems that was related to mapped network drive behavior.
When I copied new files from network drive folder it copied wrong files - a strange random mess of new files and older ones (which were there before I updated them on VM host).
The scenario to make it working:
on VM: delete all files in a folder on network drive
on VM host: copy new files into a folder which is mapped as network drive on VM
on VM: copy files into target folder
on VM: run application - it works now
Weird thing. I remember I have seen something similar with Windows Explorer on Windows 2008 behaviour when copying updated win32 binaries.
I have now had an error with VS2013 and WP8.1 silverlight for a couple of days.
I get a couple of different errors, ..Ensure unlocked screen.., AgHost.exe could not be launched, port is in use by another program and ensure the device is unlocked.
These errors came suddenly after I retarged the solution. I have no compiling errors.
Solution Attempts
Restart PC
Restart program
unregister and reregister the phone
reinstall Update 3
reinstall VS2013
Windows Phone 8 Application crash once its launched AgHost.exe' has exited with code -532265403
Install VS2015 with no luck.
reinstall VS2013 Update 4
Nothing worked. The error is also the same for emulator as well as different devices. I can however get the release mode installed. Break points can be used when using release mode, but I have to Clean, Rebuild and then deploy for every time I want to deploy the application. Further the deploy time has gone up exponentially. Before upgrading I used a maximum of 10 seconds. Now it is above a minute in wait time. :/
Anyone has a solution for this ?
Extra
If I run the solution before upgrade on device or Emulator It spins up with debugger. If then go to the updated WP81, I get a popup with info Something is taking longer then normal and then it crashes with ..Ensure unlocked screen.. :/
Could it be an issue with the differen SDKS?
During a repair of all the SDKs, I found an issue with the event log, which I cleared based on The Event Log File is full
Still no success.
Extra
I cannot spin up the emulator from VS2013, when using the WP8.1 solution, but the wp8.0 solution in the same VS works :S
I found an error in a log file, from:
The errors are:
[0F08:14A8][2015-07-23T09:11:44]: Applying execute package: silverlight5_DRT, action: Repair, path: C:\ProgramData\Package Cache\DEB5078B60B74431E2830831EB48DF129CB32932\packages\Silverlight\5.0_DRT\Silverlight_Developer.exe, arguments: '"C:\ProgramData\Package Cache\DEB5078B60B74431E2830831EB48DF129CB32932\packages\Silverlight\5.0_DRT\Silverlight_Developer.exe" /q /ignorewarnings'
[0F08:14A8][2015-07-23T09:11:45]: Error 0x800705de: Process returned error: 0x5de
[0F08:14A8][2015-07-23T09:11:45]: Error 0x800705de: Failed to execute EXE package.
[0550:0E74][2015-07-23T09:11:45]: Error 0x800705de: Failed to configure per-machine EXE package.
[0550:0E74][2015-07-23T09:11:45]: MUX: Installation size in bytes for package: silverlight5_DRT MaxAppDrive: 0 MaxSysDrive: 0 AppDrive: 0 SysDrive: 0
AND
[0F08:14A8][2015-07-23T09:16:16]: Applying execute package:
{312d9252-c71c-4c84-b171-f4ad46e22098}, action: Repair, path:
C:\ProgramData\Package
Cache{312d9252-c71c-4c84-b171-f4ad46e22098}\VS2012.4.exe, arguments:
'"C:\ProgramData\Package
Cache{312d9252-c71c-4c84-b171-f4ad46e22098}\VS2012.4.exe" -repair
-quiet -burn.related.patch' [0F08:14A8][2015-07-23T09:16:23]: Error 0x80048bc7: Process returned error: 0x80048bc7
[0F08:14A8][2015-07-23T09:16:23]: Error 0x80048bc7: Failed to execute
EXE package. [0550:0E74][2015-07-23T09:16:23]: Error 0x80048bc7:
Failed to configure per-machine EXE package.
Anybody knows what to do with this? The error is coming when I repair Windows Phone SDK 8.0
There was a post-VS2013 update for the Windows Phone 8.1 SDK, some odds that you don't have it installed since you did not need it before. The download location is here.
Getting error messages like "port is in use" when there's no obvious reason why it should be in use and seeing excessive download times is also a very strong selector for your installed anti-malware product getting in the way. No specific advice on how to configure it when we don't know what it might be. You definitely first want to try to temporarily disable it so you can identify it as the source of the problem.
I have no Idea of what is the issue, but creating a new solution and importing the existing projects into a new solution has solved all the issues regarding emulator and debugger an AgHost.
Seems like the upgrade function integrated in the solution did not work properly.
I have setup my TeamCity to build using MsBuild a project that NuGet packages.
During the build, the following command to install packages is issued, but fails:
..\nuget.exe install "C:\TeamCity\buildAgent\work\811b6866c8757c46\Service\packages.config" -source "https://nuget.org/api/v2/" -RequireConsent -solutionDir "..\ "
Error:
Unable to connect to the remote server
with exit code 1.
Interesting to note is that when I run this exact same command on the cmd prompt (inside the same path), it succeeds without any errors.
This is what I have done so far:
Add a new Build Parameter under environment variables in TeamCity: env.EnableNuGetPackageRestore and set it to 'true'
Add a specific path to the package sources (https://nuget.org/api/v2/) inside the ..nuget\nuget.targets file (as described here)
To provide the additinal paths ways to supply a path:
Modified the nuget.config file inside the .nuget folder (..nuget\nuget.config)
Modified the nuget.config for the SYSTEM account that the build runner is executing under (C:\Windows\SysWOW64\config\systemprofile\AppData\Roaming\NuGet\nuget.Config) (as described here)
What I was thinking is that this has something to do with a roaming profile of the System user (that the build agents runs with) because it all works when build agent runs with my account. But the nuget.config is the same for both profiles, and I'm out of ideas. Maybe the System user doesn't have access to the Internet on WinServer2012R2? Maybe it needs additional permissions? Which ones?
Do you have any ideas of what to try?
The error turned out to be the setting for the ISA server we have on our network (the TMG client). By default this isn't set up for new (local) users and therefore the SYSTEM account didn't have access to the web.
I've set this up for a new local user (non-domain, with password that doesn't expire), added it to Administrators group and now it works just fine.
I am trying to configure a build in TFS to deploy to our test box for continuous integration. The problem I'm having is that TFS wants to append the MSDEPLOYAGENTSERVICE to the end of my URL which is causing the deploy to return a socket error:
Retrying the sync because a socket error (10054) occurred. Retrying operation 'Serialization' on object sitemanifest (sourcePath).
Here are my MSBuild Arguments:
/p:DeployOnBuild=True
/p:DeployTarget=MSDeployPublish
/p:MsDeployServiceUrl=[ip address]:8172/MsDeploy.axd
/p:MSDeployPublishMethod=RemoteAgent
/p:CreatePackageOnPublish=True
The server is a Windows Server 2008 R2 64bit server with IIS 7.5. We have no problems using the publish feature of Visual Studio 2010 to deploy to the test box using the Url above. Any help would be much appreciated.
You don't need to specify MsDeploy.axd in your MsDeployServiceUrl. Also, I see you don't have a DeployIisAppPath value set. You should set it to the name of your website in IIS.
Below is an example from one of our CI builds.
/p:DeployOnBuild=True
/p:DeployTarget=MsDeployPublish
/p:CreatePackageOnPublish=True
/p:MSDeployPublishMethod=RemoteAgent
/p:MSDeployServiceUrl=http://[YOUR WEBSERVER URL]
/p:DeployIisAppPath="NAME-OF-WEBSITE-IN-IIS"
After a few days an tons of searching, I discovered the issue.
/p:DeployOnBuild=True
/p:DeployTarget=MSDeployPublish
/p:MsDeployServiceUrl=[ip address]/MsDeploy.axd
/p:MSDeployPublishMethod=WMSVC
/p:CreatePackageOnPublish=True
/p:DeployIisAppPath=[name of website in iis]
/p:AllowUntrustedCertificate=True
As it turns out, the publish method was the culprit. RemoteAgent cannot interpret the deploy correctly, which is why it fails to serialize. WMSVC is the appropriate setting for the publish method.