How to cut a list

Alright, I am pretty new to programming but I do know that 0-0 == 0. Can anyone explain Why I get this error? I have searched high and low and cannot explain this. Every implementation of slicing that I've seen is done like this (except for using bui

Use Moq to see if the method was called with a value

Using Microsoft Visual Studio 2017's built in test with Moq. I have a simple class that creates some content, then sends the content to a notification system. I need to test if the notification system was called, but that the call included some text.

How to get all the files in a folder?

In my program I have a treeview and a folderbrowser and a datagridview. The user uses the folder browser to choose a folder which contains bunch of shows which all have different seasons. My program displays the folders for the shows and the season f

Visual Studio Team Explorer - View Git Commands

New versions of Visual Studio Team Explorer has built in support for Git. I want to know if there is an option to view the Git commands executed while using the Team explorer for Git actions like Commit and Push. Also would be better to have an optio

Reference Management in Visual Studio 2012

Please help me understand: I have a Visual Studio project. It has Nuget package manager enabled. I install several libraries. The library versions are shown in packages.config. Each library has a corresponding entry in References. Now, say I want to

Can not debug adding Visual Studio

Question says it all. I'm trying to write a Visual Studio addin (2012), and the experimental instance always launches without running anything in the addin. No breakpoints are hit in the main instance, nor does the addin get loaded by the experimenta

Formatting the constructor of the class f #

I am creating a program that takes an email and converts it into json. In the interest of learning functional languages I thought it would be a good opportunity to learn F#. So first off I want a message class that can then easily be serialized into

Can not Compile TypeScript Files in Visual Studio 2012

I downloaded and installed TypeScript extension for VS 2012, I got my first sample compiles by manually dragging the ts file onto the tsc.exe file! because no other way to compile the file will work. I don't want to manually do this everytime I want

Can the visual studio suggest variable names?

Eclipse can automatically create (or suggest) variable names. For instance if I have a class named MyClass and i want to create an object from it, MyClass myClass = new MyClass(); In Eclipse after class name (MyClass) i hit ctrl+space key and Eclipse

Prevent Designer from removing attributes on control members

I want to mark certain controls on my Windows Form with Attributes. So I added the Attribute in my TestAttributes.Designer.cs: [AmbientValue(true)] private System.Windows.Forms.Label label1; But whenever I change the Modifiers-property of label1 usin

Visual Studio Debug Mode, Allow Exception to kill the program

I have a piece of code in C# that's essentially like the following... WriteFile(); try { RunTest(); } finally { DeleteFile(); } Now this has been planned so that even on failure, it cleans up the files it left behind. This works when not run in debug

How to call the function?

I need to get the position of the mouse on click in a form, and save the x and y coordinates. I made this simple function: public void kokot (MouseEventArgs e) { x = e.X; y = e.Y; this.Invalidate(); } How can I call it? When I try kokot() it doesn't

Obtaining a User Control to Display in the Toolbox Pane

I have created a user control in a .dll. I have a reference to that .dll in my project in visual studio. How can I get the control to display in my toolbox pane?You should right-click the Toolbox area, click on "Choose Items", in the ".Net

Visual Studio 2008 with SQL Server 2005 Developer Edition

I am trying to add a database to the App_Data location in an ASP.NET MVC 2 application in Visual Studio 2008 (VS). I have SQL Server 2005 Developer Edition installed on the local machine. However when adding the database VS complains that SQL Server

Deploy the C # Windows Forms application on Windows and Linux

I know that it's possible to create MSI installers in Visual Studio using a setup project, but what would be the best way to automatically create a setup file (or packaged file of any kind) for both Windows and Linux? I like the MSI installer on Wind

Visual Studio 2005 Designer Moves Controls and Resizes Form

When i open a form in visual studio 2005 (c#) the designer automaticaly resize the form and move/resize controls without touching the designer at all. The source file is changed and when i close the designer i'm asked to save the *.cs file. I tried t

how to set the breakpoint in this way?

I want to set a break point and wants it to be triggered when a piece memory (begin address and length are known) are changed. I am working on Windows Server 2003 x64 platform. Either solution in Windbg or solution in Visual Studio are fine. My purpo