Using Visual Studio 2017 in conjunction with Radzen

Can I use Visual Studio 2017 to write the code in custom controllers and debug application?
Do I have to do any additional configuration or just open the solution in visual studio?
I know I can use Visual Studio Code but I prefer Visual Studio 2017.

Visual Studio 2017 (Professional, Community or other edition) should work just fine with Radzen applications.

When running through visual studio I'm getting the error message below:

info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0]
User profile is available. Using 'C:\Users\Marden\AppData\Local\ASP.NET\DataProtection-Keys' as key repository and Windows DPAPI to encrypt keys at rest.
info: Microsoft.AspNetCore.SpaServices[0]
Starting @angular/cli on port 1995...
info: Microsoft.AspNetCore.SpaServices[0]
Starting @angular/cli on port 1995...
Hosting environment: Development
Content root path: D:\Dev\Projetos\Radzen\ColecaoRadzen\ColecaoRadzen\server
Now listening on: http://localhost:5000
Application started. Press Ctrl+C to shut down.
fail: Microsoft.AspNetCore.SpaServices[0]
'ng' não é reconhecido como um comando interno

fail: Microsoft.AspNetCore.SpaServices[0]
'ng' não é reconhecido como um comando interno

fail: Microsoft.AspNetCore.SpaServices[0]
ou externo, um programa operável ou um arquivo em lotes.
npm ERR! code ELIFECYCLE

fail: Microsoft.AspNetCore.SpaServices[0]
ou externo, um programa operável ou um arquivo em lotes.
npm ERR! code ELIFECYCLE

npmfail: Microsoft.AspNetCore.SpaServices[0]
npm ERR! errno 1
npm ERR! colecao-radzen@ start: ng serve "--port" "8000" "--open" "--" "--port" "1995"
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the colecao-radzen@ start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

fail: Microsoft.AspNetCore.SpaServices[0]
npm ERR! errno 1
npm ERR! colecao-radzen@ start: ng serve "--port" "8000" "--open" "--" "--port" "1995"
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the colecao-radzen@ start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

First make sure that Radzen isn't running. Then check if the following directory exists <your radzen app directory>\client\node_modules. If it exists delete it. Finally in order to run Radzen applications from Visual Studio you need to have NodeJS installed.

  • Radzen is not running
  • node_modules directory not exists in client directory
  • node.js 11.3.0
  • open solution with visual studio and run
  • same problem

Hi @marden,

Please call npm install in client folder before running from Visual Studio. The MS SPA service called npm install automatically at some point however it seems no longer, we will research how to fix this.

Best Regards,
Vladimir

HI @marden,

Just to let you know that we've released Radzen 2.8.6 where npm install will be called automatically. More info how to run Radzen app from VS Code, VS and cmd can be found here:
https://www.radzen.com/documentation/run-with-visual-studio/

Best Regards,
Vladimir

Hello @enchev

Thanks for the support, follow the step by step how I did it:

  • Open CMD with admin rights
  • Navigate to the client directory, mine is on disk D:\ I used the command below in CMD
    cd /d D:\Dev\Projetos\Radzen\ColecaoRadzen\ColecaoRadzen\client
  • Now that you are in the client directory run the command below in CMD
    nmp install
  • Wait for the installation
  • When you finish the installation open visual studio 2017
  • Set the project as startup project
  • Run the application

Hello @enchev

npm install installs a huge amount of packages, will I need all these packages?
Which IDE do you advise to use? Visual Studio or VS Code?
I would just like to have an efficient code editor to work in conjunction with Radzen, which provided me with intelisense and debug in a simple way

Yes, you need all of them.

It is a matter of choice, for me Visual Studio Code is better since it is lighter and still provides everything needed (debugging, intelisense, etc.). For C# I'm using GitHub - dotnet/vscode-csharp: Official C# support for Visual Studio Code

@enchev thank you very much :slight_smile: