asp.net-core-3.0

.net Core 3 [JsonIgnore] not working when requesting single resource

独自空忆成欢 提交于 2020-05-31 05:22:51
问题 in my .net Core 3.0 Api the [JsonIgnore] Attribute is not working as excepted. Im using System.Text.Json instead of the old Newtonsoft.Json When i'm using my resource that returns a list of Objects, for example: /api/Object/ the objects are serialized like this: [ { "id": 1, "date": "2020-02-12T08:45:51.502", "userId": 1, "tags": [ { "name": "string" } ] } ] But when I request a single result /api/Object/{id} the full object gets serialized like this: { "user": { "hasAccess": false, "id": 1,

Routed localization in ASP.NET Core 3.0 Razor Pages

社会主义新天地 提交于 2020-05-26 09:13:32
问题 I would like to use routed localization in my ASP.NET Core 3.0 Razor Pages application. https://stackoverflow.com/a/52976625/107718 seems to have a solution for 2.2 but is there any better way of doing this in 3.0 now that it have routing/endpoints reworked? 回答1: ASP.NET Core 3.0 introduces a new feature of Endpoint Routing by which we can get the culture from the route data before it goes into MVC. This allows us to localize content according to current route without too much effort. How-to

Routed localization in ASP.NET Core 3.0 Razor Pages

北战南征 提交于 2020-05-26 09:10:26
问题 I would like to use routed localization in my ASP.NET Core 3.0 Razor Pages application. https://stackoverflow.com/a/52976625/107718 seems to have a solution for 2.2 but is there any better way of doing this in 3.0 now that it have routing/endpoints reworked? 回答1: ASP.NET Core 3.0 introduces a new feature of Endpoint Routing by which we can get the culture from the route data before it goes into MVC. This allows us to localize content according to current route without too much effort. How-to

ASP .Net Core 3.0 ShortName in the Display Attribute (DataAnnotations)

霸气de小男生 提交于 2020-05-15 11:50:07
问题 This question was asked in the past and the answer here https://stackoverflow.com/a/45236544/3074765 has been a life saver for me. The problem is that when I migrated to .Net Core 3.0, it broke. The reason can be found here https://github.com/aspnet/AspNetCore/issues/8678 . In a nutshell, Microsoft had made some functions public that were in a class that was labeled internal. Fixing this removed access to ExpressionMetadataProvider. Consider the following HTML Helper using Microsoft

How can Add Area in razor pages on dot net core 3.0/3.1?

前提是你 提交于 2020-05-13 11:41:39
问题 I want to add areas in core 3.1 in Razor Pages , but Microsoft documents are for asp dot net core 2.2, and they want to create a new report in January 2020!. Does somebody know how to add areas to the core 3.1? I searched a lot on Google but couldn't find an answer. in _AdminLayout : ... <a asp-area="Channel" asp-page="Index" class="w3-bar-item w3-button w3-padding"><i class="fad fa-cog"></i>  تنظیمات آپارات</a> <a asp-page="Channel/Index" class="w3-bar-item w3-button w3-padding"><i class=

How can Add Area in razor pages on dot net core 3.0/3.1?

泄露秘密 提交于 2020-05-13 11:41:05
问题 I want to add areas in core 3.1 in Razor Pages , but Microsoft documents are for asp dot net core 2.2, and they want to create a new report in January 2020!. Does somebody know how to add areas to the core 3.1? I searched a lot on Google but couldn't find an answer. in _AdminLayout : ... <a asp-area="Channel" asp-page="Index" class="w3-bar-item w3-button w3-padding"><i class="fad fa-cog"></i>  تنظیمات آپارات</a> <a asp-page="Channel/Index" class="w3-bar-item w3-button w3-padding"><i class=

blazor.server.js file not found

你。 提交于 2020-05-13 03:26:58
问题 I created a new ASP.NET Core 3.0 Web application and selected the Model-View-Controller option. I wanted to add Blazor Server side, so I added the below to the Startup.cs file. services.AddServerSideBlazor(); endpoints.MapBlazorHub(); and added the script file <script src="_framework/blazor.server.js"></script> in my Layout file. I created a simple component that displays what I enter in a textbox, and added the component to my Index.cshtml view. It works within Visual Studio, but when I push

Application is running inside IIS process but is not configured to use IIS server .NET Core 3.0

夙愿已清 提交于 2020-05-12 11:07:50
问题 I have migrated our application from .NET Core 2.2 to version 3.0. Actually I created the new application in 3.0 from scratch and then copied source code files. Everything looks great but when I try to run the application within Visual Studio 2019 I get the exception: Application is running inside IIS process but is not configured to use IIS server Here is my Program.cs public static class Program { public static void Main(string[] args) { CreateHostBuilder(args).Build().Run(); } public

Application is running inside IIS process but is not configured to use IIS server .NET Core 3.0

江枫思渺然 提交于 2020-05-12 11:05:48
问题 I have migrated our application from .NET Core 2.2 to version 3.0. Actually I created the new application in 3.0 from scratch and then copied source code files. Everything looks great but when I try to run the application within Visual Studio 2019 I get the exception: Application is running inside IIS process but is not configured to use IIS server Here is my Program.cs public static class Program { public static void Main(string[] args) { CreateHostBuilder(args).Build().Run(); } public

Best way to integrate webpack builds with ASP.NET Core 3.0?

不想你离开。 提交于 2020-05-09 19:35:19
问题 I'm upgrading my ASP.NET Core app to V3, and using Visual Studio 2019 for development / debugging. The process has been smooth except for this: public void Configure(….. app.UseWebpackDevMiddleware(new WebpackDevMiddlewareOptions { HotModuleReplacement = false, ReactHotModuleReplacement = false }); UseWebpackDevMiddleware is no more: https://github.com/aspnet/AspNetCore/issues/12890 . I'm now looking to understand the best way to have VS run webpack every time I debug, ideally only on JS code