Can't publish Azure Function from Visual Studio for Mac - azure

I am trying to publish my Azure Functions from Visual Studio for Mac (8.10.6, build 10) and it does not work.
Everything works fine when running func start (obviously running from Visual Studio does not work as my Macbook has M1 processor and that is not supported yet).
What's more, when I created new function from template, I can publish it normally. I've read that it could be because of antivirus working on machine, but I expect that if I can publish other functions then it should work fine.
When trying to publish from Visual Studio I am getting:
/usr/local/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk.Publish/targets/PublishTargets/Microsoft.NET.Sdk.Publish.MSDeploy.targets(140,5): error : Web deployment task failed. (Web Deploy experienced a connection problem with the server and had to terminate the connection. Contact your server administrator if the problem persists. Learn more at: https://go.microsoft.com/fwlink/?LinkId=221672#ERROR_CONNECTION_TERMINATED.)
/usr/local/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk.Publish/targets/PublishTargets/Microsoft.NET.Sdk.Publish.MSDeploy.targets(140,5): error :
/usr/local/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk.Publish/targets/PublishTargets/Microsoft.NET.Sdk.Publish.MSDeploy.targets(140,5): error : Web Deploy experienced a connection problem with the server and had to terminate the connection. Contact your server administrator if the problem persists. Learn more at: https://go.microsoft.com/fwlink/?LinkId=221672#ERROR_CONNECTION_TERMINATED.
/usr/local/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk.Publish/targets/PublishTargets/Microsoft.NET.Sdk.Publish.MSDeploy.targets(140,5): error : Unexpected end of file has occurred. The following elements are not closed: results. Line 1, position 550.
Do you have any ideas why could that be?

Sounds like a firewall/access issue, check that VS is trusted and has access to connect to the internet
https://learn.microsoft.com/en-us/visualstudio/mac/install-behind-a-firewall-or-proxy-server?view=vsmac-2019

Related

Publish on Azure Website unexpected behavior

I have a web project, which works fine on local PC. But when I publish it on Azure Website, I get an error:
Could not load type 'Infrastructure.Asset.AssetContext' from assembly
'Infrastructure'. Description: An unhandled exception occurred during
the execution of the current web request. Please review the stack
trace for more information about the error and where it originated in
the code.
Exception Details: System.TypeLoadException: Could not load type
'Infrastructure.Asset.AssetContext' from assembly 'Infrastructure'.
where AssetContext is DbContext from another project inside solution. As I understand, this assembly is not published correctly on Azure. So, I removed all files on Azure Website via Kudu and republish again. The same. I try to connect to remote Db from my local - it works. I tried to rebuild solution, reopen Visual Studio etc. Nothing happened
Why it can be happened, what is wrong and how to fix?
There is a similar SO thread What could be causing a System.TypeLoadException in a Visual Studio Unit Test?, I think which answers are valuable for your current issue.
Please follow the figure below to get the information of what platform you used is on Azure Website, then to select the current mode in Visual Studio to build and publish.

LocalDB does not starts correctly for IIS worker process

When I deployed MVC application on IIS then localDB databse is not starting correctly. Error message is as follows:
Windows API call WaitForMultipleObjects returned error code: 575. Windows system error message is: {Application Error}
The application was unable to start correctly (0x%lx). Click OK to close the application.
Reported at line: 3621.
But the localDB is working fine with visual studio application and with sqlserver management studio. I already have restarted it and recreated it by command prompt to make it work. But nothing is working. The problem came when i re installed IIS in my machine.
How can i fix this. Any help will be appreciated.
Simply delete all files in "C:\Users\MYUSERNAME\AppData\Local\Microsoft\Microsoft SQL Server Local DB\Instances\v11.0" folder. Give write permissions to v11.0 folder. If you can't create another instance give write permission to Instances folder.

Got an error while running web api project on azure worker role

I was trying this tutorial: http://www.asp.net/web-api/overview/hosting-aspnet-web-api/host-aspnet-web-api-in-an-azure-worker-role and when I started to run the project for the first time I got the following error:
May be I need to add the emulator to windows firewall, but I don't know how to do that.
Found the solution on this page https://github.com/SignalR/SignalR/issues/1523 which is to run Visual Studio and Emulator as admin.

Windows store app deployment error

I just downloaded and installed Visual studio on my computer (windows 8.1) to start building windows 8 apps. The problem is when I try to run any application this error message shows up (the application from this error message is called Parcels.comStarter):
Error 1 Error : DEP0700 : Registration of the app failed. Deployment
Register operation on Package
a783768f-d79c-495b-bf64-e59e4297fb42_1.0.0.0_neutral__1mfyfctfxa0tr
from:
(d:\Gebruikers\wardv_000\Downloads\Parcels.comStarter\Parcels.comStarter\Parcels.com\bin\Debug\AppX\AppxManifest.xml)
failed with error 0x8E5E0530. See
http://go.microsoft.com/fwlink/?LinkId=235160 for help diagnosing app
deployment issues. (0x80073cf9) Parcels.com
I searched the entire internet but I didn't found a solution. I also did reinstall visual studio and I still have the problem.
Thanks in advance
Open the Services management console (services.msc) and stop the Windows Installer service.
In Windows Explorer, go to C:\ProgramData\Microsoft\Windows\AppRepository\ and rename PackageRepository.edb to PackageRepository.edb.backup.
Back in the management console, restart the Windows Installer service.
Now run Visual Studio as an administrator and open your project.
I was having this exact same problem, and the solution for me was to unlink my Windows account from my Microsoft account.
There are a couple of things to try.
Run WSReset (press [Win] then type wsreset)
Delete the metastore and remotemetastore folder here: C:\Users\%userprofile%\AppData\Local\Microsoft\Windows\SettingSync where %userprofile% is your username. (I suggest just renaming them to metastore.old and remotemetastore.old)
Make sure that there are no staged packages for the app in question.
If you re-deployed an app that was already installed by some other user, then you would get a deployment error. This should wear off if you change the identity in your package.appxmanifest fie.
You should try an OS refresh. You should not lose your apps and settings.
After that re-link your windows account to microsoft account.
If that doesnt work...The problem may be that visual studio is not able to delete the application data in local folder. So when you go in the location C:\Users\UserName\AppData\Local\Packages you will find application data of app installed in your computer, now you need to find your app's application data and delete the folder. The folder name is the same as the package family name which you can see in your solution.
now again open the solution and rebuild and your app will run. (hopefully)
close visual studio and simulator before deleting the folder.
make sure that your account is set as administrator.
I had the same problem with visual studio running under Parallels VM. The solution was to copy the project from a cloud based directory to a local directory.

Debugging Azure: window popup says The web browser can not be started

I have a web application asp.net to deploy to Windows Azure. This application contains one web role. I try to run it on local first. But when debugging, I catch this error from VS2010: "Window Azure Tools for Microsoft Visual Studio
The Web Browser can not be started. To resolve this problem, you must restart Windows."
I have restarted windows several times, but there was no luck.![enter image description here][1]
I've search so hard to find the solution for this problem but there's nothing seems work for me. I'm a newbie in Windows Azure, it's really a big trouble with me. Please help me! Thanks a lot. Best Regards.
There could be two problems:
Problem with your IIS settings: It is possible that there is a problem with your IIS in your machine which could not be restarted when VS2010, wants to run it.
To verify it what you can do it launch your Web Role using "View in Browser" setting and see if your Web Role can run in IIS, you will see the web role started in a URL as http:\localhost:XXXXX and that would be the first step to resolved.
Problem will your Windows Azure SDK which could not launch the WebBrowser to run in IIS
If you don't have problem in this step #1, then it is possible that Windows Azure SDK has some problem trying to start your IIS from external process and this could be caused by corrupted SDK installation or any other reason.
If that is the case try:
remove all Windows Azure SDK components from your machine.
Restart the machine, Install Azure SDK from here for VS2010
After SDK install, restart the VS2010 in admin mode and try created a hello world webrole and see what happens.

Resources