Microsoft Q&A

ASP.NET Core

2,565 questions

A set of technologies in the .NET Framework for building web applications and XML web services.

Browse all .NET tags

500 questions with ASP.NET Core tags

Sort by: Updated
0 answers

embedding a pdf file in my chrome browser

I am trying to embed a pdf file on my web page. In order to achieve this, I have the following code in my controller: public IActionResult Index() { string path = Path.Combine(_environment.WebRootPath, "packageFiles"); …

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
2,565 questions
ASP.NET MVC
ASP.NET MVC
A Microsoft web application framework that implements the model-view-controller (MVC) design pattern.
600 questions
asked 2023-02-03T04:57:40.42+00:00
Anjali Agarwal 101 Reputation points
0 answers

IEnum object True for All

Hi friends, I wonder if there is a way to use TrueForAll for IEnumerable<OrderDetail>? I am trying to check if all of the status = 1 or not. How can I check if all statuses in details are 1 or not? Thank you. var details =…

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
2,565 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
6,980 questions
asked 2023-02-03T04:39:43.0233333+00:00
Cenk 666 Reputation points
edited the question 2023-02-03T04:48:32.0533333+00:00
Cenk 666 Reputation points
0 answers

how to use blazor webassembly in razor pages?

how to use blazor webassembly component in razor pages? if I create Count in webassembly how to use it in razor pages? if I do not open that page do not load dll If I open that page then load it. /Pages/Count.cshtml with component Count If I do not open…

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
2,565 questions
ASP.NET Web Forms
ASP.NET Web Forms
A part of the ASP.NET web application framework that can be used to create ASP.NET web applications.
405 questions
ASP.NET MVC
ASP.NET MVC
A Microsoft web application framework that implements the model-view-controller (MVC) design pattern.
600 questions
asked 2023-02-03T02:56:39.31+00:00
打玻璃 1,526 Reputation points
0 answers

String interpolation using $ throws System.NullReferenceException on .Net7

We have in my team just upgraded to .net 7 from 6, but we have run into a issues with string interpolation using $"Text {sample}" We are all developing on Intel Macbook Pro's using both Visual Studio or JetBrains Rider. But since the upgrade…

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
2,565 questions
.NET
.NET
Microsoft Technologies based on the .NET software framework.
614 questions
asked 2023-02-02T23:08:22.8133333+00:00
Morten Starck 0 Reputation points
edited the question 2023-02-02T23:09:04.55+00:00
Morten Starck 0 Reputation points
0 answers

How to query the device twin graph using the built-in `LastUpdatedOn` property from the BasicDigitalTwin?

The BasicDigitalTwin holds a built-in property LastUpdatedOn. As a developer, I want to run a query to find all the stale or fresh twins, example: SELECT * FROM DIGITALTWINS WHERE LastUpdatedOn > '{yesterday}' This query is syntactically correct but…

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
2,565 questions
Azure Digital Twins
Azure Digital Twins
An Azure platform that is used to create digital representations of real-world things, places, business processes, and people.
122 questions
asked 2023-02-02T22:50:47.77+00:00
Uriel Kluk 21 Reputation points
0 answers

HTTPStatusCode 404 in production only, why?

Hi, What's wrong with my code below, I have tried it in debug mode and got no 404, but if I run it in production (Linux CentOS 8), it fails with 404 (in my case it always fail on pageNo == 2 (there are actually have 20 pages) List<Task> tasks =…

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
2,565 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
6,980 questions
ASP.NET MVC
ASP.NET MVC
A Microsoft web application framework that implements the model-view-controller (MVC) design pattern.
600 questions
asked 2023-02-02T01:50:28.88+00:00
winanjaya 41 Reputation points
edited a comment 2023-02-02T09:50:31.2766667+00:00
Viorel 82,741 Reputation points
0 answers

.net upgrade assistant added net7.0-windows for asp.net MVC webapplication during migration

When I used .net upgrade assistant tool convert my webapplication with asp.net MVC with .cshtml views of .net framework 4.8 to migrate to .net 7 then the tool included .net 7-windows as the target framework. this is the same case for projects of type…

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
2,565 questions
asked 2023-01-31T05:24:17.76+00:00
Tanv 0 Reputation points
edited a comment 2023-02-02T08:15:09.3533333+00:00
Brando Zhang-MSFT 1,916 Reputation points Microsoft Employee
0 answers

Azure Service Bus and big process, misbehave

Hello, we have a one IHosted service and in that we implemented service bus receiver mode. In that we set 5 min Message lock duration, but some time process need more time in that scenario but after 5 min again same message picked and again start the…

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
2,565 questions
Azure Service Bus
Azure Service Bus
An Azure service that provides cloud messaging as a service and hybrid integration.
338 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
6,980 questions
Azure App Service Static Web Apps
asked 2023-02-02T07:49:03.6966667+00:00
Pritesh Patel 0 Reputation points
0 answers

Session is not clearing after signing out from application razor pages

Hi, I want to clear my sessions,once i logout from my application. Now when i logout from application and click the back button,its navigating to the previous page. My logout button is given as a menu in _Layout page like this <li…

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
2,565 questions
asked 2023-01-31T04:04:24.65+00:00
Blooming Developer 196 Reputation points
commented 2023-02-02T06:43:12.13+00:00
Zhi Lv - MSFT 18,796 Reputation points Microsoft Employee
0 answers

BackgroundService Serilog how to email?

Hi, In my background service, I would like to send error logs. Although there is an error, the email sink does not work. The error is being written to the file and mssqlserver successfully. Can you please share your experiences? Here is the…

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
2,565 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
6,980 questions
asked 2023-01-31T14:40:53.22+00:00
Cenk 666 Reputation points
commented 2023-02-02T05:17:21.9033333+00:00
Cenk 666 Reputation points
0 answers

CommandName IIS: InvalidOperationException: Cannot find compilation library location for package 'System.Security.Cryptography.Pkcs'

Within my launchsettings.json file I created profile for IIS (Not IISExpress). When I run this application, I get the below error: "InvalidOperationException: Cannot find compilation library location for package…

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
2,565 questions
asked 2023-02-01T19:23:33.4466667+00:00
Amit Rawat 526 Reputation points
commented 2023-02-02T03:27:56.6966667+00:00
Qing Guo - MSFT 161 Reputation points Microsoft Employee
0 answers

Unable to connect to .NET 7 GRPC service on running on Linux App Service

I have a GRPC service written in .NET 7. It works without issue locally. To publish it to an app service, I followed the instructions at https://github.com/Azure/app-service-linux-docs/tree/master/HowTo/gRPC/.NET/.NET%207 It says it's working. I get…

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
2,565 questions
Azure Web Apps
Azure Web Apps
A feature of Azure App Service used to create and deploy scalable, mission-critical web apps.
4,322 questions
asked 2023-01-30T05:06:21.61+00:00
Joe Ourada 0 Reputation points
commented 2023-02-02T02:25:34.1833333+00:00
Joe Ourada 0 Reputation points
0 answers

WebRoot Directory is pointed at explicit path to Development Machine even on Server

I build my Dotnet 6 MVC application on my computer and copy it onto the server. Attempting to load the site results in a startup error. "DirectoryNotFoundException: C:\Users*username*\source\repos\projectname\projectname\wwwroot" It is…

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
2,565 questions
asked 2023-02-01T17:06:01.12+00:00
edited the question 2023-02-02T01:25:54.7166667+00:00
Zhi Lv - MSFT 18,796 Reputation points Microsoft Employee
0 answers

Azure Function (.NET 7 Isolated) create an Azure Function App targeting .NET6?

Today I deployed a new Azure Function App targeting .NET 7 Isolated as framework on Azure. To create the resource on Azure I used the wizard present on Visual Studio 2022, so I both created the new resource and deployed it using VS2022. Going to view the…

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
2,565 questions
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
2,601 questions
asked 2023-02-01T12:39:52.9166667+00:00
Pietro Matteo Peru 0 Reputation points
0 answers

Exception "Scheme already exists" when trying to implement multiple authentication schemes

For a Azure app service that uses two different app registrations for internal and external users I want to implement multiple authentication schemes. I use a ASP.NET Core web application (.NET6) with the following app…

Azure Web Apps
Azure Web Apps
A feature of Azure App Service used to create and deploy scalable, mission-critical web apps.
4,322 questions
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
2,565 questions
asked 2023-01-26T11:56:01.52+00:00
Jörg Auberg (Admin) 0 Reputation points
commented 2023-02-01T11:11:09.33+00:00
Shweta Mathur 11,081 Reputation points Microsoft Employee
0 answers

Why I can't Fake-Mock "System" in .net core 6.0(VS Enterprise 2022)

Why I can't Fake-Mock "System" in .net core 6.0(VS Enterprise 2022), I don't know what happened?   I was trying to use "using System.Fakes; " , But it alert "missing an assemly reference" after following …

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
2,565 questions
Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
2,430 questions
Visual Studio Testing
Visual Studio Testing
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Testing: The act or process of applying a test as a means of analysis or diagnosis.
252 questions
asked 2023-01-31T10:06:39.3233333+00:00
Angelina Jolie 0 Reputation points
commented 2023-02-01T10:12:28.0266667+00:00
Tianyu Sun-MSFT 13,076 Reputation points Microsoft Employee
0 answers

iText7 PDF generation help needed

Hello friends, In my Blazor Server application, I am generating a PDF like this. But requirements changed, I need to insert a table and logo like this sample. How can I manage it? InkedScreenshot 2023-01-31 at 19-47-25 Purchase Order -…

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
2,565 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
6,980 questions
Blazor
Blazor
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
790 questions
asked 2023-01-31T17:32:57.46+00:00
Cenk 666 Reputation points
0 answers

how to fix AutoFixture.ObjectCreationExceptionWithPath: AutoFixture was unable to create an instance from AutoMapper.IMapper

i have below code for xunit testing in asp .net core using AutoFixture.Xunit2;using AutoMapper;using FluentAssertions;using Moq;using MyRBV.AppService.Cars;using MyRBV.AppService.Contract.Cars;using MyRBV.DomainService.Cruds;using…

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
2,565 questions
asked 2023-01-31T15:28:01.8366667+00:00
Mehran Kordavani 0 Reputation points
0 answers

Stored Procedures in Razor Pages

Hi All, I have a booking system developed in Razor Pages. My requirement is , when i make a booking to an activity on a day it should show me the available timeslots . And the timeslots can be one hour or half an hour slots. To maintain this i have two…

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
2,565 questions
asked 2023-01-18T04:08:44.8666667+00:00
Blooming Developer 196 Reputation points
commented 2023-01-31T06:15:41.64+00:00
Blooming Developer 196 Reputation points
0 answers

Model is always null on Razor page

hello All, I have the following code on my cshtml page: @if (Model!=null && Model.EmergencyInfos!=null && Model.EmergencyInfos.ToList().Count>0) { var count = Model.EmergencyInfos.Count; @for…

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
2,565 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
6,980 questions
ASP.NET MVC
ASP.NET MVC
A Microsoft web application framework that implements the model-view-controller (MVC) design pattern.
600 questions
asked 2023-01-30T05:11:54.52+00:00
Anjali Agarwal 101 Reputation points
commented 2023-01-30T06:26:38.4+00:00
Zhi Lv - MSFT 18,796 Reputation points Microsoft Employee