If you stumble into this with no idea who I am or why I’m arrogant enough to think I’m qualified to potentially criticize the ASP.Net Core internals, I’m the primary author of both StructureMap (the IoC container) and an alternative “previous generation” OSS web development framework called FubuMVC that tackled a lot of the same problems that ASP.Net Core addresses now that were not part of older ASP.Net MVC or Web API.
Security Advisory Notice for 16.6.2
CVE-2020-1108 / CVE-2020-1108.NET Core Denial of Service Vulnerability
To comprehensively address CVE-2020-1108, Microsoft has released updates for .NET Core 2.1 and .NET Core 3.1. Customers who use any of these versions of .NET Core should install the latest version of .NET Core. See the Release Notes for the latest version numbers and instructions for updating .NET Core.
CVE-2020-1202 / CVE-2020-1203 Diagnostics Hub Standard Collector Service Elevation of Privilege Vulnerability
An elevation of privilege vulnerability exists when the Diagnostics Hub Standard Collector or the Visual Studio Standard Collector fails to properly handle objects in memory.
CVE-2020-1293 / CVE-2020-1278 / CVE-2020-1257 Diagnostics Hub Standard Collector Service Elevation of Privilege Vulnerability
An elevation of privilege vulnerability exists when the Diagnostics Hub Standard Collector Service improperly handles file operations
Top Issues Fixed in Visual Studio 2019 version 16.6.2
- Visual Studio 2019 16.60 hang at run or build when modified not saved in C++/CLI project
- An unhandled exception of type 'System.NullReferenceException' occurred in Microsoft.VisualStudio.DesignTools.WpfTap.dll
- Recurring null reference when reopening documents
- "Create new project" dialog search does not find templates for third-party language providers
- IntelliSense shows that "tilde-slash" (~/) points to ASP .NET Core 3.1 project root instread of wwwroot subfolder after upgrading Visual Studio Enterprise 16.5.6->16.6.0
- Fixed a compiler error (error C2475: redefinition; 'constexpr' specifier mismatch) affecting std::atomic when compiled as C++/CX in C++17 mode.
- URL completion values and format was fixed in Razor views. App-relative URL format is now used again and the values in the URL completion list show files and folders rooted under app root, i.e. wwwroot.
- Fixed a crash when using snippets.
- Restore item templates that could be hidden by extensions.
مثالی از کاربرد واژهی dynamic جهت جایگزین کردن آن با DTOs
استاندارد ECMAScript 2020 پذیرفته شد
Update 2020-04-02: Today, the ES2020 candidate was released, with the final feature set of that version. This blog post describes what’s new.
کتابخانه primeNG-advanced-growl
The AdvGrowlModule is a wrapper around the growl module from PrimeNG. This wrapper was created because PrimeNG is missing some features. Demo
... System.Data.SqlClient.SqlException (0x80131904): The SELECT permission was denied on the object ...
اگر به میزان مصرف حافظه اولیهی برنامههای دات نت دقت کنیم، نسبت به مثلا یک برنامهی MFC چند برابر به نظر میرسند و ... این علت دارد:
زمانیکه یک برنامهی مبتنی بر دات نت اجرا میشود، ابتدا JIT compiler شروع به کار کرده و شروع به کامپایل برنامه میکند. این بارگزاری هم در همان پروسهی اصلی برنامه انجام میشود. به همین جهت میزان مصرف حافظهی برنامههای دات نت عموما بالا به نظر میرسد.
اکنون سؤال اینجا است که آیا می توان این حافظهای را که دیگر مورد استفاده نیست (و توسط JIT compiler اخذ شده) به سیستم بازگرداند و محاسبهی مجددی را در این مورد انجام داد. پاسخ به این سؤال را در متد ReEvaluateWorkingSet زیر میتوان مشاهده کرد:
using System;
using System.Diagnostics;
namespace Toolkit
{
public static class Memory
{
public static void ReEvaluateWorkingSet()
{
try
{
Process loProcess = Process.GetCurrentProcess();
//it doesn't matter what you set maxWorkingSet to
//setting it to any value apparently causes the working set to be re-evaluated and excess discarded
loProcess.MaxWorkingSet = (IntPtr)((int)loProcess.MaxWorkingSet + 1);
}
catch
{
//The above code requires Admin privileges.
//So it's important to trap exceptions in case you're running without admin rights.
}
}
}
}
در این متد ابتدا پروسه جاری دریافت شده و سپس MaxWorkingSet به یک عدد دلخواه تنظیم میشود. مهم نیست که این عدد چه چیزی باشد، زیرا این تنظیم سبب میشود که در پشت صحنه به شکل حساب شدهای حافظهای که مورد استفاده نیست به سیستم بازگردانده شود و سپس عددی که در task manager نمایش داده میشود، مجددا محاسبه گردد. همچنین باید دقت داشت که این کد تنها با دسترسی مدیریتی قابل اجرا است و به همین دلیل وجود این try/catch ضروری است.
نحوه استفاده از متد ReEvaluateWorkingSet در برنامههای WinForms :
فایل Program.cs را یافته و سپس در روال رویداد گردان Idle برنامه، متد ReEvaluateWorkingSet را فراخوانی کنید (مثلا هر زمان که برنامه minimized شد اجرا میشود):
//Program.cs
namespace MemUsage
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
//...
Application.Idle += applicationIdle;
}
static void applicationIdle(object sender, EventArgs e)
{
Memory.ReEvaluateWorkingSet();
}
}
}
نحوه استفاده از متد ReEvaluateWorkingSet در برنامههای WPF :
فایل App.xaml.cs را یافته و سپس در روال رویدادگردان Deactivated برنامه، متد ReEvaluateWorkingSet را فراخوانی کنید:
//App.xaml.cs
public App()
{
this.Deactivated += appDeactivated;
}
void appDeactivated(object sender, EventArgs e)
{
Memory.ReEvaluateWorkingSet();
}
تاثیر آن هم قابل ملاحظه است (حداقل از لحاظ روانی!). تست کنید!