The .NET team has built a linker to reduce the size of .NET Core applications. It is built on top of the excellent and battle-tested mono linker. The Xamarin tools also use this linker so it makes sense to try it out and perhaps use it everywhere!
آکادمی برای روزلین
روش های مدرن برای ثبت خطا در سی شارپ
Logging is a big part of software development for many years now. One can argue that a logging mechanism is a must-have part of any application or library. I would agree with that statement. Logging has a crucial part to play in a scenario where you can’t use interactive debugging (that is, attaching a debugger like Visual Studio). It allows us to investigate errors after the problem already happened. In some cases, like Production Debugging, logs might be the only information you have.
کتابخانه amplitudejs
You already know how role-based authorization works in ASP.NET Core.
[Authorize(Roles = "Administrator")] public class AdministrationController : Controller { }
But what if you don't want hardcode roles on the Authorize
attribute or create roles later and specify in which controller and action it has access without touching source code?
DynamicAuthorization helps you authorize users without hardcoding role(s) on the Authorize
attribute with minimum effort. DynamicAuthorization is built at the top
of ASP.NET Core Identity and use identity mechanism for managing roles
and authorizing users.
افزودن و اعتبارسنجی خودکار Anti-Forgery Tokens در برنامههای Angular مبتنی بر ASP.NET Core
Antiforgery token validation failed. The provided antiforgery token was meant for a different claims-based user than the current user.
services.AddAuthorization(options => { options.AddPolicy(CustomRoles.Admin, policy => policy.RequireRole(CustomRoles.Admin)); options.AddPolicy(CustomRoles.User, policy => policy.RequireRole(CustomRoles.User)); options.AddPolicy(CustomRoles.Editor, policy => policy.RequireRole(CustomRoles.Editor)); }); // Needed for jwt auth. services .AddAuthentication(options => { options.DefaultChallengeScheme = siteSettings.JwtBearerDefaults.AuthenticationScheme; options.DefaultSignInScheme = siteSettings.JwtBearerDefaults.AuthenticationScheme; options.DefaultAuthenticateScheme = siteSettings.JwtBearerDefaults.AuthenticationScheme; }) .AddJwtBearer(cfg => { cfg.RequireHttpsMetadata = false; cfg.SaveToken = true; cfg.TokenValidationParameters = new TokenValidationParameters { ValidIssuer = Configuration["BearerTokens:Issuer"], // site that makes the token ValidateIssuer = false, // TODO: change this to avoid forwarding attacks ValidAudience = Configuration["BearerTokens:Audience"], // site that consumes the token ValidateAudience = false, // TODO: change this to avoid forwarding attacks IssuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(Configuration["BearerTokens:Key"])), ValidateIssuerSigningKey = true, // verify signature to avoid tampering ValidateLifetime = true, // validate the expiration ClockSkew = TimeSpan.Zero // tolerance for the expiration date };
NET 7 Preview 4. منتشر شد
The fourth preview of .NET 7 includes enhancements to observability in
the .NET implementation of OpenTelemetry, the addition of properties to
track microseconds and nanoseconds in date and time structures, new
metrics for caching extensions, performance-boosting “on stack
replacement,” APIs to work with .tar
archives, and additional features as part of an ongoing effort to
improve the performance of and add features to regular expressions in
.NET 7.