Category "c++sharp"

Unable to connect AWS Redis cache in .net C# - RedisConnectionException: 'No connection is active/available to service this operation

I have created AWS ElasticCache - redisCache in console. I want to access same from .net core/framework application - But unable to connect same. Config

DataGridView RowCount vs Rows.Count

If I have a DataGridView uxChargeBackDataGridView. Are the following syntactically different but effectively the same?: int numRows = uxChargeBackDataGridVi

Error trying to create Mock.Of<ControllerContext>() for ASP.Net Core 3.1 Unit Test

As per last section of the Moq Quickstart defined here, I am trying to configure the following Mock in order to pass Form values to the controller method under

How to get group managed service accounts using UserPrincipal.FindByIdentity?

I have one gMSA user created. I am trying to get the user sid- ContextType contextType= ContextType.Domain; PrincipalContext domainContext = new PrincipalConte

Where to read docs for Microsoft.CodeAnalysis? [closed]

In Visual Studio 2015 (after installing the SDK preview), I created a 'diagnostic with code fix' project. The skeleton code is full of interes

Fastest way to move outlook emails to postgresql db using Npgsql

I have around 200 000 emails in outlooks public folders. Exporting to pst is a little bit fast but I don't know if psts are reliable. Also decoding it perfec

In visual studio, how do you break the debugger when a property changes that you do not own in a managed language (like C#)

I've got a weird situation where something is setting the TopMost property of the main MDI form to true. After much trial and error we're pretty sure this must

Implementing SSH Server in C#/.Net

A project we're working on just got a new requirement added to it: it has to be able to receive files through SFTP (SSH) using key/pair authentication. We've be

Where to place business logic layer in relation to data access while providing unit testability by dependency injection?

I am looking for a way to have a separate layer of business logic in a MVC4 app with Entity Framework, without having to inject my (real or fake) database conte

How can a razor for loop be used in a javascript script tag?

The error generated is "Conditional Compilation is turned off". Conditional Compilation hack from MSDN is prevalent but fails. There are several questions lik

How to step into NuGet packages outside of debug session

Following situation: We have a framework that sits in an hosted GitLab repository. We have a pipeline that creates a NuGet package nuget pack framework.sln whic

Extract Xunit test class name from ITestOutputHelper object (C# )

Can I use the ITestoutputHelper injected object to get the calling class name?

Opening encrypted emails with c#

I'm working in Visual Studio 2012 to build a relatively simple add-in for Outlook 2010. Machines are Win 7 Enterprise 32 and 64. The purpose of the add-in is

How to support ListBox SelectedItems binding with MVVM in a navigable application

I am making a WPF application that is navigable via custom "Next" and "Back" buttons and commands (i.e. not using a NavigationWindow). On one screen, I have a L

Authorization in ASP.NET Core. Always 401 Unauthorized for [Authorize] attribute

For the first time I'm creating Authorization in ASP.NET Core. I used tutorial from here TUTORIAL The problem is when I sending request from postman: Authori

how to debug with xUnit?

I'm learning xUnit and so far, have found it to be a most useful tool. It's making me rethink some of my coding tactics to TDD instead. However, I've come acro

How to return a file using Web API?

I am using ASP.NET Web API. I want to download a PDF with C# from the API (that the API generates). Can I just have the API return a byte[]? and for the C# ap

Listbox selected items search with trackbar keyword or Range slider update on save

Language: C# IDE: Visual Studio 2013 Question: How do I set values to a trackbar in VS and then use these values as a variable for another process of my progr

How to uninstall ClickOnce application?

I was looking everywhere for this answer, but all related questions on SO are very old. This question is from 2009 and the best (and only answer) has 3 steps. R

Add new Required Field to one of table with EF Code First Migration

I am using EF Code First Migration. I already have lots of data on production Db and I would like to intorduce a non nullable field. How it could be possible?