My API Project settings:
"profiles": {
"LGSafetyAPI": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"launchUrl": "swagger",
"applicationUrl": "https://localhost:7295;http://localhost:5295",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "swagger",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
MVC Project settings are:
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:52964",
"sslPort": 44394
}
MVC project gives an ajax call to find API...but since the url is different it's trying to find
localhost:44394 instead of localhost:7295
how can I change these settings as per the environment?
I remember working with similar setup react project with .net api project..it worked seemlessly ..but somehow it looks hard here.
Check the JQuery Ajax request URL, try to use the fixed request URL, like this: