As a rule, it is not recommended to try to access configuration files from other assemblies / projects, since they usually are not output to the same directory during compilation.
Since TypeScript translates to JavaScript, you cannot read directly from the configuration file, no matter where it is located.
If you want to dynamically change the URLs for a service (say, from a DEV endpoint to a production checkpoint or endpoint), you can use the Razor Syntax in your HTML / CSHTML file to capture the value from the configuration file, and then enter the value in scripts OR , you can use Powershell during deployment to replace the values ββin your TypeScript files during the build process.
# Argument passed into PowerShell script (or write out URL string manually). $NewURL1 = $args[0]; $NewURL2 = "http://goodURL.com/api";
If your build / release agent allows it, you can run this Powershell script when deploying code in a specific environment. I use a similar script in VSTS / TFS in my definition after . I am copying files.
source share