Content
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"); …


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 =…
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…
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…


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…


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 =…
.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…


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…


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…


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…
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…


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…


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…


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…


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…


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 …


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 -…
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…


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…


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…

