Category "c++sharp"

How to declare global variable in Program cs and use it in controllers in .NET 6.0 Web Api

I have default Program.cs file from Web Api template in .NET 6.0. I am adding variable "test" so I can use its value in controllers. var builder = WebApplicatio

How to declare global variable in Program cs and use it in controllers in .NET 6.0 Web Api

I have default Program.cs file from Web Api template in .NET 6.0. I am adding variable "test" so I can use its value in controllers. var builder = WebApplicatio

.net Core 3.0, DirectoryNotFoundException with Xunit Integration test

I have a new issue working on migrating my Xunit integration test on .net core 3.0. I moved the project in a subfolder and now I have a DirectoryNotFoundExcepti

WCF Service Send Email On Outlook | Exception from HRESULT

I have created a WCF Project in .NET 4.5 to send emails from Outlook 2013 Or 2016 and host it on windows server 2012 and iis 8. When run Service from Visual

How can you get the selected option of a dropdown with Playwright

I am using the C# Language Bindings of Playwright. Example HTML: <select id="txtType" name="Type" class="form-control"> <option>Blog Posts&l

How can you get the selected option of a dropdown with Playwright

I am using the C# Language Bindings of Playwright. Example HTML: <select id="txtType" name="Type" class="form-control"> <option>Blog Posts&l

How to set value by call variable name from string c#

Now I'm new for c# development. I have 100 data from Array and also have 100 variables. How can I match 100 data with 100 variables? for example for(int cou

Avoiding generic class with many type parameters, when the consumer of those types are tightly coupled

I am trying to come up with a way to do this where I can have type safety but also loose coupling of a couple of different components in my class. I am running

c# check value at design time

Is there any way, perhaps by use of Contracts, to check whether a variable's value conforms to some rules during design time in Visual Studio 2022? I.e. int is

Azure File Share : Find files with same first part of the filename C#

I have large number of files in a file share directory. Some of the files have their first part of the names are similar. I have to copy these files to another

how to create list of lists in c#

I am trying to create list of lists, where the large list represent paper contain collection of small list represent question, list of question consist of quest

ASP.NET MVC Core API Serialize Enums to String

How to serialize Enum fields to String instead of an Int in ASP.NET MVC Core 3.0? I'm not able to do it the old way. services.AddMvc().AddJsonOptions(opts =&g

. Symbol Breaks Routing

Currently scratching my head as to why routing to one of my functions is failing. The route is defined via an attribute: [Route("emails/{emailAddress}")]

Make RichTextBox automatically scroll to bottom when content is added

I have a WPF UserControl with a BindableRichTextBox: xmlns:controls="clr-namespace:SysadminsLV.WPF.OfficeTheme.Controls;assembly=Wpf.OfficeTheme" . . . <cont

Valid Azure Blob Metadata Identifiers

I've been trying to add metadata on an .mp4 video that is stored on an Azure Blob. I want to add opengraph tags and when I try and enter them in, I get a messag

Oracle OLEDB Memory Leak 12.2 and Greater (SSIS and C#)

I have found an issue with the Oracle OLEDB Driver “Oracle Provider for OLE DB” and MS SQL SSIS Packages. This was first found in SQL SSIS packages

How do I mock AddAsync?

I'm writing unit test. For testing the method below, public async Task<Guid> CreateWebJobStatus(string blobId, Guid loggedInUserId, string loggedInUserE

Custom Tooltip on LineChart (lvChart)

I closely follow step-by-step lvChart Customizing Tooltips in trying to build a custom tooltip for LineChart points. But I get empty tooltip content. Other than

LINQ query returns error "The expected type was 'System.Int32' but the actual value was null."

So this is the query: from c in Contents join cs in DepartmentSharings on c.ContentId equals cs.ContentId select c.PrivateCategoryId.Value When I run this I

Could not load file or assembly 'Microsoft.IdentityModel.Protocols.WsFederation

I have a ASP.NET legacy project to which ADFS authentication needs to be added. So I did the same but when I run the application, I keep getting this error: