visual-studio

Edit Image used in Winforms without closing VS

≡放荡痞女 提交于 2021-02-10 15:16:19
问题 I have an image applied to a control in Visual Studio (in this case a PictureBox, but it could be a Button or any number of other controls). I would like to edit this image in a 3rd party program, but VS will not let any other program access the file while it is open. Even if I temporarily change the graphic to something else so that the image I want to save is no longer being used, VS will still not relinquish control of the file. So instead I have to shut down the entire project in order to

Visual Studio 2017 – Enterprise restarts on .Net Core Projects

那年仲夏 提交于 2021-02-10 14:48:12
问题 Just installed Visual Studio 2017 – Enterprise Editio n with the following workloads: Universal Windows Platform Development ASP.Net and Web Development .Net Desktop Development .Net Core cross-platform Development After this installation, when I create a new .net core or .net standard project, the visual studio restarts while loading the project template. Steps to create the behavior: File ⇒ New Project ⇒ .Net Core ⇒ Asp.Net Core Application (.Net Core) Visual Studio tries to load the

Mentioning a user in the System.History

青春壹個敷衍的年華 提交于 2021-02-10 14:26:47
问题 I'm trying to add a new comment to a work item which mentions a user, but using the traditional "@adamh" as you would do on the website does not seem to work via the API. The data updates fine, however the "@adamh" is just plain text, I need to be able to somehow chuck an identity into here. Can anyone point me in the right direction? Thanks! A snippet is here const vsts = require('vso-node-api'); const item = require('vso-node-api/WorkItemTrackingApi') const ti = require('vso-node-api

Visual Studio breaks on Handled Exception as if it was Unhandled

北战南征 提交于 2021-02-10 14:21:17
问题 I use Activator.CreateInstance to create class from Type. In case where constructor throws exception (That happens and is totally expected) it is caught by try..catch. But Visual Studio breaks as if it was unhandled. I managed to simplify this issue: Screenshot of VS Code in Tio using System; public class Program { public static void Main() { try { var foo = Activator.CreateInstance(typeof(Foo)); catch {} Console.WriteLine("Finished"); } class Foo { public Foo() { throw new Exception(); } } }

Visual Studio breaks on Handled Exception as if it was Unhandled

廉价感情. 提交于 2021-02-10 14:20:30
问题 I use Activator.CreateInstance to create class from Type. In case where constructor throws exception (That happens and is totally expected) it is caught by try..catch. But Visual Studio breaks as if it was unhandled. I managed to simplify this issue: Screenshot of VS Code in Tio using System; public class Program { public static void Main() { try { var foo = Activator.CreateInstance(typeof(Foo)); catch {} Console.WriteLine("Finished"); } class Foo { public Foo() { throw new Exception(); } } }

Setup of IMTransform Video Processor for color space conversion

荒凉一梦 提交于 2021-02-10 12:44:16
问题 I am trying to do some basic color space conversion using Video Processor MFT. My camera natively supports NV12 and I need RGB24, to code some shader which will provide cartoon-like effect. Here is definition of class Media which is used to perform MF. class Media : public IMFSourceReaderCallback //this class inhertis from IMFSourceReaderCallback { CRITICAL_SECTION criticalSection; long referenceCount; WCHAR *wSymbolicLink; UINT32 cchSymbolicLink; IMFSourceReader* sourceReader; MFT_REGISTER

Unable to Count Number of Digits as the Input

倖福魔咒の 提交于 2021-02-10 12:25:10
问题 My Program : To get input from the user about personal details and then output the information. My Problem : The program is unable to count the number of digits as the input for Phone Number field. It accepts more than 10-digits as an input for the phone number. My Goal : To check the input for 'Phone Number' and make sure that the number is 10-digits. My Code : #include <iostream> #include <string> #include <limits> using namespace std; class Personal_Details { public: void setFirstName

Any way to avoid warning C6386, without disabling it or Code Analysis altogether

青春壹個敷衍的年華 提交于 2021-02-10 07:57:09
问题 Visual Studio 2019 started showing Code Analysis warnings as in-editor green squiggles by default. These may be extremely useful for students learning C programming, because they catch classical mistakes, such as off by one array accesses. Unfortunately false positives may completely ruin the learning experience and I fear that I will have to ask the students to disable the feature in order to avoid having them worry on non existing problems. This short snippet doesn't cause any warning:

Problem getting the IDesignerHost of a custom control in VS10 .NET form

血红的双手。 提交于 2021-02-10 06:52:27
问题 According to docs.microsoft.com, I'm trying to get my form's IDesignerHost in design time: private static Form _findForm; protected override void OnCreateControl() { if (_findForm == null) { _findForm = FindForm(); } if (_findForm == null) { throw new Exception("FindForm() returns null."); } // NullReference //IDesignerHost dh = (IDesignerHost)_findForm.Site.GetService(typeof(IDesignerHost)); IDesignerHost dh = (IDesignerHost)GetService(typeof(IDesignerHost)); Console.WriteLine(dh == null); /

.net core project dependencies - yellow triangle

故事扮演 提交于 2021-02-10 06:47:39
问题 My .Net Core project has a yellow triangle on dependencies, but when I open it up, none of the child entries have a yellow triangle. When I hover over dependencies, I don't see any tooltip telling me what's wrong. How can I check to see what is causing this yellow triangle to show up? I did what @oandreeeee suggested and increased the log level of my build and I noticed this: C:\Program Files\dotnet\sdk\2.2.104\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ConflictResolution.targets(41,5):