asp.net-core-3.1

Can't create new .NET Core 3.1 web app in Azure under Windows operating system

旧街凉风 提交于 2020-03-23 15:41:14
问题 I spent many hours trying to find some way to create a new .NET Core 3.1 web app under Windows subscription. I found that if you pick up the Runtime stack as .Net Core 3.1 (LTS) the only option is to create an app under the Linux. I tried to play with different regions and Sku and sizes as well but for all cases, it's just the same. There is no option to configure App Insight during the creation time either when using the Linux. The interesting thing is that when I created the Web App under

Can't create new .NET Core 3.1 web app in Azure under Windows operating system

一世执手 提交于 2020-03-23 15:39:08
问题 I spent many hours trying to find some way to create a new .NET Core 3.1 web app under Windows subscription. I found that if you pick up the Runtime stack as .Net Core 3.1 (LTS) the only option is to create an app under the Linux. I tried to play with different regions and Sku and sizes as well but for all cases, it's just the same. There is no option to configure App Insight during the creation time either when using the Linux. The interesting thing is that when I created the Web App under

Azure AD Multi Tenant ,.Net Core Web API with JWT Token

妖精的绣舞 提交于 2020-03-22 12:53:18
问题 So I raised this question Azure AD Multi Tenant ,.Net Core Web API with MSAL(Microsoft Authentication Libary) which showed me how to turn on the error output. Why would I be getting this now with my token, at a guess is the aud right and the iss for a multi tenant ad token? AuthenticationFailed: IDX10511: Signature validation failed. Keys tried: 'Microsoft.IdentityModel.Tokens.X509SecurityKey, KeyId: 'YMELHT0gvb0mxoSDoYfomjqfjYU', InternalId: '2c34a300-21bb-4eb1-b3b9-1944f1be7470'. , KeyId:

Build required for CSHTML changes, JS changes in ASP.NET MVC Core 3.1 Applications [duplicate]

天涯浪子 提交于 2020-03-17 03:14:07
问题 This question already has answers here : Why does page not update after refresh when .cshtml changes (4 answers) Closed 20 days ago . I have recently upgraded my ASP.NET MVC Core 2.2 application to Core 3.1 , everything works well, but in debug sessions if I make any changes to CSHTML file, like adding a new HTML tag or change code in JS file, it doesn't reflect by refreshing the app on localhost debug session. I will have to stop my VS and re-build and run in debug mode. This is happening

Equivalent of UseUrls for .NET Core 3.1/IHostBuilder

ε祈祈猫儿з 提交于 2020-03-05 05:12:57
问题 Previously, with .NET Core 2.2, I could add UseUrls to my Program.cs file to set the URL that the web server would run on: public static IWebHostBuilder CreateWebHostBuilder(string[] args) => WebHost.CreateDefaultBuilder(args) .UseStartup<Startup>() .UseUrls("http://localhost:5100"); However, in .NET Core 3.1, the default format of Program.cs changed: public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) .ConfigureWebHostDefaults(webBuilder => {

ASP.Net Core exclude published language directories other than english

為{幸葍}努か 提交于 2020-03-04 23:06:32
问题 I publish my ASP.Net Core 3.1 Server like this: dotnet publish --configuration Release --runtime win7-x64 -p:PublishTrimmed=true --output c:\MyServer What I get in c:\MyServer is a lot of international language directories: cs, de, es, fr, zh-hans etc How can I publish with only the English version ? I tried using ExcludeFoldersFromDeployment in my csproj: <PropertyGroup> <TargetFramework>netcoreapp3.1</TargetFramework> <RuntimeIdentifier>win7-x64</RuntimeIdentifier>

Conventional Routing in ASP.NET Core API

大憨熊 提交于 2020-02-28 05:50:19
问题 Problem: I'm creating an API Application with NET Core 3.1. I'd like to avoid to set route attribute over every ApiControllers and Actions. I tryed a lot of combinations over UseEndpoints to set a conventional route, but i'm failing. With some configuration I can't get the Api working, with some others I get this exception during startup: InvalidOperationException: Action 'ApiIsWorking' does not have an attribute route. Action methods on controllers annotated with ApiControllerAttribute must

Get RawBody from HttpContext of ActionExecutionContext in ASP.NET Core

扶醉桌前 提交于 2020-02-06 07:36:05
问题 I have a base class where I want to include code that is being executed in all of my controller methods. In my special case, I opted for creating a base class, overwriting OnActionExecution , and having my controller classes inherit from that base class. This works quite well: public class BaseController : Controller { public override void OnActionExecuting(ActionExecutingContext context) { string parsedParameters = string.Empty; if (context.ActionArguments.Count > 0) { inputParameters =

Cookieless ASP.NET Core

ぐ巨炮叔叔 提交于 2020-01-30 05:17:10
问题 I am developing an ASP.NET Core 3.1 application. I am not using any kind of authentication, session data/logic and form elements. I see the .AspNetCore.Antiforgery cookie in my in my developer console, although I did not call services.AddAntiforgery() in my Startup class. I found this StackOverflow question with a very unsatisfying accepted answer, since this cookie will still be sent to the client (pointed out by hemp's comment). So my question is: How do I completely remove this CSFR cookie

Cookieless ASP.NET Core

旧巷老猫 提交于 2020-01-30 05:17:06
问题 I am developing an ASP.NET Core 3.1 application. I am not using any kind of authentication, session data/logic and form elements. I see the .AspNetCore.Antiforgery cookie in my in my developer console, although I did not call services.AddAntiforgery() in my Startup class. I found this StackOverflow question with a very unsatisfying accepted answer, since this cookie will still be sent to the client (pointed out by hemp's comment). So my question is: How do I completely remove this CSFR cookie