Friday 21 February 2014

Python Tools for Visual Studio: Must run as administrator to enable debugging

Bad file permissions prevent SSH access to Github

You might be trying to access GitHub from the Windows command line, but get the message "Could not open a connection to your authentication agent.":

$ ssh-add ~/.ssh/id_rsa

Could not open a connection to your authentication agent.



$ eval 'ssh-agent -s'

SSH_AUTH_SOCK=/tmp/ssh-z8CtJ8nsSdBL/agent.6724; export SSH_AUTH_SOCK;

SSH_AGENT_PID=6672; export SSH_AGENT_PID;

echo Agent pid 6672;



$ ssh-add ~/.ssh/id_rsa

Could not open a connection to your authentication agent.



$ eval "$(ssh-agent)"

Agent pid 6500


$ ssh-add ~/.ssh/id_rsa

Identity added: /c/Users/username/.ssh/id_rsa (/c/Users/username/.ssh/id_rsa)



$ ssh -vT git@github.com

Permission denied (publickey).

$ cd .ssh

~/.ssh $ ls

AGAIN      github_rsa      key      known_hosts  new_key.pub

AGAIN.pub  github_rsa.pub  key.ppk  new_key

Here's the real problem: the file permissions on the key files are wrong.


~/.ssh $ chmod 700 id_rsa

~/.ssh $ cd ..

~ $ ssh -vT git@github.com

Enter passphrase for key '/c/Users/Roderick/.ssh/id_rsa':

Hi username! You've successfully authenticated, but GitHub does not provide she

ll access.

debug1: channel 0: free: client-session, nchannels 1

debug1: Transferred: stdin 0, stdout 0, stderr 0 bytes in 0.2 seconds

debug1: Bytes per second: stdin 0.0, stdout 0.0, stderr 0.0

debug1: Exit status 1



Monday 10 February 2014

CruiseControl.NET IIS setup for Windows 8

In web.config, add the following to <handlers>


        <add name="aspx" verb="*" path="*.aspx" type="ThoughtWorks.CruiseControl.WebDashboard.MVC.ASPNET.HttpHandler,ThoughtWorks.CruiseControl.WebDashboard"/>
        <add name="xml" verb="*" path="*.xml" type="ThoughtWorks.CruiseControl.WebDashboard.MVC.ASPNET.HttpHandler,ThoughtWorks.CruiseControl.WebDashboard"/>

Thursday 6 February 2014

Visual Studio Rebuilds

http://stackoverflow.com/questions/2762930/vs2010-always-thinks-project-is-out-of-date-but-nothing-has-changed
To find the missing file(s), use info from the article Enable C++ project system logging to enable debug logging in Visual Studio and let it just tell you what's causing the rebuild:
  1. Open the devenv.exe.config file (found in %ProgramFiles%\Microsoft Visual Studio 10.0\Common7\IDE\ or in %ProgramFiles(x86)%\Microsoft Visual Studio 10.0\Common7\IDE\)
  2. Add the following after the </configSections> line:
    <system.diagnostics>
      <switches>
        <add name="CPS" value="4" />
      </switches>
    </system.diagnostics>
    
  3. Restart Visual Studio
  4. Open up DbgView and make sure it's capturing debug output
  5. Try to debug (hit F5 in Visual Studio)
  6. Search the debug log for any lines of the form:
    devenv.exe Information: 0 : Project 'Bla\Bla\Dummy.vcxproj' not up to date because build input 'Bla\Bla\SomeFile.h' is missing.
    (I just hit Ctrl+F and searched for not up to date) These will be the references causing the project to be perpetually "out of date".

Tuesday 4 February 2014

Visual Studio's broken "Project Reference" system

Visual Studio has a supposed project-dependency system, whereby if you add a project in a solution to a dependent project's "References", it should check for changes to the first project when you build or run the second.

It's broken, because it refers to the project by a GUID. Although the reference info is in the vcxproj project file, the GUID is subject to arbitrary change - for example if you put the projects in multiple solutions. And if you put a project reference in one solution, and the referred project isn't in the other, it breaks the build.

There's no good reason for this - so avoid using project references other than for "quick and dirty" builds.

Sunday 2 February 2014

Git command line in Windows

If you have TortoiseGit working, and need to use the Git command line from the regular Windows command line (i.e. NOT bash), just copy your keys from your personal .ssh directory into the .ssh subdirectory C:\Program Files (x86)\Git\.ssh. You may need to merge the known_hosts files.