1,643 questions
0
votes
1
answer
86
views
Deducing instance to handle an object in C#
I am extending my C# J2K library to dynamically register codecs from other assemblies. That part is working, but I am having trouble understanding IsAssignableFrom(TypeInfo) and how I can deduce which ...
0
votes
0
answers
36
views
Are database transactions supported in Elsa.Client.Services.IWorkflowDefinitionsApi?
We use Elsa 2.14.1 and calling Elsa.Client.Services.IWorkflowDefinitionsApi.SaveAsync endpoint (/v1/workflow-definitions/{workflowDefinitionVersionId}) to store dynamically generated workflow in ...
1
vote
1
answer
72
views
Error NU1202 MongoDB.Driver update issues
Have a ProjectA created for .NET Standard 2.1 with nuget packages MongoDB.Driver v2.12.0 and AspNetCore.HealthChecks.MongoDb v3.1.3.
As part of MongoDB.Driver package upgrade, it updated the MongoDB....
0
votes
0
answers
27
views
How do I register a class to WMI in .NET?
I'm migrating an old .NET Framework shared library to .NET 9 (or something close).
It uses a combination of System.Diagnostics.Tracing.EventSource (to put the event) and System.Management....
1
vote
1
answer
424
views
Found project reference without a matching metadata reference
Starting with .NET 9 I have a Solution containing a Blazor webapp, a couple of .NET 9 class libraries and ONE class library in .NET Standard 2.0 with only 2 entities.
When I run the Blazor project ...
0
votes
0
answers
54
views
NET Identity in web.config
We have an old website in (.NET Framework, Web application) here that was created years ago and where we still do ongoing development. Because we do not have enough time to rewrite everything, I want ...
1
vote
3
answers
103
views
Last Boot Time in .NET Standard 2.0
In .NET 8.0 I can do the following to fetch the last boot time of the PC:
public static DateTime? GetLastBootTime()
{
DateTime? dtBootTime = null;
SelectQuery query = new SelectQuery(@&...
0
votes
1
answer
396
views
Static abstract members in interface in .Net Standard 2.1
I want to create a static abstract member in an interface within a .NET Standard 2.1 project. Everything I've read says that this just requires C#11. I set the LangVersion tag in the project file but ...
1
vote
1
answer
554
views
Multiple NuGet packages referencing a common class library in the same solution
I have a single Visual Studio solution with multiple .NET Standard 2.0 C# class library projects:
MainSolution
---- ClassLibA
---- ClassLibB
---- CommonClassLib
ClassLibA and ClassLibB are both going ...
-1
votes
1
answer
50
views
Looking for a CLI utility that converts dotnet framework assembly to a dotnet standard assembly
I have a set of trivial DotNet framework assemblies ("dlls") that I wish to convert to dotnet stanard 2.0.
By "trivial" I mean that they contain Enum definitions and trivial ...
1
vote
1
answer
175
views
How to fix 'notnull type constraint is unavailable' in .NET Standard 2.0 when implementing custom Microsoft.Extensions.Logging.ILogger interface?
I am implementing a custom SQL Server implementation of Microsoft.Extensions.Logging.ILogger. The NuGet package states that it is compatible with .NET Standard 2.0, so I added a class library to my ...
0
votes
0
answers
107
views
.Net Multi Targeting the solution Issues
Compatibility Issues with .net framework Nuget code
We have an WEB API application which is written in VB.Net and running on .net framework 4.6.1.
The goal is to rewrite this into .Net 8 with c# and ...
2
votes
1
answer
682
views
sgen/microsoft.xmlserializer.generator fails to generate
I've created a new .NET Standard 2.0 project and added the following class:
using System;
using System.Xml.Serialization;
namespace MyFunnyLib
{
[Serializable]
public class Foo
{
[...
2
votes
0
answers
671
views
System.TypeInitializationException: The type initializer for 'Azure.Core.ClientOptions' threw an exception
I am using the Microsoft.Graph library and I am getting this exception upon sending an email. The full exception is:
System.TypeInitializationException: The type initializer for 'Azure.Core....
0
votes
0
answers
151
views
C# CodeAnalysis can't compile code with dynamic keyword
I have an issue where I'm trying to compile code with the Microsoft.CodeAnalysis.CSharp package. I wrote a function that compiles the code into an assembly and returns it. This function was originally ...
4
votes
2
answers
5k
views
How to register Custom Events in Application Insights by using OpenTelemetry .NET
I am implementing a SDK capable of registering telemetries in external services and as I want it to be vendor neutral, I am using OpenTelemetry. One of the exporters that I am using is the Azure ...
0
votes
0
answers
75
views
How to ensure that implementations have a static factory method in older versions of .NET?
Overall, I'm looking for a clean and safe solution to write an interface/abstract class that ensures a private constructor and public static factory method on its implementation(s), in a context where ...
2
votes
1
answer
61
views
Ravendb get Latest orderId group by customer
I have customers in RavenDB and orders associated with these customers. Currently, when attempting to use the GroupBy operation in a document query, I encounter an error in RavenDB stating that it is ...
0
votes
1
answer
3k
views
System.ServiceModel.Primitives is simply not being referenced at build time (though corresponding DLL seems to be properly installed)
In a .Net Standard 2.0 project, I am unable to load a reference to System.ServiceModel.Primitives... It says that Primitives doesn't exist on the System.ServiceModel namespace, even though I installed ...
1
vote
2
answers
1k
views
.Net Standard Library With Nuget Packages Used in .Net Framework Project
I'm currently working with two projects: a .NET Standard 2.0 class library and a .NET Framework 4.6.2 console application. In my .NET Standard library, I'm using the System.Diagnostics.EventLog ...
0
votes
1
answer
857
views
.NET class library with WinForms dependency targeting .NET Standard 2.0
I am migrating a .NET Framework class library that now needs to be compatible with both .NET Framework and .NET Core applications; the library relies on the System.Windows.Forms namespace.
To achieve ...
0
votes
0
answers
424
views
Challenges Running a .NET Standard 2.0 Test App on Linux and macOS
I'm currently working on creating a test application using .NET Standard 2.0 as the target framework. In my current project, my .csproj file looks like this:
<Project Sdk="Microsoft.NET.Sdk&...
5
votes
1
answer
230
views
Exception when using ExecutionContext.SuppressFlow() in .NET 7
My WebApi client project is loosing the WindowsIdentity of the current user when executing SendAsync Method from HttpClient.
HttpContext.User returns the application pool identity. Not the ...
1
vote
0
answers
54
views
Deploying file from NuGet package that copies to consuming application's output directory automatically
I am trying to create a .NET Standard 2.0 NuGet package that standardizes how I consume NLog across .NET Framework and .NET Core applications. I have an nlog.config file that is the standard ...
1
vote
0
answers
140
views
Visual Studio 2019: Error CS0012 with NetStandard
I'm very new to software development and am trying to get some web software to run and we can't figure out what's causing this issue. We are getting the following error:
CS0012: The type 'System....