Can someone please help me. I am stuck here and not able to run my angular site after deploying. thanks
I did not change any code in startup.cs which has the corsorgin code
//Configure CORS for angular2 UI
services.AddCors(options =>
{
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()
)
.AllowAnyHeader()
.AllowAnyMethod()
.AllowCredentials();
});
});
I did not change any code in startup.cs which has the corsorgin code //Configure CORS for angular2 UI services.AddCors(options => { 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() ) .AllowAnyHeader() .AllowAnyMethod() .AllowCredentials(); }); });
and here is my appsettings.json on server
"App": { "ServerRootAddress": "http://server-001-site1.itempurl.com", "ClientRootAddress": "http://client-001-site1.gtempurl.com", "CorsOrigins": "http://client-001-site1.gtempurl.com" },
Ok after giving read/write permission to asp.net, i see the log file and here is the details of the log
....
...
DEBUG 2018-08-26 22:41:35,300 [1 ] Abp.BackgroundJobs.BackgroundJobManager - Start background worker: Abp.BackgroundJobs.BackgroundJobManager
DEBUG 2018-08-26 22:41:35,382 [1 ] Abp.AutoMapper.AbpAutoMapperModule - Found 2 classes define auto mapping attributes
DEBUG 2018-08-26 22:41:35,384 [1 ] Abp.AutoMapper.AbpAutoMapperModule - Events.Web.Models.TokenAuth.ExternalLoginProviderInfoModel
DEBUG 2018-08-26 22:41:35,390 [1 ] Abp.AutoMapper.AbpAutoMapperModule - Events.Friendships.Cache.FriendCacheItem
DEBUG 2018-08-26 22:41:42,492 [1 ] enancy.SubscriptionExpirationCheckWorker - Start background worker: Events.MultiTenancy.SubscriptionExpirationCheckWorker
DEBUG 2018-08-26 22:41:42,495 [1 ] cy.SubscriptionExpireEmailNotifierWorker - Start background worker: Events.MultiTenancy.SubscriptionExpireEmailNotifierWorker
INFO 2018-08-26 22:41:43,892 [3 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 OPTIONS <a class="postlink" href="http://server-001-site1.itempurl.com/AbpUserConfiguration/GetAll">http://server-001-site1.itempurl.com/Ab ... ion/GetAll</a>
INFO 2018-08-26 22:41:43,976 [3 ] pNetCore.Cors.Infrastructure.CorsService - Policy execution failed.
INFO 2018-08-26 22:41:43,977 [3 ] pNetCore.Cors.Infrastructure.CorsService - Request origin <a class="postlink" href="http://client-001-site1.gtempurl.com">http://client-001-site1.gtempurl.com</a> does not have permission to access the resource.
INFO 2018-08-26 22:41:44,090 [3 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 204.2933ms 204
The error is happening in the server after the deployment and not in my local machine. I do not see any folder called "App_data"
Hi After deploying angular, once i login, to the dashboard, i see the following error.
scripts.4769eab2c29e62566639.js:1 WebSocket connection to 'ws://sandboxserver.somedomain.com/signalr?enc_auth_token=wNYmO41%2F48SHNstaLVXxHCCre29BZQl1NhC6NM3R3rzpXtPQxVzH6jEzA%2FQhXFN5tu6Fk7pO53uppm1mVXMZgxbyRVz26dnepi%2FFyB6axBY%2B6gq1GL%2BuRQgoiFUCjRN2p8w6LevViwKlHyWZZJZO1DGVSjAi1m2U%2Bog9pkHw9%2FQR4Nl%2FDPnoP9JYDMpZ1zxx09u6s0GZ9%2FQ5Sjk%2BL0UfcSCbl38X8he5w9UIn%2FHvxh7ysM1CiPLsoOwtbiieSRVmrmt0JjnipAn4%2FK283F8GrGwzwgehWsqefmUnM0ckMwP9ZAdwQxWDhxv0IqNw4tDhwUYs%2F1SYdYozdNzgByhgNOBPzQDObNLlWc4vV5VMOiZ%2B4sgIs%2B%2FcBC813%2BM3dHDtOCXR8nhbk37Kq5Z1zwKPyzmhnQfT8YxO9zPn48...EYiw1JInKewaInQql3IIibk%2B5ByfkYw6tx6NJafOyli0%2FNlHiGdPntZ0LUxTMuQO3S7DBmQi%2BBNHNmdoHEwXdobwG2mRerTvKce%2BCqZ4TCrLD3Lsg4EIBX%2BIy9df829lsYkLP2y%2Bp0gxT5hdqUufJocaor5z47bxoGxTuF6SO72loy33r65WDVO0yMYjUv%2BCgweIDhUYtDbsr8puTWYtZS3cyggHND5%2FrVn%2BNQE6cb7ml3RhUFvAQ%2FN8UUVlNHqVzRoFF8Ikf%2FFCt4DcT1nLXepNw1RpbQZPlA7PCq7rrjkNBodCE2YymCsHZ7UMHEwLt0cgOv%2BVYGZ8IOw89AHHenA4AT6ARN1mAOEYll0QdL%2F157CGC6mJ%2BRVMOq2WaV6AZHVDJNXR51c0w2moDwQP0iMSCAwAil6B2Tinimf2nSiGkg3%2BDdR1R%2BpvJLVPcO8OE%3D&id=qBcA7RkYA429sKecjdxIpA' failed: Error during WebSocket handshake: 'Sec-WebSocket-Accept' header is missing (anonymous) @ scripts.4769eab2c29e62566639.js:1 .. ..
scripts.4769eab2c29e62566639.js:1 Error: Failed to start the connection: Error: Unable to initialize any of the available transports.
What is missing. I did not touch any singalR code. I never had issue in my local.
I do not have any app data folder.
No, both are different.
sandboxServer.domain.com sandboxClient.domain.com
HI I deployed the server and angular to 2 different sub-domain
When i access the angular site, i get the following error.
Failed to load http://sandboxserver.xxxxxx.com/AbpUserConfiguration/GetAll: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://sandboxclient.xxxxxxxx.com' is therefore not allowed access.
Here are my config details: <ins>On server side: - appsettings.json (same for production.json and sandbox.json)</ins>
{
"ConnectionStrings": {
"Default": "Data Source=xxxxxxx"
},
"App": {
"ServerRootAddress": "http://sandboxServer.xxxxxx.com",
"ClientRootAddress": "http://sandboxClient.xxxxxx.com",
"CorsOrigins": "http://sandboxClient.xxxxx.com, http://*"
}
}
On client side appconfig.json (same for appconfig.production.json)
{
"remoteServiceBaseUrl": "http://sandboxServer.xxxxxxxx.com",
"appBaseUrl": "http://sandboxClient.xxxxxxxxx.com",
"localeMappings": [
{
"from": "pt-BR",
"to": "pt"
},
{
"from": "zh-CN",
"to": "zh"
},
{
"from": "he-IL",
"to": "he"
}
]
}
I have also tried with the custom header on the server side web.config with the following and still doesn't work.
<add name="Access-Control-Allow-Headers" value="*" />
What am i missing?