Showing posts with label Visual Studio. Show all posts
Showing posts with label Visual Studio. Show all posts

Friday, 15 September 2017

Inline Images not showing for Work Items in Visual Studio with 401 unauthorized error

To fix this, right click the broken image link from the Visual studio work item description pane, then copy the link from the properties dialog (it looks like a label, but you can select all on it by right mouse clicking).

image

Then simply copy and paste that into Internet Explorer bar, and when prompted enter your credentials.

Next, back in Visual Studio, just click the refresh work item button on the header of the work item window, and do this once for each in line image in the description.

Friday, 2 June 2017

Visual Studio Work Item Images broken

The case of the missing image…

image

Turns out this was due to my old windows credentials being cached on the tfs server credentials cache.

To fix this, I logged onto the tfs server directly via my admin account and updated the credentials there in the windows credentials manager.

Also ran fiddler in the background and cleared the winnet cache as well

Then it refresh a few times on the work item ticket back in visual studio, and hey presto they are all showing again.

Wednesday, 15 February 2017

Resharper shorcut cheat sheet

Quite by chance today I stumbled across a new way to learn Resharper shortcuts.

In visual studio, when editing a file, tap the ctrl key three times in quick succession. This brings up the cheat sheet

clip_image002

Then hold down the Ctrl key, Shift Key, or Alt Key when the dialog is open, and you'll see what short cuts are applicable to the development pane that you're in

clip_image002[4]

Thursday, 12 January 2017

Macros alternative for VS 2013 /2015

Finally an alternative to

https://vlasovstudio.com/visual-commander/professional_edition.html

which lets you record as well…

https://visualstudiogallery.msdn.microsoft.com/d3fbf133-e51b-41a2-b86f-9560a96ff62b/view/Discussions/3

image

Find action constants for dte.Find listed here…

https://msdn.microsoft.com/en-us/library/aa301226(v=vs.71).aspx

e.g.

 

dte.ExecuteCommand("Edit.Find");
dte.Find.FindWhat = "DROP CONSTRAINT";
dte.Find.Target = 1; //vsFindTarget.vsFindTargetCurrentDocument;
dte.Find.MatchCase = false;
dte.Find.MatchWholeWord = false;
dte.Find.Backwards = false;
dte.Find.MatchInHiddenText = false;
dte.Find.PatternSyntax = 0; // vsFindPatternSyntax.vsFindPatternSyntaxLiteral;
dte.Find.Action = 1; //vsFindAction.vsFindActionFind

Wednesday, 4 January 2017

Edit.SelectToLastGoBack in Visual Studio

 

image

Very handy shortcut for this Ctrl + = in visual studio. Basically selects all the text between the last two navigation points you were looking at in a text file.

Monday, 9 May 2016

Unshelving from one branch to another in TFS

 

This works fine…

tfpt unshelve /migrate /source:$/MyProject/Fb3.9.8 /target:$/MyProject/Main

But put quotes round and it does NOT work

tfpt unshelve /migrate /source:"$/MyProject/Fb3.9.8" /target:"$/MyProject/Main"

Further information can be found here…

http://geekswithblogs.net/TarunArora/archive/2011/06/06/unshelve-shelveset-created-from-one-branch-to-another.aspx

Thursday, 14 May 2015

C# 6 and Roslyn plugins to VS 2015 RC

In order to get the refactoring support listed here...

https://github.com/DustinCampbell/CSharpEssentials

you can simply install the following versions of the Tools, Extensions and Updates in Visual Studio 2015 RC.

image

Monday, 16 February 2015

TFS Http 404 not found error

If you get an HTTP 404 not found error when connecting to TFS

clip_image002

Delete all the files in this folder

%userprofile%\AppData\Local\Microsoft\Team Foundation\4.0\Cache

You also may receive an error message in the VS 2013 output window, reading as follows...

We were unable to automatically populate your Visual Studio Online accounts.

The following error was encountered: One or more errors occurred.TF205020: Could not connect to server ‘tfs.russellreynolds.com\DefaultCollection’. This server was used in your last session, but it might be offline or unreachable. Confirm that the server is available on the network. To attempt to connect again, or to a different server, click ‘Connect To Team Foundation Server’ in Team Explorer or the Team menu.

