Posts

Showing posts with the label Visual Studio

Collapse All #regions Only(!) In C# (Visual Studio)

Answer : in Visual Studio 2017 I have to activate 'Collapse #regions when collapsing to definitions' in Tools -> Options -> Text Editor -> C# -> Advanced explicitly to collapse all when pressing Ctrl + M + O Ctrl + M + O will collapse all. Ctrl + M + L will expand all. (in VS 2013 - Toggle All outlining) Ctrl + M + P will expand all and disable outlining. Ctrl + M + M will collapse/expand the current section. These options are also in the context menu under Outlining. Right click in editor -> Outlining to find all options. (After disabling outlining, use same steps to enable outlinging.) The Visual Studio extension Productivity Power Tools 2015 from Microsoft has a feature called Quick Launch Tasks that adds new commands to the Quick Launch menu. One of them is CollapseRegions and it does exactly that. The opposite command is ExpandRegions and it expands all regions for quick browsing of the entire file. These commands can be used pre...

Change Language Of Visual Studio 2017 RC

Image
Answer : You can only install a language pack at install time in VS 2017 RC. To install RC with a different language: Open the Visual Studio Installer. Find an addition under "Available" and click Install Click on the "Language packs" tab and select a language You can have multiple instances of VS 2017 side by side so this shouldn't interfere with your other installation. Disclosure: I work on Visual Studio at Microsoft. Go to Tools -> Options Select International Settings in Environment and on the right side of a screen you should see a combo with the list of installed language packages. (so in my case Czech, English and same as on MS Windows ) Click on Ok You have to restart Visual Studio to see the change... If you are polish (and got polish language settings) Narzędzia -> Opcje Ustawienia międzynarodowe in Środowisko Hope this helps! Have a great time in Poland! This should solve it: Open the Visual Studio Instal...

Can I Hex Edit A File In Visual Studio?

Answer : Menu File → Open → File Select the file to be opened On the open file dialog at the bottom there is a down arrow on the "Open" button Click "Open With..." Click "Binary Editor" Click OK Or for the keyboard geeks out there: Ctrl + o Ctrl + v (paste filename) tab tab ↓ w b Enter In addition to Kevin's answer, with Visual Studio 2017 you need to have the Visual Studio C++ Core Features component installed. Source

Class Designer In Visual Studio - Is It Worth It?

Answer : As a visualization tool, or for exploratory purposes (drawing up multiple options to see what they look like) it's not bad, but generally I find the object browser does fine for most stuff I care about. As a code generation tool, it's a terrible idea. The whole idea that we will design all our code structure first, then fill in the blanks with small bits of implementation is fundamentally broken. The only time you actually know what the code structure should look like, is if you've done the exact same thing before - however then you can just use your previous code, and you don't need to draw up any new code in any kind of designer. If you decide ahead of time to use a particular class structure before you've actually tried to solve the problem, there is a 100% chance that you will pick the wrong design, and shoot yourself in the foot. Short answer: No. Longer answer: No, not at all. There's a reason it hasn't been updated. [EDIT] ...

Can I Profile NodeJS Applications Using Visual Studio Code?

Image
Answer : There is no plugin/support that I am aware of for initiating the profiling, or heap dumps, etc that are available in Chrome's Dev Tools. But, the VS Code debugger can work alongside the dev tools debugger. Start from VS Code, and start debugging as you would. Then open dev tools from any tab in the Chrome/Chromium browser, and look for the green icon indicating a node.js debugging process is running ( manually done via node --inspect ): . Click this green icon and you'll have many of the browser dev tools features for debugging the node.js process, specifically the memory and profiler tabs. Visual Studio Code 1.45 (April 2020) should help, as it integrates Javascript debugging capabilities, including profiling: New JavaScript debugger This month we've continued making progress on our new JavaScript debugger. It's installed by default on Insiders, and can be installed from the Marketplace in VS Code Stable. You can start using it with your e...

Bootstrap 4 Library Name In Libman (CDNJS) From Visual Studio 2019

Image
Answer : From the CDNJS page: twitter-bootstrap You can use the Provider unpkg

Alphabetizing Methods In Visual Studio

Answer : While Resharper has many cool features it has a large impact in CPU and I/O usage and can be very complicated to use. It is also only available under commercial licensing unless you qualify for a few very specific free use licenses. Try CodeMaid. It is free for commercial use and has a much lower performance overhead. I find it easy to use and it is very good for alphabetizing methods. To sort your file, open the file via solution explorer: Right click the open file Code Maid menu (likely near the top of the right click menu) Click Reorganize Active Document Alternatively, using the default CodeMaid hotkeys CTRL + M , Z to sort your active file. Resharper has a Type Members Layout, which can order members by type, accessibility and alphabetically as well. You can also take a look into Ora , which presents a pane in visual studio that is ordered (even though your source may not be). Link's dead. The following answer goes much further than the OP asks,...

Add A PDF Viewer To A WPF Application

Answer : As already suggested by @NawedNabiZada, one tried and straightforward way is to use embedded InternetExplorer to show Adobe PDF Reader ActiveX control. So it assumes you are running on Windows and have Adobe PDF Reader installed. Then you create a user control, window etc. that contains following control: <WebBrowser x:Name="pdfWebViewer"></WebBrowser> In the constructor navigate to blank page: pdfWebViewer.Navigate(new Uri("about:blank")); To load a PDF document to that control use this simple code: pdfWebViewer.Navigate(fullPathToPDF); This approach is used by many Windows software not only WPF apps including SAP client, but has a hidden problem, see this question. The Adobe PDF Reader Addon in Internet Explorer must be enabled for this to work. There are various problems with Acrobat Reader XI, better to use DC version. To enable Adobe PDF go to IE settings, add-ons and find Adobe PDF Reader and enable it (AR XI and above...

Can't Uninstall/reinstall NuGet Package

Answer : In your Solution or Project you will find a file called packages.config . Open this file and you will see all the packages that NuGet has installed. The file will look something like this: <?xml version="1.0" encoding="utf-8"?> <packages> <package id="Json" version="2.0.3" targetFramework="net45" /> </packages> Simply delete the line of your package and save the file. <?xml version="1.0" encoding="utf-8"?> <packages> </packages> Then run NuGet again and it should install. The JSON.NET NuGet package should just work with a Windows Phone 8.0 project. Adding it in VS2012 NuGet manager pulls in the WP7 version of JSON.NET. (packages\Newtonsoft.Json.4.5.10\lib\sl3-wp\Newtonsoft.Json.dll) JSON.NET is now also available as a Portable Class Library which you can consume from WP8 (available in NuGet or in source form). UPDATE: The latest version of N...

Change GIT Account Of Visual Studio Team Explorer

Image
Answer : Look in the Windows Credential manager and remove/update your credentials there: In my case just removing credentials from Windows Credential didn't fix it. I first removed all git and azure related accounts from Windows Credential, then removed accounts from VS>Files>Account Settings, and then VS asked me new credentials and connected to the project. But my commits were still made with the old account! Finally I found out that it was the git config: C:\Users\[USER NAME]\.gitconfig I deleted the whole user section in that file which looks like this: [user] name = [OLD ACCOUNT NAME] email = [OLD ACCOUNT EMAIL] On next commit VS asked me git account information and done. If you want to work with different accounts for different projects on same machine, read this. I am using VS 2017 and this is how I updated my Password for TFS, using Git repository. From the Menu: Team -> manage Connection Click on Manage Connection Link -> Connect ...