Process ID is 0 in the Event Viewer
Hello All, We have a WPF application built on .Net Framework 4.8. This application writes certain logs into the Event Viewer under the path 'Windows Logs/ Application'. Currently, the logs are written into the 'Event Viewer', but the process id is…
I have method to call from OnCreated_.How to call two string in one time.
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Diagnostics; using System.Drawing; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using…
ASP.NET Gridview Header column not freezing properly
I'm using gridview with freezing header in ASP.NET application. But, freezing is not showing while running the application. what is the issue in the below code...? <%@ Page Language="C#" AutoEventWireup="true"…
UWP pipe client and C++ Fulltrustprocess pipe server - Access to the path is denied
Hello UWP experts, I get "Access to the path is denied" when connecting a UWP namedpipeclient to C++ Fulltrust process namedpipe server in packaged (WAPP) and non packaged mode. Its a simple piece of code to see how the namedpipe works betweek…
How to access at run-time the value of an IEnumerable<T>
Good day all: I'm developing a WEB API that returns a paged response to a jQuerydatatable end point. Because the code repeats itself, I encapsulated all the logic in the generic procedure below. The code works perfectly when I pass the class (entity) I…
Setting PropertyBag Property without allowing custom scripts
We are setting Propery Bag values of a Sharepoint Online Web from an Azure Function using the Microsoft.SharePoint.Client (Microsoft.SharePointOnline.CSOM) Library with the SetPropertyBagValue. For setting a Property Bag value the "Allow Custom…
How to Set Up a Computer-Specific Term Licensing System Structure with C#?
Hello, I am developing a software with C# and I want to license users for 1, 2 or 3 years specific to their computers. I want to control the licensing period information by associating it with an ID specific to the user computer and using an encrypted…
Cant able to get all properties of user by using Graph API in C# ?
Code Line => User user = await graphClient.Users[userObjectId].Request().GetAsync().ConfigureAwait(false); I can able to fetch Green highlighted one but other than that getting null in "user1" (code line) object. question => Is…
How to get pixel correctly, when Windows Magnifier is on?
Hi, I would like to know, if there's some way to get correctly pixel color, which is pointed by cursor, when Windows Magnifier is on? This is code sample, which works perfectly whether magnifier is off: public static Color GetColorAtPosition(int x, int…
Configure AD Groups to use with Roles in .NET Core (C# 8) MVC
I am trying to use policy based authorisation in an MVC app in C# .NET CORE (8) , using membership of OnPrem AD groups to assign roles . This is a snippet of the appsettings.json telling the system I want to grant the Admin role to members of AD…
How to handle nullreference exception in "NM_CUSTOMDRAW" notification message?
Hello, I have a windows forms application having a user control . The user control has a Treeview named as TriView. TriView's drawmode is set to OwnerDrawAll. The form is visible all the time. When I run my application and switch between the…
How to use a svg file as icon in a .net maui class library?
I'm moving some code to a sub project, for better modularity. As I don't want to reference the main app, I want to import the resource to this sub project. Here is the code I need help with: var notificationBuilder = new NotificationCompat.Builder(this,…
Windows.Data.Pdf.PdfDocument Crash with file size greater than 2GB
Same issue as here (no replies there, it's an old thread) https://learn.microsoft.com/en-us/answers/questions/248422/windows-data-pdf-pdfdocument-crash My notes: Crash is not catchable which makes it really hard to find reason for issue or…
How do I localize the AppDescription of Desktop Bridge apps?
I have a UWP application. The project contains the following files: de-DE\Resources.resw en-US\Resources.resw Each file contains a text with the key AppDescription. en-US is set as the default language in Package.appxmanifest. When submitting to the…
C# how to pass a string from a list of object to a List<T>.Sort() method please?
How to pass a string (level) from a list of object to a List<T>.Sort() method please? Data: List<DirItem> items = new List<DirItem> { new DirItem { level="3.5-1", name="Hi",…
Attempting to align contents of GridView cells on ASP.NET Web Forms
Hello, I am attempting to align the contents of GridView cells on ASP.NET Web Forms, but I am encountering an issue where the GridView header is not aligning as expected. Here is how it looks in the image below What steps can be taken to resolve this,…
WinUI 3 - How to Retrieve ActivatedEventArgs Multiple Times?
The documentation states that AppInstance.GetActivatedEventArgs this method will only return the arguments the first time it is called in an app. If a packed single-instanced WinUI 3 app is activated from a protocol multiple times, what approach can…
Cannot click into or scroll word document after opening .... Until I hit Ctrl+Home or interact with some options in the Ribbon Bar
Some of our clients have started reporting a strange issue in Microsoft Word after we open documents using Microsoft.Office.Interop.Word automation When they open a Word document they think that MS Word is hanging. The first indicator that it's not…
Error when try read data from Excel File in ASP.NET MVC
In an ASP.NET MVC app, I am trying to read data from Excel file but I get this error: The error appears in production mode, but in development mode there's no problem. I am making host on Local Host on my computer Microsoft Excel cannot access the file…
Convert SQl query to Linq query in c#
Below is my full sql query need to convert into linq query delcare @personId int=12345 select distinct p.fName, p.lName, p.personId, p.assignedId,0 doId,…