Base solution for your next web application
Open Closed

Merge Angular Project to Asp-Core Project #2987


User avatar
0
somnathswami created

Hello, I want Angular project under one single solution how i need to be merge Angular Project from startup template to asp-core Project -> web.host. I had tried using this <a class="postlink" href="https://aspnetzero.com/Documents/Merge-Angular-Client-Server#PubStep3">https://aspnetzero.com/Documents/Merge- ... r#PubStep3</a> but it is not work for me..? :oops:

Thanks and regards Somnath


4 Answer(s)
  • User Avatar
    0
    th3monk3y created

    Hi SomnathSwami, In my opinion that is not a good move. Keep your front end separate. This is what's called a separation of concerns.

    What I did was turn the angular project (front end) into a VSCode project. I'm using nodeJS to launch chrome browser. There is an extension for VScode called Debugger for Chrome. Using this extension you are able to break in your typescript code. Package management is also much better going this route as you can open a terminal in VsCode much like package manager console in Visual Studio. I've included my VsCode debug configuration for anyone that's interested.

    Hope this helps...

    {
        // Use IntelliSense to learn about possible Node.js debug attributes.
        // Hover to view descriptions of existing attributes.
        // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
        "version": "0.2.0",
    
        "configurations": [
            {
                "name": "Launch Chrome against localhost, with sourcemaps",
                "type": "chrome",
                "request": "launch",
                "url": "http://localhost:4200",
                // This forces chrome to run a brand new instance, allowing existing
                // chrome windows to stay open.
                "userDataDir": "${workspaceRoot}/.vscode/chrome",
                "sourceMaps": true,
                "webRoot": "${workspaceRoot}",
                //"diagnosticLogging": true,
                "sourceMapPathOverrides": { "webpack:///./*": "${webRoot}/*" }
            },
            {
                "name": "Attach to Chrome, with sourcemaps",
                "type": "chrome",
                "request": "attach",
                "url": "http://localhost:4200",
                "port": 9222,
                "sourceMaps": true,
                "webRoot": "${workspaceRoot}",
                "diagnosticLogging": true,
                "sourceMapPathOverrides": { "webpack:///./*": "${webRoot}/*" }
            }
        ]
    }
    
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    I agree with @th3monk3y, but sometimes there might be a need for that.

    @SomnathSwami, if you can share your error message, we can try to help.

    Thanks.

  • User Avatar
    0
    somnathswami created

    Hi this is error messages shown to me

    Severity Code Description Project File Line Suppression State Error TS2304 Cannot find name 'XMLHttpRequest'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 171 Active Error TS2304 Cannot find name 'Event'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 492 Active Error TS2304 Cannot find name 'Element'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 497 Active Error TS2304 Cannot find name 'Element'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 507 Active Error TS2304 Cannot find name 'Event'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 532 Active Error TS2304 Cannot find name 'Element'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 542 Active Error TS2304 Cannot find name 'Element'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 562 Active Error TS2304 Cannot find name 'Element'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 916 Active Error TS2304 Cannot find name 'Element'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 924 Active Error TS2304 Cannot find name 'Element'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 932 Active Error TS2304 Cannot find name 'Document'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 971 Active Error TS2304 Cannot find name 'Element'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 1018 Active Error TS2304 Cannot find name 'Element'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 1026 Active Error TS2304 Cannot find name 'Element'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 1033 Active Error TS2304 Cannot find name 'Element'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 1042 Active Error TS2304 Cannot find name 'Element'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 1050 Active Error TS2304 Cannot find name 'Element'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 1059 Active Error TS2304 Cannot find name 'Element'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 1068 Active Error TS2304 Cannot find name 'Element'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 1077 Active Error TS2304 Cannot find name 'Element'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 1086 Active Error TS2304 Cannot find name 'Element'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 1163 Active Error TS2304 Cannot find name 'Element'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 1163 Active Error TS2304 Cannot find name 'Window'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 1281 Active Error TS2304 Cannot find name 'Node'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 1288 Active Error TS2304 Cannot find name 'XMLDocument'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 1350 Active Error TS2304 Cannot find name 'Element'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 1374 Active Error TS2304 Cannot find name 'HTMLElement'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 1384 Active Error TS2304 Cannot find name 'Document'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 1394 Active Error TS2304 Cannot find name 'XMLHttpRequest'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 1409 Active Error TS2304 Cannot find name 'XMLHttpRequest'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 1444 Active Error TS2304 Cannot find name 'XMLHttpRequest'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 1454 Active Error TS2304 Cannot find name 'Element'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 3039 Active Error TS2304 Cannot find name 'Element'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 3083 Active Error TS2304 Cannot find name 'DocumentFragment'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 3083 Active Error TS2304 Cannot find name 'Text'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 3083 Active Error TS2304 Cannot find name 'Element'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 3090 Active Error TS2304 Cannot find name 'Element'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 3099 Active Error TS2304 Cannot find name 'DocumentFragment'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 3099 Active Error TS2304 Cannot find name 'Text'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 3099 Active Error TS2304 Cannot find name 'Element'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 3106 Active Error TS2304 Cannot find name 'Element'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 3114 Active Error TS2304 Cannot find name 'Element'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 3123 Active Error TS2304 Cannot find name 'DocumentFragment'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 3123 Active Error TS2304 Cannot find name 'Text'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 3123 Active Error TS2304 Cannot find name 'Element'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 3130 Active Error TS2304 Cannot find name 'Element'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 3161 Active Error TS2304 Cannot find name 'Text'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 3161 Active Error TS2304 Cannot find name 'Element'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 3169 Active Error TS2304 Cannot find name 'Text'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 3169 Active Error TS2304 Cannot find name 'Element'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 3178 Active Error TS2304 Cannot find name 'DocumentFragment'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 3178 Active Error TS2304 Cannot find name 'Text'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 3178 Active Error TS2304 Cannot find name 'Element'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 3185 Active Error TS2304 Cannot find name 'Element'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 3193 Active Error TS2304 Cannot find name 'Element'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 3209 Active Error TS2304 Cannot find name 'Element'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 3217 Active Error TS2304 Cannot find name 'Text'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 3217 Active Error TS2304 Cannot find name 'Element'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 3224 Active Error TS2304 Cannot find name 'HTMLElement'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 3251 Active Error TS2304 Cannot find name 'Element'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 3265 Active Error TS2304 Cannot find name 'Element'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 3280 Active Error TS2304 Cannot find name 'Element'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 3295 Active Error TS2304 Cannot find name 'Element'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 3310 Active Error TS2304 Cannot find name 'HTMLElement'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 3318 Active Error TS2304 Cannot find name 'HTMLElement'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 3324 Active Error TS2304 Cannot find name 'Element'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 3337 Active Error TS2304 Cannot find name 'HTMLElement'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 3351 Active Error TS2304 Cannot find name 'Element'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 3360 Active Error TS2304 Cannot find name 'Element'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 3367 Active Error TS2304 Cannot find name 'Element'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 3405 Active Error TS2304 Cannot find name 'Element'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 3419 Active Error TS2304 Cannot find name 'Element'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 3428 Active Error TS2304 Cannot find name 'Element'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 3463 Active Error TS2304 Cannot find name 'Element'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 3470 Active Error TS2304 Cannot find name 'Element'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 3492 Active Error TS2304 Cannot find name 'Element'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 3520 Active Error TS2304 Cannot find name 'Element'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 3535 Active Error TS2304 Cannot find name 'Element'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 3563 Active Error TS2304 Cannot find name 'Element'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 3596 Active Error TS2304 Cannot find name 'Element'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 3619 Active Error TS2304 Cannot find name 'Element'. e2e (tsconfig project) E:\Projects\Bob Morelly\TLC\aspnet-core\src\TLC.Web.Host\wwwroot\node_modules@types\jquery\index.d.ts 3626 Active

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    I think your project is working when you use "npm start" on command prompt, right ? This is a problem related to Visual Studio I think. Can you try to exclude node_modules folder from your project ? It has a example usage here <a class="postlink" href="https://www.typescriptlang.org/docs/handbook/tsconfig-json.html">https://www.typescriptlang.org/docs/han ... -json.html</a>.