The server returned the following error: HTTP code 404: Not Found

Wednesday, 11 February 2015

Resharper running slowly

Just found a neat trick for speeding up the Ctrl+T navigation slowness against my solution with JetBrains Resharper 8.2

1. Clean out your cache folder for the solution...

%userprofile%\AppData\Local\JetBrains\ReSharper\v8.2\SolutionCaches

2. Resinstall Resharper

Monday, 8 December 2014

How to find all your shelve sets in Visual Studio 2013

The Visual Studio 2013 IDE will by default only list the first 100 shelve sets that you have under your name.

To find all shelve sets for every developer, you can change the name filter to *

To find all the shelve sets for yourself, you can change the filter text box to *, and then hit Enter. This will then list all the shelve sets that you have not just the first 100 of them.

Tuesday, 12 August 2014

Resharper equivalent for clipboard ring

Assigned Ctrl+Shift+V to ReSharper.ReSharper_PasteMultiple instead as I find this to be a much more useful interface than trying to guess what the last 10 items on your clipboard are.
Plus it supports way more items than just the 10 you get with Visual Studio.
image

Monday, 2 June 2014

Migrating a shelve set to another branch

Use the following command from Visual studio team foundation server power tools

http://visualstudiogallery.msdn.microsoft.com/f017b10c-02b4-4d6d-9845-58a06545627f

tfpt.exe unshelve "shelvesetnamehere" /migrate /source:"$/Main" /target:"$/Branch"

Wednesday, 21 May 2014

Remove capitalization from Visual Studio 2012 / 2013 menus

http://blogs.msdn.com/b/zainnab/archive/2012/06/14/turn-off-the-uppercase-menu-in-visual-studio-2012.aspx

Manual Registry Change

Open the registry editor and go to HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0\General\
(For Windows 8 Desktop Express go to HKCU\Software\Microsoft\WDExpress\11.0\General) //special thanks to msm8bball for the update
(For Web Express go to HKEY_CURRENT_USER\Software\Microsoft\VSWDExpress\11.0\General)

  1. Create a new DWORD value called SuppressUppercaseConversion set to 1

or

PowerShell Goodness

In the PowerShell window copy the script below and paste it in then press Enter:
Set-ItemProperty -Path HKCU:\Software\Microsoft\VisualStudio\11.0\General -Name SuppressUppercaseConversion -Type DWord -Value 1

Tuesday, 20 May 2014

Macros in Visual Studio 2012 / 2013

Use the following visual studio extension in order to recreate the macros that you were used to using in VS 2010 and below
http://vlasovstudio.com/visual-commander/
image
Also to run the macro, try using the Ctrl+Q shortcut menu in VS 2013, as follows
image

Or customise your toolbar


The attach to process macro will now look like this as a new Visual Commander command using VB v4.0 language
Imports EnvDTE
Imports EnvDTE80
Imports Microsoft.VisualBasic

Public Class C
    Implements VisualCommanderExt.ICommand

    Sub Run(DTE As EnvDTE80.DTE2, package As Microsoft.VisualStudio.Shell.Package) Implements VisualCommanderExt.ICommand.Run
        AttachToProcess("MyProcessName.exe", DTE)
    End Sub

    Private Sub AttachToProcess(ByVal ProcessName As String, DTE As EnvDTE80.DTE2, Optional ByVal Script As Boolean = False)
        Try
            Dim dbg2 As EnvDTE80.Debugger2 = DTE.Debugger
            Dim trans As EnvDTE80.Transport = dbg2.Transports.Item("Default")
            Dim dbgeng(1) As EnvDTE80.Engine
            If Script Then
                dbgeng(0) = trans.Engines.Item("Script")
                'Array.Resize(dbgeng, 1)
            Else
                dbgeng(0) = trans.Engines.Item("Managed")
            End If
            Dim proc2 As EnvDTE80.Process2 = dbg2.GetProcesses(trans, System.Environment.MachineName).Item(ProcessName)
            Call proc2.Attach2(dbgeng)
        Catch ex As System.Runtime.InteropServices.COMException
            Select Case ex.ErrorCode
                Case -2147352565
                    ShowMessage(ProcessName & " is not currently a running process")
                Case -1989083106
                    ShowMessage("You are already attached to " & ProcessName)
                Case Else
                    ShowMessage("Unhandled error message from Attach to process macro")
            End Select
        Catch ex As System.Exception
            MsgBox("Unhandled exception occurred: " & ex.Message)
        End Try

    End Sub
    Private Sub ShowMessage(ByVal message As String)
        Call MsgBox(message, MsgBoxStyle.Exclamation, "Attach to process macro")
    End Sub


