GitHub Issues
The GitHub Issues integration allows you to search and reference your issues from the commit message box in VS, in response to this suggestion ticket. You can reference an issue or a pull request by typing # or clicking on the # button in the lower right side of the commit message text box. If you weren't already authenticated to access related issues, you will now be prompted to sign in to take advantage of this feature.
Line Unstaging
To continue improving our line-staging (aka interactive staging) feature, we've added unstage. You can now use the tool tip option to unstage changes, line by line, as requested here Unstage individual lines and hunks in a file - 4 votes
Arm64
We continue to build native support for Arm64 on Windows 11 for the most popular developer scenarios. We now support the .NET Multi-platform App UI (MAUI) workload on Arm64 Visual Studio.
C++
- Available as a preview feature, you can now view Unreal Engine logs without leaving VS. To see the logs from the Unreal Engine Editor, click View > Other Windows > UE Log. To filter your logs, click on the "Categories" or "Verbosity" dropdowns. Since this is an experimental feature, feedback is greatly appreciated.
- You can now import STM32CubeIDE projects for embedded development within Visual Studio with File > Open > Import STM32CubeIDE project. This generates a CMake project with device flashing and debugging settings for STLink. You must have the STM32CubeIDE installed with the board support package for your device. More details available here.
- You can use the new CMake Debugger to debug your CMake scripts at build time. You can set breakpoints based on filenames, line numbers, and when CMake errors are triggered. Additionally, you can view call stacks of filenames and watch defined variables. Currently, this only works with bundled CMake, and projects targeting WSL or remote machines are not supported yet. We are actively working to add more support to the CMake debugger, and feedback is greatly appreciated.
Fixed In This Release of Visual Studio 2019 version 16.5
- Team Explorer not loading after update to mandatory latest visual studio version for Visual studio 2019
- Find Highlighting Fails when Matching with Match Case Disabled and Regex Option Enabled
Security Advisory Notice
CVE-2020-1108 .NET Core Denial of Service Vulnerability
A remote unauthenticated attacker could exploit this vulnerability by issuing specially crafted requests to the .NET Core application. The security update addresses the vulnerability by correcting how the .NET Core web application handles web requests.
CVE-2020-1161 .NET Core Denial of Service Vulnerability
A remote unauthenticated attacker could exploit this vulnerability by issuing specially crafted requests to the ASP.NET Core application. The security update addresses the vulnerability by correcting how the ASP.NET Core web application handles web requests.
مدل Actor با استفاده از Akka.net
In the same time when first object-oriented languages were emerging, another concept inspired by general relativity and quantum mechanics was taking shape – actor model. In general terms, the Actor model was defined 1973. and was developed on a platform of multiple independent processors in a network. Similar to the object-oriented approach, this essentially mathematical model, revolved around the concept of actors. An actor is the smallest structural unit of Actor model, and just like objects, they encapsulate data and behavior. In difference to objects, however, actors communicate with each other exclusively trough messages. Messages in actors are processed in a serial manner. According to the full definition of actors, they can do three things:
- send a finite number of messages to other actors
- create a finite number of new actors
- designate the behavior to be used for the next message it receives
یک اینترفیس را به اسم ICustomService ایجاد کردم که یک Prop به اسم InjectType دارد و مشخص میکند به چه صورتی این سرویس به ServiceCollection تزریق شود. از طرفی با استفاده از Order، الویت اضافه شدن سرویس به ServiceCollection را مشخص میکنیم و در نهایت با ImplementationType مشخص میکنیم سرویسی که اضافه شده، باید به یک اینترفیس Map شود یا خیر؟ اما مهمتر از اینکه ویژگیهای تزریق وابستگی مشخص شود، مشخص میکند چه سرویسهایی توسط ما اضافه شدهاند و از سرویسهای nop تفکیک میشوند.
namespace Nop.Services { public interface ICustomService { protected InjectType Inject { get; } protected int Order { get; } protected ImplementationType implementationType { get; } } public enum ImplementationType { WithInterface = 0, WithoutInterface = 1 } public enum InjectType { Scopped=0, Transit=1, SingleTon=2 } }
قانون اول
برای هر سرویسی که ایجاد میکنیم و میخواهیم به DI معرفی کنیم، آن سرویس باید ICustomService را پیاده سازی کرده باشد؛ دقیقا به خاطر دو دلیلی که در بالا به آنها اشاره شد.
قانون دوم
هر کلاسی که Interface مرتبط به سرویسها را پیاده سازی میکند، باید prop InjectType را در سازندهی خودش مقدار دهی کند. بدین شکل متوجه میشویم از چه طریقی باید تزریق انجام شود. تا اینجا یک چارچوب را مشخص کردیم تا سرویسها را بتوانیم تشخیص دهیم\ اما هنوز کار اصلی باقی ماندهاست. برای نمونه میتوان کد زیر را در نظر گرفت :
namespace Nop.Services { public interface IMyCustomService: ICustomService { int ok(); } }
namespace Nop.Services { public class MyCustomService : IMyCustomService { public InjectType Inject { get; } public int Order { get; } public ImplementationType implementationType { get; } public MyCustomService() { implementationType = ImplementationType.WithInterface; Inject = InjectType.Scopped; Order = 1; } public int ok() { return 10; } } }
تعیین نقطه شروع
کد زیر در واقع نقطهی اتصال سرویسهای نوشته شده و اتمام کار تزریق وابستگی است. با توجه به پیاده سازیهای انجام شدهی توسط سرویسها میتوان با Reflection سرویسهای نوشته شده را تشخیص داد که در نهایت با ویژگیهایی که در سرویسها پیاده سازی شده موجود است، به ServiceCollection اضافه میشوند.
namespace Nop.Web.Framework.Infrastructure { public class CustomDependencyInjection : NopStartup { private static bool IsSubInterface(Type t1, Type t2) { if (!t2.IsAssignableFrom(t1)) return false; if (t1.BaseType == null) return true; return !t2.IsAssignableFrom(t1.BaseType); } public override void ConfigureServices(IServiceCollection services, IConfiguration configuration) { //-------------Get All Services------------- var asm = AppDomain.CurrentDomain .GetAssemblies() .Single(x => x.FullName.Contains("Nop.Services")); //-------------find Services that inheriance of ICustomService------------- var types = asm.DefinedTypes.Where(x => IsSubInterface(x, typeof(ICustomService))); //-----------Get All Custom Service Classess------- var allRelatedClassServices = types .Where(x => x.IsClass) .OrderBy(x=>(Int32)x.GetProperty("Order") .GetValue(Activator.CreateInstance(x), null)); //-----------Get All Custom Service Interfaces------- var allRelatedInterfaceServices = types.Where(x => x.IsInterface); //-----------Matche Class Services To Related Interface Services------- TypeInfo interfaceService=null; foreach (var classService in allRelatedClassServices) { //-----------detect Implementation Type for service----------- var implementationValue = (ImplementationType)classService.GetProperty("implementationType") .GetValue(Activator.CreateInstance(classService), null); //-----------detect inject type for service----------- var InjectValue = (InjectType)classService.GetProperty("Inject") .GetValue(Activator.CreateInstance(classService), null); //-----------get related interface for service class----------- if (implementationValue == ImplementationType.WithInterface) interfaceService = allRelatedInterfaceServices.Single(x => x.Name == $"I{classService.Name}"); //----------finally Add Custom Service To Service Collection----------- switch (InjectValue) { case InjectType.Scopped: if(interfaceService!=null) services.AddScoped(interfaceService, classService); else services.AddScoped(classService); break; case InjectType.Transit: if (interfaceService != null) services.AddTransient(interfaceService, classService); else services.AddTransient(classService); break; case InjectType.SingleTon: if (interfaceService != null) services.AddSingleton(interfaceService, classService); else services.AddSingleton(classService); break; default: break; } interfaceService = null; } } } }
لینک گیتهاب
معرفی OpenJDK ساخت مایکروسافت
دور کاری یا کار در محل شرکت
2.Visual Studio 2017 15.6 منتشر شد
These are the customer-reported issues addressed in this release:
- "Specified argument out of the range of valid values, parameter name: count"
git
tags. - Cannot open git commit details.
- VS2017 Installer crashes on Modify when SyncFusion WPF Templates are installed.
- Test Explorer loses position when tests are run.
- Test explorer test hierarchy constantly jumps to top.
- XAML editor always crashes when a change is made to the XAML file.
- Test Explorer keeps scrolling to the top when a new test starts.
- Viewing Git History shows: specified argument was out of range of values.
- Alt+Up/Down does not reposition file in .NET Framework projects.
- VS 15.6 deadlocks on solution load for .NET Core SDK project when a 'None Include' is added to file list.
- 15.6 preview 6 discovers test adapter, but fails to run tests.
- Test Explorer keeps scrolling to the top when a new test starts.
- Microsoft Security Advisories for .NET Core updates.
Microsoft Security Advisories for .NET Core
CVE-2018-0875: Microsoft is aware of a security vulnerability in the public versions of .NET Core where a malicious file or web request could cause a denial of service (DoS) attack.
- System administrators are advised to update their .NET Core runtimes to versions 1.0.10, 1.1.7 or 2.0.6. Developers are advised to update their .NET Core SDK to versions 1.1.8 or 2.1.101.
حجم تقریبی بروزرسانی از نسخه 15.6.1 به 15.6.2 برابر 1.2GB میباشد