However, it is clear that Microsoft’s future direction is in the Core space . Yes, the last update to the full .NET framework did include improvements for ASP.NET and WebForms, but clearly the future innovation and hard work will be in the new core frameworks like .NET core, ASP.NET Core, Entity Framework core, and whatever other cores come along in the future.
اشتراکها
آفیس
توسعه وب
دات نت فریم ورک
دبلیو سی اف
سی و مشتقات
کتابهای رایگان
متفرقه
مرورگرها
ویندوز
پی اچ پی
In this section, I’m going to cover how you can use SignalR outside of a Hub. In most asp.net core applications, you will likely want to communicate with the connect clients from within your application but outside of a Hub. You can accomplish this by using the HubContext.
For example, an ASP.NET Core MVC Controller or any other class that is instantiated by ASP.NET Core’s Dependency Injection.
The HubContext allows you to send messages to your connected clients. It has many of the same features to communicate with clients as when you are inside of a Hub.
اشتراکها
NET 5.0 Preview 3. منتشر شد
یک نکتهی تکمیلی: فعال سازی Dot net core 3 در Visual Studio 2019
سپس تیک مربوط به Use preview of the .NET Core SDK را قرار دهید. چنانچه این گزینه را نداشتید از مسیر زیر استفاده کنید:
حال تیک مربوط به Use preview of the .NET Core SDK را بزنید.
وقتی Visual Studio 2019 را نصب میکنید به طور پیش فرض Core 2 را دارا هست اما نسخه dote net core 3 را ندارد. برای نصب dot net core 3 ابتدا SDK مربوطه را دانلود کنید. تا این لحظه آخرین نسخه dotnet-sdk-3.0.100-preview7-012821 میباشد. ممکن است برای شما نسخه جدیدتری آمده باشد. سپس آن را نصب کنید و چون نسخه preview هست باید در visual studio 2019 آن را فعال کنید. در نسخههای قدیمیتر ویژوال استدیو 2019 ابتدا از منوی Tools مسیر زیر را دنبال کنید:
Tools > Options > Project and Solutions > .Net Core
Tools -> Options -> Environment -> Preview Features
اکنون میتوانید پروژه خود را اجرا کنید.
اشتراکها
بررسی تغییرات Git 2.37
NetEscapades.AspNetCore.SecurityHeaders
A small package to allow adding security headers to ASP.NET Core websites. example :
public void Configure(IApplicationBuilder app) { var policyCollection = new HeaderPolicyCollection() .AddFrameOptionsDeny() .AddXssProtectionBlock() .AddContentTypeOptionsNoSniff() .AddStrictTransportSecurityMaxAgeIncludeSubDomains(maxAgeInSeconds: 60 * 60 * 24 * 365) // maxage = one year in seconds .AddReferrerPolicyStrictOriginWhenCrossOrigin() .RemoveServerHeader() .AddContentSecurityPolicy(builder => { builder.AddObjectSrc().None(); builder.AddFormAction().Self(); builder.AddFrameAncestors().None(); }) .AddCustomHeader("X-My-Test-Header", "Header value"); app.UseSecurityHeaders(policyCollection); // other middleware e.g. static files, MVC etc }
اشتراکها
ویژگی Image Tag Helper در MVC 6.0
<img src="~/images/logo.png" alt="company logo" asp-file-version="true" />
which will generate something like this:
<img src="/images/logo.png?v=W2F5D366_nQ2fQqUk3URdgWy2ZekXjHzHJaY5yaiOOk" alt="company logo"/>
The value of the v parameter is calculated based on the contents of the image file. If the contents of the image change, the value of the parameter will change. This forces the browser to download the new version of the file, even if the old version was cached locally. This technique is often called cache busting.