End Class

Friday, 16 May 2014

Using Git with Codeplex

http://codeplex.codeplex.com/wikipage?title=Using%20Git%20with%20CodePlex&referringTitle=Source%20control%20clients

 

Using Git with CodePlex

Git is a distributed version control system that is popular for open source projects. To learn more about how to use Git, the Pro Git site is a great reference. The following is a step-by-step guide to get started using Git for your CodePlex projects.

Step 1: Create your CodePlex project

Log-in to CodePlex and create a project. When selecting the source control, pick Git.

image

Once your project is created, click on the Source Control tab. Click the “Clone” action link to bring up connection details:

image

The clone URL is already selected and you can just type ctrl-C to copy the URL. We’ll be using this later.

Step 2: Set up Git

Download and install the latest Git tools for your operating system:

For the remainder of the guide, we’ll assume that you’re on a Windows system for screenshots.

After you’ve installed Git, you’ll want to provide Git with a username. Git uses this information to keep track of commit history, and CodePlex uses this to match commit history with CodePlex users. To do so, open the Git command line (Git Bash if you chose the default installation options for Git on Windows) and type the following command:

git config --global user.name "CodePlexUsername"

image

Step 3: Clone the repository

Next, you’ll want to set up your repository on your local machine by cloning the repository on CodePlex. In the Git command line, change the directory to a folder where you want to store the source code of your project and then type the following git command:

git clone https://CloneUrl NameOfFolder

where CloneUrl is the Clone URL you noted in Step 1, and NameOfFolder is the name of the folder where you want the source code to be stored. For example:

git clone https://git01.codeplex.com/plastikdreamgit PlastikDreamGit

image

Since you haven’t yet published your project, you’ll have to enter your CodePlex username and password. Because your repository is empty, you’ll get a warning message, but that’s fine.

Step 4: Push to CodePlex

Go to your newly created directory, and add your source code. Stage your changes using git add. For example, let’s say you add a readme file to your directory:

cd PlastikDreamGit

notepad readme.txt

git add readme.txt

image

Commit your changes with a commit message:

git commit -m "my first commit to CodePlex”

image

Push your changes back up to CodePlex.

git push origin master

Type in your CodePlex username and password when prompted.

image

Visit your source code history on the project page and verify that your changes have been pushed by browsing to the source code tab.

image

Friday, 14 February 2014

Wednesday, 29 January 2014

How to turn off upper case menus in VS2012

http://blogs.msdn.com/b/zainnab/archive/2012/06/14/turn-off-the-uppercase-menu-in-visual-studio-2012.aspx

Manual Registry Change

Open the registry editor and go to HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0\General\
(For Windows 8 Desktop Express go to HKCU\Software\Microsoft\WDExpress\11.0\General) //special thanks to msm8bball for the update
(For Web Express go to HKEY_CURRENT_USER\Software\Microsoft\VSWDExpress\11.0\General)

  1. Create a new DWORD value called SuppressUppercaseConversion set to 1
     
  2. Restart Visual Studio and you should see the change

NOTE: Watch your spelling if you are typing this manually.

P.S. This reg hack also works for VS 2013, just change the 11.0 to 12.0 in the registry path

HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\12.0\General

 

clip_image002

How to find the last interactive logons in Windows using PowerShell

Use the following powershell script to find the last users to login to a box since a given date, in this case the 21st April 2022 at 12pm un...