The Code Metrics PowerTool is a command line utility that calculates
code metrics for your managed code and saves them to an XML file. This
tool enables teams to collect and report code metrics as part of their
build process. The code metrics calculated are:
Maintainability, IndexCyclomatic, ComplexityDepth of InheritanceClass CouplingLines Of Code (LOC)
نظرات مطالب
تنظیمات CORS در ASP.NET Core
یک نکتهی تکمیلی: ارتقاء به ASP.NET Core 2.2
در ASP.NET Core 2.2، امکان ترکیب AllowAnyOrigin و AllowCredential با هم وجود ندارد و در این حالت خطای ذیل را دریافت خواهید کرد:
Access to XMLHttpRequest at url from origin 'http://localhost:4200' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. GET http://localhost:4200/null 404 (Not Found)
app.UseCors(builder => builder .AllowAnyHeader() .AllowAnyMethod() .SetIsOriginAllowed((host) => true) .AllowCredentials() );
البته همانطور که در مطلب فوق نیز عنوان شد، از لحاظ امنیتی انتخاب متد ()AllowAnyOrigin و یا SetIsOriginAllowed((host) => true) صرفا برای حالت توسعه باید استفاده شوند. در حالت ارائهی نهایی، هر کدام از این دو که حضور نداشته باشند، تنظیم انجام شده با ()AllowCredentials بدون مشکل کار خواهد کرد:
services.AddCors(options => { options.AddPolicy("CorsPolicy", builder => builder .AllowAnyMethod() .AllowAnyHeader() .WithOrigins("http://localhost:4200") .AllowCredentials() .Build()); });
app.UseCors("CorsPolicy");
اشتراکها
کتاب Power BI از مبتدی تا پیشرفته
.NET MAUI for Beginners
8 videos
.NET Multi-platform App UI (.NET MAUI) is a framework for building modern, multi-platform, natively compiled iOS, Android, macOS, and Windows apps using C# and XAML in a single codebase. In this video series you will learn how to get started with .NET MAUI, C#, and Visual Studio to build your very first cross-platform desktop and mobile app.
اشتراکها