Base solution for your next web application
Open Closed

Compiling Angular UI in Visual Studio #4599


User avatar
0
vladsd created

VS 2017 has built in support for npm and webpack and angular cli. It would be nice if you can provide steps how to update AngurlarUI project so it can be compiled, run and debugged right from Visual Studio.

Anyone have tried to that? I understand I can keep doing cli. It would nice to use VS debugger.

Thanks.


9 Answer(s)
  • User Avatar
    0
    manojreddy created

    @vladsd

    You can refer this [https://code.visualstudio.com/docs/languages/typescript])

  • User Avatar
    0
    alper created
    Support Team

    thank you @ ManojReddy

  • User Avatar
    0
    easyest created

    Current solution is not compatible with Visual Studio, You will not be able to run Angular directly from VS. On the other hand VS2017 already has quite clean Angular template, so You can port current code to that template. Moreover, I would suggest ASP.NET Zero would do the same, at least for the full stack .NET solution.

  • User Avatar
    0
    BobIngham created

    @vladsd Try using Visual Code and implement the Chrome debugging extension and add a configuration to launch.json (google it). I am also a VS2017 user but I find debugging simultaneously in Code and VS2017 works quite well.

  • User Avatar
    0
    vladsd created

    Thanks, I tried following this setup <a class="postlink" href="https://code.visualstudio.com/docs/editor/debugging">https://code.visualstudio.com/docs/editor/debugging</a> But this config fails to attach

    {
                "type": "node",
                "request": "attach",
                "name": "Attach",
                "port": 4200
            },
    

    Can yo share your launch.json file that works? Thanks so much.

  • User Avatar
    0
    easyest created

    Let me be google for You: <a class="postlink" href="https://github.com/Microsoft/vscode-chrome-debug">https://github.com/Microsoft/vscode-chrome-debug</a>

  • User Avatar
    0
    BobIngham created

    @vlad, try this:

    {  
        "version": "0.2.0",  
        "configurations": [{  
            "name": "Launch Chrome against localhost",  
            "type": "chrome",  
            "request": "launch",  
            "url": "http://localhost:4200",  
            "sourceMaps": true,  
            "webRoot": "${workspaceRoot}",  
            "sourceMapPathOverrides": {  
                "webpack:///./*": "${workspaceRoot}/*"  
            }  
        }]  
    }
    

    There are plenty of other examples, the key is to first add the Chrome extension to VSCode.

  • User Avatar
    0
    vladsd created

    @BobIngham, thanks so much, it works beautifully.

  • User Avatar
    0
    alper created
    Support Team

    great news! thanks for your feedback