Issue to write to the file
Hi, I used the way like using (StreamWriter sw = new StreamWriter(@"z:/oup2.txt", allowappend, Encoding.Unicode)) to write to the output text file but it does work well. Is it being affected by the file type (like Ansi or Unicode one)?
windows.opener() handling with WebView2
In the webform, I have used window.opener for opening a new window that acted as a dialog which required user input, and needed to pass information back to the main window. I am trying to embed this in winform using WebView2 control.The…
SqlDataReader error “Invalid attempt to read when no data is present”
My environment used is Visual Studio 2022 v17.12.4. Language is C# and connecting to SQL Server Express v16.0.1135.2. This is a Windows form using .Net Framework 4.8.1. I am getting the error message “Invalid attempt to read when no data is present”…
How Can I Detect if the System Clock is Moved Forward or Backward in a C# WPF Application?
Hello, In my C# WPF desktop project, I want to detect if the system clock has been moved forward or backward. When such a change is detected, I would like to take specific actions. For example: Show a warning if the system clock is moved forward. Log an…
I want to disable/enable usb and HDMI port whenever my c# wpf (.net Framework 4.7.2) app runs.
Online resources are not present for above queries. I want solution for both admin/non-admin user account. Please help to provide me the solution.
Visual Studio failed to publish to Azure Container Registry
Hi, I have an ASP.NET Core application that I am trying to migrate to Azure. I am using Azure Container Registry to publish my app's images and run it on Container App. Until a few days ago, I was able to successfully push the image to the container…
Office Outlook Interop Issue
I recently started having an issue with our email reading utility after the December 2024 Outlook update. I can no longer read email body from a folder. VS 2022 keeps crashing giving generic access errors. Error Section Snippet: mi.EmailBodyText =…
Cannot Connect Locally to when using Microsoft.CognitiveServices.Speech
Hello Everyone, I am trying to build a method that detects the language of the audio I provide it. My application translates audio but since we batch transcribe and also use a custom model, I cannot use languageIdentification. Therefore, I am trying to…
How to implement alternating row colors in a ListView using Windows App SDK
I have a Windows App SDK app that has a ListView, and I want the row colors to alternate. What is the best way to achieve this?
How to view my content from my database to my home view in .Net core MVC
Hi guys SO I was learning to use .NET Core MVC through the tutorial, and I decided to take it up a notch. While the tutorial has been helpful, it did not really have what I was looking for, and surprisingly, neither do all the AI bots. So what's the…
Could not find a part of the path '/tmp/functions\standby\wwwroot/Templates/template1.html'. ReadAllText on Linux Azure functions app seems not to append correct root path.
Following line of code is breaking for Azure function app in Flex Consumption plan with .net 8 Isolated worker, while its working perfectly on local windows machine. Even though I am using Path.Join for platform specific separator. Here templatePath is…
Timer in windows Service C# Finish before the task ended
Hello, I am creating a Windows service using C#. The program is designed to send SMS messages every 3 seconds. However, sometimes the task takes longer than 3 seconds, resulting in duplicate messages being sent to the user. What advice do you have for…
IVI.visa could not be found
My computer A prompted a message notifying me that the latest update for the NI driver was available, so I decided to update it. After the update, I noticed that the executable file compiled with Visual Studio 2015 runs successfully on Computer A but…
VS 2022 wrongly reports error CS0246
Visual Studio 2022 (version 17.12.4) is reporting error CS0246 'type or namespace could not be found...' for a class EposNowReportsDataSnapshot in a declaration: EposNowReportsDataSnapshot dataSnap = new EposNowReportsDataSnapshot(); The error report is…
How to Disable Scrolling in a Navigation View with WindowsAppSDK
I have a WindowsAppSDK app that uses a navigation view control for navigation. For one of the pages, scrolling should be disabled, allowing the page to shrink to fit within the navigation view's content pane. How can scrolling be disabled and the page…
I can't find the Blazor Web Assembly option, I only see two options the Blazor Web App and the standalone Web Assembly application but none of them give me the ASP .NET Core Hosted option, why?
I do have a question related to this topic because I want to start a project with the Blazor WebAssembly App template but it is no longer only those two that you mention. according to a video it should look like this: I would like to know if the way I…
I want to lock the current HDMI port in C# WPF (.NET Framework)?
I want to lock the HDMI port. If a HDMI port is used for a monitor then if other HDMI port is used then i want to lock existing port. How to do so in C# WPF?
Permissions to access shared mailbox to read and send emails
I'm building an service which will read emails from a shared mailbox and then reply to those emails. It will run in a service, so I'm using app permissions instead of delegated permissions. It's a multitenant application so I've created an app in our…
SetSystemTimeAdjustment disable clock adjust rather than changing the RTC clock rate
I need to override w32tm to adjust the DateTime clock-rate in C#. When I call the kernel32 API: SetSystemTimeAdjustment(ref dwTimeAdjustment, ref bTimeAdjustmentDisabled); I get a return of true, indicating it worked, but when I read back the…
Get Absolute URL in Blazor class
Hello, I have a class inside the Services folder. It contains a LogError(Exception ex) method in which I need the absolute URL in order to get the requested page. However, I am unable to access the HttpContext.Request.Url or any other method/extension…