I’ve vue project.
when i run project following message shows.
Hosting environment: Development
Content root path: D:Vue ProjectsRifahriphah_cmssrcserver
Now listening on: https://localhost:8071
Now listening on: http://localhost:8070
Application started. Press Ctrl+C to shut down.
but when i hit url https://localhost:8071 or http://localhost:8070
it start loading and give following exception.
fail: Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware[1]
An unhandled exception has occurred while executing the request.
System.Threading.Tasks.TaskCanceledException: The operation was canceled. --->
System.IO.IOException: Unable to read data from the transport connection:
The I/O operation has been aborted because of either a thread exit or an application request.
---> System.Net.Sockets.SocketException: The I/O operation has been aborted because of either a thread exit or an application request
--- End of inner exception stack trace ---
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error)
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.GetResult(Int16 token)
at System.Net.Http.HttpConnection.FillAsync()
at System.Net.Http.HttpConnection.ReadNextResponseHeaderLineAsync(Boolean foldedHeadersAllowed)
i am using oracle db which i’ve checked through telnet is ok.
Any suggestion.
Startup.cs as
namespace Ucp.Server
{
public partial class Startup
{
public IServiceProvider ConfigureServices(IServiceCollection services)
{
var config = WebApp.Configuration.Get<Ucp.Server.AppConfig>();
services.AddHttpClient<ITurnitinService, TurnitinService>(client =>
{
client.BaseAddress = new Uri("https://api.ithenticate.com/rpc");
client.Timeout = TimeSpan.FromMinutes(2);
});
services.AddOptions();
services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>();
services.Configure<ForwardedHeadersOptions>(options =>
{
options.ForwardLimit = 2;
options.KnownProxies.Add(IPAddress.Parse("192.168.1.122"));
options.KnownProxies.Add(IPAddress.Parse("117.20.21.108"));
options.ForwardedForHeaderName = "OrignialIP";
});
services.Configure<AppConfig>(WebApp.Configuration);
services.Configure<Ucp.Service.Config>(WebApp.Configuration.GetSection("service"));
services.Configure<Ucp.Service.TokenProviderConfig>(WebApp.Configuration.GetSection("service:tokenProvider"));
services.Configure<Ucp.Data.Config>(WebApp.Configuration.GetSection("data"));
services.Configure<Ucp.Server.Config>(WebApp.Configuration.GetSection("server"));
services.Configure<GzipCompressionProviderOptions>(options => options.Level = System.IO.Compression.CompressionLevel.Optimal);
services.AddResponseCompression(options =>
{
options.MimeTypes = new[]
{
"text/plain",
"text/css",
"application/javascript",
"text/html",
"application/xml",
"text/xml",
"application/json",
"text/json",
"image/svg+xml"
};
});
services.AddMemoryCache();
services.AddDetection();
services.AddSingleton<IFileProvider>(
new PhysicalFileProvider(Directory.GetCurrentDirectory()));
services.ConfigureAuthentication(config.Service.TokenProvider, new string[] { "admin" });
services.ConfigureMvc(config.Server.AntiForgery);
services.AddDbContext<OracleContext>(options =>
{
string assemblyName = typeof(Ucp.Data.Config).GetAssemblyName();
options.UseLazyLoadingProxies().UseOracle(config.Data.ConnectionString, s => s.MigrationsAssembly(assemblyName));
});
services.AddLocalization(options => options.ResourcesPath = "Resources");
services.Configure<RequestLocalizationOptions>(options =>
{
var supportedCultures = new List<CultureInfo>
{
new CultureInfo("en-US"),
new CultureInfo("en"),
// Add other supported cultures here
};
options.DefaultRequestCulture = new RequestCulture("en-US");
options.SupportedCultures = supportedCultures;
options.SupportedUICultures = supportedCultures;
options.RequestCultureProviders.Insert(0, new AcceptLanguageHeaderRequestCultureProvider());
});
var container = new Container(c =>
{
var registry = new Registry();
registry.IncludeRegistry<Ucp.Common.ContainerRegistry>();
registry.IncludeRegistry<Ucp.Data.ContainerRegistry>();
registry.IncludeRegistry<Ucp.Service.ContainerRegistry>();
registry.IncludeRegistry<Ucp.Server.ContainerRegistry>();
c.AddRegistry(registry);
c.Populate(services);
});
return container.GetInstance<IServiceProvider>();
}
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
{
AppConfig config = WebApp.Configuration.Get<Ucp.Server.AppConfig>();
IConfigurationSection logging = WebApp.Configuration.GetSection("Logging");
if (logging.GetSection("Debug").Exists())
loggerFactory.AddDebug();
if (logging.GetSection("Console").Exists())
loggerFactory.AddConsole(logging.GetSection("Console"));
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
app.UseWebpackDevMiddleware(new WebpackDevMiddlewareOptions()
{
HotModuleReplacement = true,
ProjectPath = Path.Combine(Directory.GetCurrentDirectory(), @"..ui")
});
}
app.UseDefaultFiles();
app.UseAuthentication();
app.UseResponseCompression();
app.UseMiddleware<NoCacheMiddleware>();
string webRoot = new DirectoryInfo(config.Server.Webroot).FullName;
app.UseStaticFiles(new StaticFileOptions()
{
FileProvider = new PhysicalFileProvider(webRoot),
OnPrepareResponse = (content) =>
{
var cultureService = content.Context.RequestServices.GetRequiredService<CultureService>();
cultureService.EnsureCookie(content.Context);
}
});
app.UseMiddleware<NoCacheMiddleware>();
app.UseAntiforgeryMiddleware(config.Server.AntiForgery.ClientName);
var localizationOptions = app.ApplicationServices.GetService<IOptions<RequestLocalizationOptions>>().Value;
app.UseRequestLocalization(localizationOptions);
app.UseMvc();
app.UseForwardedHeaders(new ForwardedHeadersOptions
{
ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto
});
app.UseHistoryModeMiddleware(webRoot, config.Server.Areas);
using (var serviceScope = app.ApplicationServices.GetRequiredService<IServiceScopeFactory>().CreateScope())
{
using (var dbContext = serviceScope.ServiceProvider.GetService<DbContextBase>())
{
ICryptoService crypto = app.ApplicationServices.GetRequiredService<ICryptoService>();
dbContext.Database.Migrate();
dbContext.EnsureSeedData(crypto);
}
}
}
}
}
enter namespace Ucp.Server
{
public class WebApp
{
internal static IConfigurationRoot Configuration;
public static void Main(string[] args)
{
var root = Directory.GetCurrentDirectory();
Configuration = new ConfigurationBuilder()
.SetBasePath(root)
.AddUcp()
.Build();
var host = new WebHostBuilder()
.UseConfiguration(Configuration)
.UseKestrel()
.UseContentRoot(root)
.UseStartup<Startup>()
//.UseUrls("http://172.19.30.19:5000")
.Build();
host.Run();
}
}
}
some days before it work fine and now without any changes when I run it give above error.
using node 10