Skip to main content
The 2024 Developer Survey results are live! See the results

All Questions

Tagged with
0 votes
0 answers
26 views

Any pitfalls in upgrading a WPF application from .Net 6 to .Net 8?

We're looking to upgrade some large WPF solutions from .Net 6 to 8, and my understanding is that the process should be straightforward (changing the projects' target framework). But are there any ...
Andrew Stephens's user avatar
0 votes
1 answer
29 views

Can't load System.Net.WebHeaderCollection

.net 6.0 project, it throw the exception can't find a dll version 6. this is the error: System.AggregateException: One or more errors occurred. (Could not load file or assembly 'System.Net....
user2282331's user avatar
0 votes
1 answer
84 views

How does ObservableCollection/INotifyPropertyChange work when object is changed

I have a situation where in one view model some properties on an object are updated. In another view model, I subscribe to a message and then update a collection with this new object, e.g.: ...
WSC's user avatar
  • 978
0 votes
2 answers
85 views

Need help to replace a switch in C#

I have a console application in .NET 6 that receives one argument, and based on that, has to decide which operation will be executed. At first, I had all the operations as static methods and ...
DevSurferPTPXO's user avatar
0 votes
0 answers
42 views

.Net 8 Project Reference Specify .net Version of Multi-Targeted Transitive Project Dependency

I have a .net6 sdk project that I need to upgrade to .net8 for some new functionality. It has some shared project libraries with other projects that are still .net6. Project A includes Project B which ...
lrfalslev's user avatar
0 votes
1 answer
74 views

Setting C# language version used by Docker to build my project

I have a net6.0 project with <LangVersion> set to latest, allowing us to use latest C# features (I realize now this is probably bad practice?). It all builds fine from within Visual Studio, but ...
harveyAJ's user avatar
  • 917
0 votes
0 answers
30 views

Fortify flaging .Net6 API returning File from internal server vulnerable to XSS attack

using (HttpClient client = new HttpClient()) { string FindDocumentURL = string.Concat(internal server URL builder); response = await client.GetAsync(FindDocumentURL); if (response....
Saqheeb's user avatar
0 votes
1 answer
81 views

Could not load Krabsetw in C# .NET 6.0

I am using C# with the .NET 6.0 framework in Windows 10 and trying to use the NuGet Microsoft.O365.Security.Native.ETW package, corresponding to the Microsoft Krabsetw library, which allows the use of ...
Lifka's user avatar
  • 249
0 votes
0 answers
23 views

Return DistinguishedName using ComputerPrincipal from ActiveDirectory

I want to get the DistinguishedName using ComputerPrincipal from the Active Directory only for the user that is signed in. With the code below the searchResultOrgUnit returns me all PC's that are ...
leoxrmd's user avatar
  • 47
0 votes
1 answer
33 views

How to Get Microsoft .NET SDK 6.0 in the msix format

I am doing this on a non-admin user and I am trying to get .NET 6.0 Sdk as MSIX. I tried dotnet-install script but nothing worked. And when I ran dotnet --list-sdks but there was none. There were only ...
hackerkid 119's user avatar
1 vote
1 answer
46 views

How Can I Register and Search Through an Arbitrary Number of Classes Using Dependency Injection?

I'm trying to solve an architecture problem involving a gigantic legacy file with several massive switch statements that need to be broken up into discrete classes. I want to solve this by having a ...
Sabelyn's user avatar
  • 13
1 vote
4 answers
100 views

Inserting an XML string in existing document with C# breaks everything

I'm using C# with the System.Xml classes to manipulate an existing XML document. In particular, I need to insert pieces of XML that I have in string form inside specific nodes in the document. To do ...
Master_T's user avatar
  • 7,671
0 votes
1 answer
112 views

.NET 6.0 and Framework Compatibility

I got a desktop app written in Visual Basic in Visual Studio using .NET Framework 4.8. This runs on a computer. I got another app which is a C# desktop app, also developed in Visual Studio, but .NET 6....
CuriousJunior1's user avatar
2 votes
1 answer
123 views

Reduce number of conditional operators(4) used in the expression (maximum allowed 3) in Expression<Func<T,bool>predicate

I am using a the below function to fetch data from mongoDB: Task<IEnumerable<T>> ReadDocuments(Expression<Func<T,bool>> predicate) There are multiple conditions based on which ...
Apple Eclair82's user avatar
2 votes
1 answer
39 views

Should I wrap new HttpRequestMessage() in a using statement?

I found the following code: using (var requestMessage = new HttpRequestMessage(HttpMethod.Delete, endpoint)) { ... HttpResponseMessage response = await _client.SendAsync(requestMessage); .....
David Klempfner's user avatar

15 30 50 per page
1
2 3 4 5
60