7 angular .net core
its the latest version
I am still having the issue. I have posted this to gitHub. https://github.com/aspnetzero/aspnet-zero-core/issues/2565
Using your suggested technique did not resolve the issue. Same error.
Update! I fixed my problem.
I am using Azure Dev ops for CI\CD. Our build pipleline was using NPM Install, it was working, but all of a sudden quit last week. After removing the NPM Install step and replacing it with YARN (In Preview). The resulting container images starting working. I presume NPM Install was not accuratly resolving the dependencies.
ASPNetZero support team, can you please update us as to your plan of action to address this? Thanks
I’m not using a merged project. i have seperate projects and docker containers for the host and angular apps.
oddly enough, everything was working fine a week ago. starting 7/3 newly built container images give the aforementioned error message.
yes, the logs for the running container have confirmed this.
I was finially able to get the chat feature to connect by modifiying CORS policy to include ".SetIsOriginAllowed((host)=> true)"
I don't know if this policy make the site more vulnerable to cross scripting attacks though, I will need to research further.
options.AddPolicy(DefaultCorsPolicyName, builder =>
{
//App:CorsOrigins in appsettings.json can contain more than one address with splitted by comma.
builder
.WithOrigins(
// App:CorsOrigins in appsettings.json can contain more than one address separated by comma.
_appConfiguration["App:CorsOrigins"]
.Split(",", StringSplitOptions.RemoveEmptyEntries)
.Select(o => o.RemovePostFix("/"))
.ToArray()
)
.SetIsOriginAllowedToAllowWildcardSubdomains()
.SetIsOriginAllowed((host)=> true)
.AllowAnyHeader()
.AllowAnyMethod()
.AllowCredentials();
});
my ASPNETCORE_ENVIRONMENT is set to "Staging". So i have configured my API project's appsettings.Staging.json to the following.
"ServerRootAddress": "https://orcatms.azurewebsites.net",
"ClientRootAddress": "https://orcaui.azurewebsites.net",
"CorsOrigins": "https://orcaui.azurewebsites.net"
When i remove the CORS setting from azure, and have the above mentioned configuration i get the following error on my site.
Access to XMLHttpRequest at 'https://orcatms.azurewebsites.net//AbpUserConfiguration/GetAll?d=1562107694929' from origin 'https://orcaui.azurewebsites.net' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.