Click here to Skip to main content
15,901,122 members

Comments by sencsk (Top 98 by date)

sencsk 18-Nov-21 4:16am View    
Its .Net Core Api 2.0. In the bin directory found only publish files. Local system its working fine but it's failing when we move to a different server.
sencsk 26-Oct-21 12:30pm View    
Thanks for the reply. I have enabled the log and observed some issue with node. But don't have details. Module Name: iisnode
Notification: EXECUTE_REQUEST_HANDLER
TYPE: MODULE_SET_RESPONSE_SUCCESS_STATUS
sencsk 10-Jun-21 7:56am View    
Yes, I am expecting the same. But i don't know the way to achive
sencsk 26-Nov-20 1:10am View    
Still no luck. I have tried all 3 implementations based on the shared url.i am attaching the startup.cs https://drive.google.com/file/d/1YN83mkgXWbeR26cz-D3tWNID-Zrqic_x/view?usp=sharing
sencsk 24-Nov-20 14:02pm View    
Below is my code for reference in startup file.

Configureservice:
services.AddCors(options =>
{
options.AddPolicy("AllowAll",
builder =>
{
builder.WithOrigins("https://webapp.io/", "https://www.webapp.io/")
.SetIsOriginAllowed((host) => true)
.AllowAnyHeader()
.AllowAnyMethod();
});
});
//CORS

services.AddControllers();


Configure:
public async void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
//var builder = new Microsoft.Extensions.Configuration.ConfigurationBuilder();
//builder.SetBasePath(env.ContentRootPath)
// .AddJsonFile("configuration.json", optional: false, reloadOnChange: true)
// .AddEnvironmentVariables();

//Configuration = builder.Build();
//CORS
//app.UseCors(builder => builder.AllowAnyHeader().AllowAnyMethod().SetIsOriginAllowed((host) => true).AllowCredentials());
app.UseCors("AllowAll");
app.UseMiddleware<corsmiddleware>();
// END CORS

await app.UseOcelot();
app.UseRouting();
app.UseAuthentication();
app.UseAuthorization();

app.UseEndpoints(endpoints =>
{
endpoints.MapControllers();
});
loggerFactory.AddLog4Net();
}
}