
вот что я попробовал:
- перешел в папку, где находится приложение
- щелкните по нему правой кнопкой мыши и выберите свойства
- свойства->вкладка «Безопасность» и передайте себе полный контроль. Ниже приведен скриншот:

Вот что у меня есть в файле web.config:
Код: Выделить всё
[img]https://i.sstatic.net /E4RW4UyZ.png[/img]
Это мой файл Startup.cs:
Код: Выделить всё
public class Startup
{
public IConfiguration Configuration { get; }
private const string DefaultConnection = "DefaultConnection";
public Startup(IConfiguration configuration)
{
Configuration = configuration;
}
public void ConfigureServices(IServiceCollection services)
{
services.AddDbContext(options =>
options.UseSqlServer(
Configuration.GetConnectionString(DefaultConnection)));
services.Configure(options =>
{
// This lambda determines whether user consent for non-essential cookies is needed for a given request.
options.CheckConsentNeeded = context => true;
options.MinimumSameSitePolicy = SameSiteMode.None;
});
//services.AddAuthentication(options =>
//{
// options.DefaultAuthenticateScheme = IISDefaults.AuthenticationScheme;
// options.DefaultChallengeScheme = IISDefaults.AuthenticationScheme;
//});
services.AddAuthentication(NegotiateDefaults.AuthenticationScheme)
.AddNegotiate();
services.AddAuthorization(options =>
{
options.FallbackPolicy = options.DefaultPolicy;
});
services.AddHttpContextAccessor();
services.AddControllersWithViews();
services.AddSingleton();
services.AddDistributedMemoryCache();
services.AddSession(options =>
{
options.IdleTimeout = TimeSpan.FromSeconds(120);
options.Cookie.HttpOnly = true;
options.Cookie.IsEssential = true;
});
services.AddRazorPages();
//services.AddMvc().AddRazorRuntimeCompilation();
services.BindingAppServices(Configuration);
services.Configure(x =>
{
x.ValueLengthLimit = int.MaxValue;
x.MultipartBodyLengthLimit = int.MaxValue; // In case of multipart
});
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
else
{
app.UseExceptionHandler("/Home/Error");
// The default HSTS value is 30 days.
app.UseHsts();
}
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseRouting();
app.UseAuthentication();
app.UseAuthorization();
app.UseSession();
app.UseEndpoints(endpoints =>
{
endpoints.MapControllerRoute(
name: "default",
pattern: "{controller=Employee}/{action=Create}/{id?}");
endpoints.MapRazorPages();
});
// app.MapRazorPages();
}
Подробнее здесь: https://stackoverflow.com/questions/784 ... entication