.net-core

dotnet publish include extra files

我只是一个虾纸丫 提交于 2021-02-07 06:16:46
问题 I have a netcore application depends on my custom project. Because I cannot reference it directly, I have written postbuildevents that are copying my files to output: xcopy "$(SolutionDir)Ethereum.Contracts\bin\$(ConfigurationName)\*.abi" "$(TargetDir)" /Y /I xcopy "$(SolutionDir)Ethereum.Contracts\bin\$(ConfigurationName)\*.bin" "$(TargetDir)" /Y /I It works fine when I build and run project, but when run publish command it doesn't include these files. How can it be done? I tried this

What's the difference between returning AsyncEnumerable with EnumeratorCancellation or looping WithCancellation

时光毁灭记忆、已成空白 提交于 2021-02-07 05:53:46
问题 I have the following method that reads a csv document from a http stream public async IAsyncEnumerable<Line> GetLines([EnumeratorCancellation] CancellationToken cancellationToken) { HttpResponseMessage response = GetResponse(); using var responseStream = await response.Content.ReadAsStreamAsync(); using var streamReader = new StreamReader(responseStream); using var csvReader = new CsvReader(streamReader); while (!cancellationToken.IsCancellationRequested && await csvReader.ReadAsync()) {

.NETPlatform vs .NETStandard

假装没事ソ 提交于 2021-02-07 02:53:42
问题 I'm really confused about the terminology around the platforms in .NET these days - I used to understand it up until we had the PCLs. I found the following documents: .NET Platform Standard .NET Standard Library For starters, the first document refers to the conceptual platform with the moniker "netstandard" as ".NET Platform Standard". The latter calls it ".NET Standard" (at the same time it introduces a new ".NET Standard Library"). I don't really get why the first document has a disclaimer

.NETPlatform vs .NETStandard

帅比萌擦擦* 提交于 2021-02-07 02:52:12
问题 I'm really confused about the terminology around the platforms in .NET these days - I used to understand it up until we had the PCLs. I found the following documents: .NET Platform Standard .NET Standard Library For starters, the first document refers to the conceptual platform with the moniker "netstandard" as ".NET Platform Standard". The latter calls it ".NET Standard" (at the same time it introduces a new ".NET Standard Library"). I don't really get why the first document has a disclaimer

How to add controller (not view) support to a server-side Blazor project

主宰稳场 提交于 2021-02-07 02:36:07
问题 While my server-side Blazor app is running, I want some Javascript code in _Host.cshtml to be able to post data to a controller action. Of course, this happens completely outside of the scope of, and is unrelated to, the Blazor app itself. I thought this would be a matter of adding calls to services.AddControllers() and endpoints.MapControllers() at the appropriate places in Startup.cs . However, after doing this, and implementing the controller action, I made the following observations:

The oauth state was missing or invalid. An error was encountered while handling the remote login

筅森魡賤 提交于 2021-02-06 14:17:53
问题 I am facing issues while implementing external login in asp.net core 2.2 (mvc) without using identity. After signing in to google it redirect back to callback url that is throwing exception as attached in the image below. Exception: The oauth state was missing or invalid. Unknown location Exception: An error was encountered while handling the remote login. Microsoft.AspNetCore.Authentication.RemoteAuthenticationHandler.HandleRequestAsync() For more detailed steps that I did, please check here

The oauth state was missing or invalid. An error was encountered while handling the remote login

南楼画角 提交于 2021-02-06 14:07:07
问题 I am facing issues while implementing external login in asp.net core 2.2 (mvc) without using identity. After signing in to google it redirect back to callback url that is throwing exception as attached in the image below. Exception: The oauth state was missing or invalid. Unknown location Exception: An error was encountered while handling the remote login. Microsoft.AspNetCore.Authentication.RemoteAuthenticationHandler.HandleRequestAsync() For more detailed steps that I did, please check here

The oauth state was missing or invalid. An error was encountered while handling the remote login

旧城冷巷雨未停 提交于 2021-02-06 14:06:40
问题 I am facing issues while implementing external login in asp.net core 2.2 (mvc) without using identity. After signing in to google it redirect back to callback url that is throwing exception as attached in the image below. Exception: The oauth state was missing or invalid. Unknown location Exception: An error was encountered while handling the remote login. Microsoft.AspNetCore.Authentication.RemoteAuthenticationHandler.HandleRequestAsync() For more detailed steps that I did, please check here

Questions on .NET Core 3.1 & Angular SSR spa.UseSpaPrerendering alternative

不想你离开。 提交于 2021-02-06 11:56:52
问题 I created this post to get some insights from the community. A little while ago with the release of .NET Core 3.0 the usage of the well-known and widely used spa.UseSpaPrerendering has been marked as Obsolete. Around early-2019 I implemented SSR using .NET Core in a project that uses Angular but needed SEO and better loading perf. 1 year later (now, beginning of 2020) they want the same for a different project. But it already uses Core 3.1. immediately we noticed the Depricated flag, so I

Questions on .NET Core 3.1 & Angular SSR spa.UseSpaPrerendering alternative

泄露秘密 提交于 2021-02-06 11:56:25
问题 I created this post to get some insights from the community. A little while ago with the release of .NET Core 3.0 the usage of the well-known and widely used spa.UseSpaPrerendering has been marked as Obsolete. Around early-2019 I implemented SSR using .NET Core in a project that uses Angular but needed SEO and better loading perf. 1 year later (now, beginning of 2020) they want the same for a different project. But it already uses Core 3.1. immediately we noticed the Depricated flag, so I