Questions tagged [asp.net-core-3.0]
Use this tag for questions specifically related to ASP.NET Core 3.0, in addition to using the 'ASP.NET Core' tag.
asp.net-core-3.0
849
questions
0
votes
0
answers
32
views
How to Resolve IWebHostEnvironment in .NET Core 8.0? [duplicate]
I'm working on migrating a project from ASP.NET Core 5.0 to .NET Core 8.0. In my project,
using Test_Site_1.Application.Interfaces.Contexts;
using Test_Site_1.Common.Dto;
using Test_Site_1.Domain....
0
votes
0
answers
50
views
How to get child model from database asp.net core?
I have a parent class "User" which inherits from "IdentityUser":
public class User : IdentityUser
{
public string Lastname { get; set; }
public string Name { get; set; }
...
-1
votes
1
answer
802
views
I need to set allowcredentials for a wildcard origin in .net core 3.0
options.AddPolicy("AllowAll",
builder => builder.WithOrigins("*")
.AllowAnyHeader()
....
3
votes
1
answer
5k
views
asp.net core - what are the differences of these MapRazorPages() calls?
Method 1
In ASP.NET Core 3.x, we add endpoints for Razor Pages with
app.UseEndpoints(endpoint =>
{
endpoint.MapRazorPages();
});
Method 2
In the ASP.NET Core 6 Web App template (minimal ...
0
votes
0
answers
327
views
System.ArgumentNullException: Value cannot be null. (Parameter 'items')
I'm trying to return a list of LeaveTypes from a model using DropDownListFor. I have found a few topics on this issue, so it seems to be common, and I presume the list needs to be repopulated, but I ...
0
votes
1
answer
187
views
View is not found when migrating from AspNet.Core 2.2 to 3.0
I have an Asp.Net Core 2.2 MVC application. I am trying to migrate to 3.0, using this documentation:
https://learn.microsoft.com/en-us/aspnet/core/migration/22-to-30?view=aspnetcore-6.0&tabs=...
16
votes
1
answer
18k
views
asp .net core 6 how to update option for json serialization. Date format in Json serialization
My apologies for the silly question, but I don't see a good example of how can I specify a specific format for DateTime in JSON serialization for .net core 6.
The old way, net core 3.
// in the ...
-1
votes
1
answer
92
views
Get varied columns from in Entity Framework 3.0
I have an ASP.NET Core MVC solution.
I tried to get dynamic object and uncertainly column numbers and types from a stored procedure.
I prepared the stored procedure, but I couldn't find a solution ...
0
votes
1
answer
172
views
ASP.NET CORE 3 frombody NULL with Bootstrap Table plugins
I'm trying to do based on this example in the bootstrap table
query params. But the parameter I received always NULL, even I already set it before calling backend. I expect the value received should ...
4
votes
3
answers
7k
views
Get the local path of a file in a virtual directory
I have an ASP.NET Core 3.0 MVC application with images in it. E.g.,
http://foo.bar/images/image.jpg
Now, the folder images is a virtual directory which is mapped to a network drive, such as \\192.168....
0
votes
1
answer
811
views
how to handle enums like strings and ints
I'm rewriting an api, switching from newtonsoft.json to system.text.json, and an issue i have is the fact that in some cases we send enums as ints and sometimes as strings.
Consider this example:
{
&...
0
votes
1
answer
719
views
Could not load file or assembly 'Microsoft.Extensions.Configuration.Abstractions, Version=3.0.0.0
I am migrating my .NET standard 2.0 class library application to .NET core 3.0 where I want to start web API server from class library, Where class library application is getting launched with ...
5
votes
1
answer
3k
views
How to deserialize part of json using System.Text.Json in .net core 3.0?
I have a json from here https://api.nasa.gov/insight_weather/?api_key=DEMO_KEY&feedtype=json&ver=1.0 which looks like:
{
"782": {
"First_UTC": "2021-02-06T17:08:...
0
votes
0
answers
261
views
Site refused to connect on IIS Publish
I am publishing an ASP.Net Core 3.0 application in IIS. My publish profile looks like
This is how my web.config file is in publish folder
<?xml version="1.0" encoding="utf-8"?&...
0
votes
1
answer
808
views
Routing from an angular front end to an asp.net core 3.1 backend
So here is my backend .csproj. Im doing a front end spa in angular connecting to my backend in memory database. I can connect to my database from the URL of my back end application like in the image. ...
2
votes
1
answer
576
views
ASP.NET Core 3.0 MVC update model with list objects - add object
I have the following classes:
public class Invoice
{
[key]
public Guid InvoiceID { get; set; }
public string Name { get; set; }
public List<Invoice_item> Invoice_items { ...
0
votes
0
answers
176
views
Get the host of the URL
I am made an API that works as it is intended, but to stop the direct use of the base URL of the API, there is another URL that masks the base URL but works the same.
I need to return the URL that is ...
1
vote
1
answer
735
views
Azure app service websocket buffer buffer size limits?
I have run into a problem where my websocket connection is functioning as expected locally, but not when deployed to azure app service. (.NET Core 3.0)
I am able to receive messages of any size ...
1
vote
1
answer
959
views
How to add data from async method in singleton in Startup.cs in net.core 3.0?
I'm trying to get async data from HttpClient and add this data as singleton at ConfigureServices in Startup.cs
public static class SolDataFill
{
static HttpClient Client;
static SolDataFill()
...
0
votes
1
answer
624
views
How to install root certificate in aspnet:3.0 base image for windows container
I am hosting two windows containers from a Windows 2019 servers and both are running in https. When my Web URL container tried to make a call to the API container. It didn't work and when I got ...
0
votes
1
answer
1k
views
Modal Pop-Up Displaying Incorrectly When ModelState.IsValid = false Redirect
I'm having an issue with my Modal Pop-Up displaying incorrectly when it fails model validation on HttpPost. When the Modal returns data and it fails validation, I want the screen to return to having ...
2
votes
0
answers
221
views
Consuming ws security soap service in .Net Core 3 api
I am consuming a SOAP service in .NET Core 3.0 API. This service uses WS-Security standard for authentication. Will the below code work with just the username and password provided to the client ...
1
vote
0
answers
153
views
Role Based Authorization not working .NET Core 3.0
Role-Based Authorization not working in my code, Please guide me if i am missing anything.
My project is on .net core 3.0 framework.
Authentication is working fine but authorization is not working.
...
0
votes
1
answer
279
views
Map two identical models, nested with automapper
I did some research but I couldn't find exactly what I wanted.
I have an endless menu. I have a MenuDTO and a MenuViewModel that I use for this menu. I had no problem matching between model and DTO, ...
1
vote
1
answer
131
views
Passing json through a controller
I have this back-end system that produces json. Is it possible to pass that data through a controller on request and correctly setting the mimetype? Everything I've tried so far tries to re-serialize ...
3
votes
1
answer
559
views
Return View as String in .NET Core 3.0
I am working on generating HTML to send to a PDF generator and discovered this this question on Stackoverflow. It points to Paris Polyzos and his article. Upon implementing the code in .Net Core 3.0,...
4
votes
1
answer
2k
views
How to set up Client side validation for a custom RequiredIf attribute for Asp.NET Core 3.0
I was not able to get my client side validation method to fire after setting up the validation according to various sources. After lots of struggle I found that changing the order of when the scripts ...
0
votes
1
answer
196
views
Forgot password not working for .NET Core 3.x and React scaffold
I have a project in .NET Core 3.1 and the frontend with React.
It was generated using the scaffold instructions from this link.
When I try to trigger forgot password action, it shows a success page ...
1
vote
1
answer
2k
views
Will two Azure Event Hub consumers get the same notifications?
I'm developing an Azure IoT web application that consumes events from an Azure Event Hub. I regularly publish the web application to Azure in a testing environment and then I also run the it in debug ...
0
votes
2
answers
468
views
Uploaded file have no content when uploaded from Remote IIS Server
I am trying to upload files to Google Drive using ASP.NET Core 3.0, here is my code to upload the file.
GData.File fileMetadata = new GData.File()
{
Id = null,
Name = Path.GetFileName(path),
...