Good evening, I have been working on the project that has got a web app, api, a few libraries and some Azure functions. When I run only Azure function on its own it works just fine but today I noticed that when I select Multiple startup projects in VS2022 and run all project at once they are all running fine but my azure function is giving me error "No connection could be made because the target machine actively refused it.). In the console output I can see that the emulator starts whenever I start a Visual Studio however after selecting multiple projects I see the message "Stopping Azure Storage Azurite emulator..." I tried to restart Visual Studio but whenever I select it, it stops. Why is it stopping, is there any way how can I prevent stopping it? Thanks
As the default config uses ports of Blob, Queue and Table Services were 127.0.0.1:10000, 10001, 10002.
Make Sure no other processes listening on the Azure Storage Emulator Ports.
How to check if any ports are in use:
Open the AzureStorageEmulator.exe.config from the path C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator in a text editor.
From an administrator command prompt run these commands:
netstat -p tcp -ano | findstr :10000
netstat -p tcp -ano | findstr :10001
netstat -p tcp -ano | findstr :10002
You need to stop if any process is using the above ports or reconfigure the ports in the AzureStorageEmulator.exe.config file in order to be the port not being used by any other application.
Again, Run the Command Prompt as Admin > navigate to the above path (Storage Emulator Path) > Run the Command: AzureStorageEmulator.exe init
The storage emulator was successfully initialized and is ready to use - this message you will see if command runs successfully,
If the init command is not successful, check the error details and also the status of Azure Storage Emulator by running this command:
C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator>AzureStorageEmulator.exe status
It should show IsRunning: True
If above steps didn't work, then check the Application Event log for any errors by going to the Event Viewer (available on Start button Search).
Try to Delete/Reinstall the Azurite or Azure Storage Emulator.
Please check these references for more information:
Run automated tests by using Azurite
Azurite Emulator
Azurite
If the accepted answer doesn't solve your problem, this worked for me:
Find the Visual Studio option
Projects and Solutions->Service Dependencies->Auto stop local services
and set it to False:
Related
I have developed a Windows-worker service and I want to start it in a docker-based environment for automated testing. Therefore I built it with the following command:
dotnet publish -r win-x64 -c Release /p:PublishSingleFile=true
Additionally I have the following Dockerfile:
FROM mcr.microsoft.com/windows/servercore/insider:10.0.17763.107
COPY ["Install/", "C:/Service/Name/"]
RUN powershell New-Service -Name "Name" -BinaryPathName "C:\Service\Name\Name.exe"
When trying to start the service with Start-Service -Name "Name" the startup takes long and the service stays in the state Starting and then I get an 1053-error in the Eventlog (LogName=System).
Due to the fact, that the service did not start I made another one, that is mainly based on the template in Visual Studio, so it should only log a message to the eventlog. This service has the same behavior. When installing it on my local machine everything works fine.
Do you have any ideas why the service remains in the state Starting even though it does already the tasks of the Running-state?
I solved the problem now, because I found the following issue: https://github.com/dotnet/runtime/issues/50020
UseWindowsService() does not work in Docker, so I had to specify WindowsServiceLifetime:
services.AddSingleton<IHostLifetime, WindowsServiceLifetime>();
I'm getting this problem using VSTS continuous deployment to azure
Web Deploy cannot modify the file 'XXX' on the destination because it is locked by an external process
the solution provided in this thread is to manually restart my app in azure, however he's not using VSTS and the question was asked 2 years ago, is this issue fixed on the current VSTS and if so, I would like to know how because I'm having the same problem as the link referenced above.
Thanks
You can use "EnableMSDeployAppOffline" feature to set your app offline before deployment by following the instruction here: Web publishing updates for app offline and usechecksum.
If it does not work, you can also create a PowerShell script as following to stop the app, deploy and then restart the app:
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
PowerShell Script from: Build and Deploy your ASP.NET 5 Application to an Azure Web App.
Essentially you need to stop - deploy - restart .
You have many options to do it but to more easy would be:
1- Extention: Azure App Services - Start and Stop
you can try the extension "Azure App Services - Start and Stop" https://marketplace.visualstudio.com/items?itemName=rbengtsson.appservices-start-stop
2- AzureCLI task
From the build or Deployment windows Add am Azure CLI task (currently in Preview)
Add one before the Deployment task
with Inline script:
azure webapp stop --resource-group NAME_OF_YOUR_RESOURCE_GROUP --name WEBAPP_NAME
Add another one after the Deployment task
with Inline script:
azure webapp start --resource-group NAME_OF_YOUR_RESOURCE_GROUP --name WEBAPP_NAME
I hope that help.
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.
I can launch my windows mobile application using the emulator via visual studio in the normal fashion, but i would like to run my application from the command line and preferably pass in some parameters. Is this possible?
I can launch the emulator ONLY using the command line like so:
DeviceEmulator.exe example.bin
But how can i possibly launch my application using this emulator via the command line?
Cheers
If you save the state of your emulator then you can run the created .DESS file and pick up right where the saved state left off. You can put this in a batch file:
start DeviceEmulator.exe /s "C:\Documents and Settings\user\Application Data\Microsoft\Device Emulator{E4FC2BC5-3AC4-452C-A893-AD4F273C3A7C}.dess" /nosecurityprompt /memsize 256
You'll need to change the path and file name to match your system. Here is a list of the DeviceEmulator.exe command line switches.
If you're looking for a more elegant solution, you can control DeviceEmulator.exe via a COM interface. See MSDN for more information.
--> Go to this file directory C:\Program Files (x86)\Microsoft Device Emulator\1.0\"
--> Use this command "DeviceEmulator.exe" "C:\Program Files (x86)\Windows Mobile 6.5.3 DTK\PocketPC\Deviceemulation\0409\PPC_USA_GSM_VR.BIN" /a /battery /batterycharge 100 /cpucore ARMv5 /memsize 256 /s "E:\MyCustomEmulator.dess" /skin "C:\Program Files (x86)\Windows Mobile 6.5.3 DTK\PocketPC\Deviceemulation\Pocket_PC_Phone\Pocket_PC_PE.xml" /tooltips ON /vfp false /vmname "My Custom Emulator" /z /speakerphone 7
Note:
.dess file Save the Emulator state. you can resume that saved state later.
.BIN is the actual emulator os. it is available when installing the windows mobile 6.5 sdks
.xml is the outer skin .
For more Details Visit this microsoft documentation page