Base solution for your next web application
Ends in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Angular and Asp.net Zero One Solution #4603


User avatar
0
indriya created

I am working on Angular and Asp.net Zero Single Solution. I am getting an error when I run project: An Error Has Occurred (Error detail not sent by server). Not able to find the root cause of an error.

Both Url's are

appsettings.json "ServerRootAddress": "http://localhost:22742", "ClientRootAddress": "http://localhost:22742",

assets/appconfig.js "remoteServiceBaseUrl": "http://localhost:22742", "appBaseUrl": "http://localhost:22742",


5 Answer(s)
  • User Avatar
    0
    alper created
    Support Team

    your assets/appconfig.js looks like wrong! you cannot set the appBaseUrl port with the same port as host port.

    correct one (assets/appconfig.js)

    {
      "remoteServiceBaseUrl": "http://localhost:22742",
      "appBaseUrl": "http://localhost:4200",
      "localeMappings": [
        {
          "from": "pt-BR",
          "to": "pt"
        },
        {
          "from": "zh-CN",
          "to": "zh"
        }
      ]
    }
    
  • User Avatar
    0
    indriya created

    <cite>alper: </cite> your assets/appconfig.js looks like wrong! you cannot set the appBaseUrl port with the same port as host port.

    correct one (assets/appconfig.js)

    {
     "remoteServiceBaseUrl": "http://localhost:22742",
     "appBaseUrl": "http://localhost:4200",
     "localeMappings": [
       {
         "from": "pt-BR",
         "to": "pt"
       },
       {
         "from": "zh-CN",
         "to": "zh"
       }
     ]
    }
    

    Yes, Right. But I am using Single Project for Both angular and asp.net zero.

    to achieve with different URL's I would have to start npm explicitly. Reply

  • User Avatar
    0
    alirizaadiyahsi created

    Hi @indriya, is there any console error at client side?

  • User Avatar
    0
    alper created
    Support Team

    When you check the Logs of host what you see? write the exception thrown by server

  • User Avatar
    0
    indriya created

    <cite>alper: </cite> When you check the Logs of host what you see? write the exception thrown by server

    Got the Solution.. If you keep keys with comment in appconfig.js as well as appsettings.json you get this error

    Something like this :

    appsettings.json:

    //  "ServerRootAddress": "http://localhost:22742",
    //    "ClientRootAddress": "http://localhost:4200",
    

    appconfig.js

    //  "remoteServiceBaseUrl": "http://localhost:22742",
     // "appBaseUrl": "http://localhost:4200",
    

    Weird but worked for me