visual-studio

Roslyn – custom build error extension

半世苍凉 提交于 2021-02-17 06:21:27
问题 Is currently a way to extend Roslyn compilation and add some custom rule set that will break a build and show in ErrorList of VisualStudio? I search StackOverflow but there is no answer that works - maybe recently something came up in this topic or maybe there is other way to do this without roslyn? 回答1: Roslyn – custom build error extension Just like Slaks and JoshVarty said, this is an analyzer feature. To create your custom Roslyn analyzer rule, you can check this MS tutorial: C# and

“newly” installed visual studio returns 408 errors on blank program of type 'cannot open source file “errno.h” '

浪尽此生 提交于 2021-02-17 05:44:24
问题 Having installed VS 2019 on my PC, and opening up a new project, i get 408 errors that all say it cannot open various source .h files, such as errno.h, float.h, corecrt.h, etc. or 'the global scope has no "acosf" 'I had just installed visual studio and have no clue how it works, and have not done anything other than install it and open up a new project. Possibly useful information: It was not installed in the default location, but on the D: drive visual studio works fine when I open it with

Can't get rid of exit code in console window

梦想与她 提交于 2021-02-16 20:06:36
问题 So I run some code similar to this: #include <iostream> using namespace std; //yes, I know this is bad practice int main() { int variable(0); cout << "GET INPUT: "; cin >> variable; //do some math cout << variable << "OUTPUT"; return 0; } And on the computers at school I get this output: GET INPUT: 7 7 OUTPUT Press any key to close this window . . . But on my computer at home I get: GET INPUT: 7 7 OUTPUT e:\...\Project.exe (process 10080) exited with code 0. Press any key to close this window

c++: switch statement missing semicolon before close brace

拈花ヽ惹草 提交于 2021-02-16 19:36:11
问题 In the interest of future readers and my own sanity later, I like to make it absolutely clear that switch statements that do not have a default case (due to all cases being covered) or sequential if-elseif-else with a final else that should not do anything must not be omitted and a comment to that effect be included (see example). However, whenever I include the default case in the switch statement and leave it empty I must put a semicolon inside the default case or a compiler error: " Line

Conditional Replace with Visual Studio

拟墨画扇 提交于 2021-02-16 17:58:09
问题 In Visual Studio, I need to substitute a word with another, preserving the first character case. For example I need to subsitute "Bob" with "James" and "bob" with "james" at once, and I must avoid to replace partial matches like "ob" with "james" or "James". This can be done e.g. in Notepad++ with find:"((b)|(B))ob", replace: "(?2j:?3J)ames"; unfortunately this does not work in Visual Studio (I'm using 2015). Is it possible to do this in Visual Studio? Thanks. 回答1: It is not possible with

Add-Migration command only prompt “ScriptHalted”

巧了我就是萌 提交于 2021-02-16 16:31:27
问题 I'm trying to learn how to make App.Net Core application using Razor pages, using this tutorial : https://docs.microsoft.com/en-us/aspnet/core/tutorials/razor-pages/model?view=aspnetcore-3.0&tabs=visual-studio After I made the Movie model and scaffold it successfully, I try to make the initial migration of the database. However, every time I'm using the command Add-Migration , it just prompts ScriptHalted , even when using the verbose option, same with Update-Database . I tried other commands

How to make moveable on the desktop a borderless form in c#? [duplicate]

为君一笑 提交于 2021-02-16 15:24:53
问题 This question already has answers here : Make a borderless form movable? (20 answers) Closed 8 months ago . I want to be able to move with the mouse a form without border and title bar in c#. I looked over youtube but i can't find anything that is working. Someone can help me? 回答1: You can use the form's MouseDown, Up and Move events with a conditional variable like that: private bool IsMoving; private Point LastCursorPosition; private void FormTest_MouseDown(object sender, MouseEventArgs e)

C# cant find a unity auto generated class

落花浮王杯 提交于 2021-02-16 15:08:11
问题 Okay so I'm learning to use the new InputActions and I've created a C# scripts using https://prnt.sc/oyaj5l And this is what I got: // GENERATED AUTOMATICALLY FROM 'Assets/PlayerControls.inputactions' using System.Collections; using System.Collections.Generic; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Utilities; public class PlayerControls : IInputActionCollection { private InputActionAsset asset; public PlayerControls() { /// } } But when I try to create an PlayerControls

C# cant find a unity auto generated class

浪尽此生 提交于 2021-02-16 15:08:02
问题 Okay so I'm learning to use the new InputActions and I've created a C# scripts using https://prnt.sc/oyaj5l And this is what I got: // GENERATED AUTOMATICALLY FROM 'Assets/PlayerControls.inputactions' using System.Collections; using System.Collections.Generic; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Utilities; public class PlayerControls : IInputActionCollection { private InputActionAsset asset; public PlayerControls() { /// } } But when I try to create an PlayerControls

C# cant find a unity auto generated class

北城余情 提交于 2021-02-16 15:07:31
问题 Okay so I'm learning to use the new InputActions and I've created a C# scripts using https://prnt.sc/oyaj5l And this is what I got: // GENERATED AUTOMATICALLY FROM 'Assets/PlayerControls.inputactions' using System.Collections; using System.Collections.Generic; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Utilities; public class PlayerControls : IInputActionCollection { private InputActionAsset asset; public PlayerControls() { /// } } But when I try to create an PlayerControls