How to run/debug Azure Cloud Service locally on Visual Studio Code? - azure

I have an Azure Cloud Service solution in Visual Studio 2017 which I debug with Emulator Express.
I'd like "migrate" from Visual Studio to Visual Studio Code. I mean that I'd like to be able to run/debug my cloud service(web role project) in VSCode without the use of Visual Studio at all.
My solution has two project:
Service project - contains .csdef, .ccproj and multiple .cscfg.
Role project - contains the .csproj file and the rest of the sample web role project.
I've tried:
I'm building both of the projects with msbuild, the same way it's been built in visual studio. The problem is running the site locally.
Run a local site with IIS Express VSCode extension and configure the web role project root as site root. It didn't work, I tried to browse the site but I got a notification that the folder of the site can't be viewed as a directory. When I think of it this option is missing all the configuration that is defined in the Service project so how is it suppose to work? Does IIS Express can run an Azure cloud service app locally? Maybe I configure a wrong path?
I've tried running csrun.exe command multiple times with different arguments. Something like this:
"C:\Program Files\Microsoft SDKs\Azure\Emulator\csrun.exe"
/run:./csx/Debug/roles/WebRoleProject/approot;./ServiceConfiguration.myconfig.cscfg /launchBrowser
/launchDebugger:%systemroot%/System32/vsjitdebugger.exe
It gave me the following error:
The compute emulator had a error: Can't locate service descriptions..
I also saw here that compute emulator(csrun.exe) needs visual studio opened as administrator, so maybe it's not possible to run it without it..

I’ve verified this question with the Azure Cloud Compute team and this is not supported in VSCode, they only built an extension for Visual Studio.

Related

Is there a way to publish an Azure Function from VS code using publish profile as we do in Visual studio?

I'm trying to publish a Node JS azure function from my VS Code. I have a publish profile file with all the credentials in it. How Can I instruct the VS code to use the publish profile?
I'm able to do it from the Visual studio for .Net function Apps. If its not possible from VS code , Is there a way to publish a node js azure function using publish profile from Visual studio?
This Publish Settings is only applies to Visual Studio IDE but not for VS Mac and VS Code as specified in this MS Doc of Azure Functions Publish Profile.
Visual Studio is mainly designed for .NET Core / Framework Project developments, but non-.NET Language can be compiled and debugged with the help of 3rd Party extensions in Visual Studio.
As it is mentioned in above MS Doc & Image, the Publish Profile for .NET Core/framework applications and can be accessible in Visual Studio IDE.

Unable to connect to the Microsoft Visual Studio Remote Debugger. Operation not supported. Unknown error: 0x80004005

I have deployed the following API as is to an Azure App Service from Visual Studio.
I have made sure that I have Remote Debugging and Visual Studio version 2022 selected in General settings in the App Service Configuration.
When I try and attach process from Visual Studio to my App Service I get thefollowing error:
In VS 2022, We have an easy and direct way to attach debugger.
After publishing your WebApp, In Hosting settings we will find an option to Attach Debugger.
Once debugger is attached, Remote debugging is enabled in Portal => Configuration Settings automatically.
Place a break point in any of the form which you want to debug.
Visual Studio finds the process, all the symbols will be loaded, and debugger is attached.

Visual Studio only publishes hostingstart.html to Azure

I have two ASP.Net Project. Project A is an earlier/older version of Project B. I used the publish functionality of Visual Studio to publish the .web project to Azure. Project A seems to get published successfully, and I can go to its Azure website in Chrome. But project B seems to succeed but when I browse to its site, I get a default Azure page stating "Your App Service is up and running".
Within Azure, I then go to Project B -> Development Tools -> Console and I simply enter ls to list the root directory contents. I simply get hostingstart.html.
When I do the same with Project A, I get: App_Readme Content Global.asax Images NewImages Scripts Views Web.config bin favicon.ico hostingstart.html packages.config
When I did the publish, I had Visual Studio running in Administrator Mode.
Also when I use IIS Express to locally deploy/publish, both sites load up and work fine.
I did not originally work on the two Projects. I simply inherited them, so I wouldn't know what was changed between A and B.
Is there something I have to enable in Project B to allow all the required files to be included in the publish?

Desktop application publishing to FTP in VS Express 2012

I'm trying to publish a desktop application to a FTP location for updating over the web. Conceptually this works fine, I've published to my local disk, manually copied the files up there, installed from that location, and updates are automatically installed.
Ideally though I'd like to not have to publish to local and copy, I'd like to publish straight to FTP or even WebDAV. When entering an FTP location though I get this error:
Failed to connect to 'ftp://xxx.xxx.xxx/' with the following error: Unable to create the Web site 'ftp://xxx.xxx.xxx'.
The components for communicating with FrontPage Server Extensions are not installed.
Google tells me that on previous Visual Studio versio I could add the "Visual Studio Web Authoring Component" through Add/Remove programs and repair, but that doesn't exist in VS 2012. I'm using VS Express 2012 for Windows Desktop.
How do I install the required components?
Installing Visual Studio Express 2012 for Web gives you the right components:
Article: http://msdn.microsoft.com/en-us/library/dd537667.aspx
Download: http://www.microsoft.com/web/downloads/platform.aspx?templang=de-de
Sidenotes:
The FrontPage Server Extension is available as Apache Mod, and IIS extension.
IIS: http://www.iis.net/learn/publish/frontpage-server-extensions/installing-the-frontpage-server-extensions-on-iis#02
Apache: http://docs.cpanel.net/twiki/bin/view/EasyApache/Apache/ModFrontPage

How to create a Web App project without page.designer.cs files?

In Visual Studio 2012 there is no website deployment, ok I switched to Web Project, now it has generated tons of page.designer.cs files, how can I make a web app project without the designer.cs files ?
Visual Studio create these files for easiness of coder, you will always get these kind of files when you create a new web app project. These files creates the necessary code you need for designing the web page.
But once you publish the web app to the server using the VS2010 publisher, these files are gone and only the .aspx files are remained. Why does this happen? because your code i.e. .cs files needs to compiled before it can be published on the server.

Resources