Wednesday, 18 May 2016

The specified solution configuration “Debug|X64” is invalid

I have a build script that finds all the solutions in a version control repository and builds them.  I do not specify the platform as many of the solutions and projects have different platform settings.

Today in one of the branches my script started giving me the following error:
The specified solution configuration “Debug|X64” is invalid
Adding the following to the start of my build script solved this issue:
SET PLATFORM=

Tuesday, 17 May 2016

TFS: Undo checkout of unmodified files

Here is another one of those shortcuts I have not been aware of. :D

I hate TFS version control.  There are many reasons, but one irritating thing is that it is incapable of detecting if a file has actually changed or not.

Here is a little commandline script you can run in your project to undo all unchanged files:
tfpt uu . /noget /recursive
Note: You need to install Team Foundation Server Power Tools.

Thursday, 31 March 2016

Prefix.io

I've been using Prefix.io on my development machine at work for about 3 weeks now.  It has been pretty amazing the insights it gave me to what the code base I am working on is doing.

After an early hiccup, which was quickly resolved by the awesome Matt Watson, the installation is a breeze, and it just works, with no perceived impact on CPU or memory usage.

I have not had the opportunity to use Stackify APM yet, but if it is half as good as Prefix then everyone should be using it.

Great job Matt and thank you for a fantastic tool!

Monday, 11 January 2016

How to setup Node.js and npm behind a corporate web proxy


Proxy with no authentication:

npm config set proxy http://proxy.com:8080
npm config set https-proxy http://proxy.com:8080

Proxy with authentication:

npm config set proxy http://username:password@proxy.com:8080
npm config set https-proxy http://username:password@proxy.com:8080

These examples use proxy.com as the proxy server url and 8080 for the port number.

Monday, 4 January 2016

How to install Android Studio in Ubuntu

sudo apt-add-repository ppa:paolorotolo/android-studio
sudo apt-get update
sudo apt-get install android-studio
Reference

Thursday, 24 December 2015

Using multiple commands and conditional processing symbols

Holy cow, I've been using windows since, well forever and I did not know you could do this:

Using multiple commands and conditional processing symbols

You can run multiple commands from a single command line or script using conditional processing symbols. When you run multiple commands with conditional processing symbols, the commands to the right of the conditional processing symbol act based upon the results of the command to the left of the conditional processing symbol. For example, you might want to run a command only if the previous command fails. Or, you might want to run a command only if the previous command is successful.
You can use the special characters listed in the following table to pass multiple commands.
CharacterSyntaxDefinition
& [...]
command1 & command2
Use to separate multiple commands on one command line. Cmd.exe runs the first command, and then the second command.
&& [...]
command1 && command2
Use to run the command following && only if the command preceding the symbol is successful. Cmd.exe runs the first command, and then runs the second command only if the first command completed successfully.
|| [...]
command1 || command2
Use to run the command following || only if the command preceding || fails. Cmd.exe runs the first command, and then runs the second command only if the first command did not complete successfully (receives an error code greater than zero).
( ) [...]
(command1 & command2) 
Use to group or nest multiple commands.
; or ,
command1 parameter1;parameter2
Use to separate command parameters.

 

Tuesday, 18 August 2015

Creating a Team Project in TFS in Visual Studio 2015

To get to the New Team Project menu in Visual Studio 2015 you need to go to Team Explorer and click on the dropdown bar at the top.  Select 'Projects and My Teams' and you will see the 'New Team Project' menu item.


Note: You do need to have the 'Create new projects' permission on the TFS Application tier to do this.

Monday, 17 August 2015

The OutputPath property is not set for project '.csproj'. Please check to make sure that you have specified a valid combination of Configuration and Platform for this project. Configuration='Release' Platform='Any CPU'

I am busy upgrading a large project originally built with Visual Studio 2008 and TSF2008.  We are upgrading to Visual Studio 2015 and TFS2013.  During this process I was getting the following error on TFS:
The OutputPath property is not set for project '<project>.csproj'.  Please check to make sure that you have specified a valid combination of Configuration and Platform for this project.  Configuration='Release'  Platform='Any CPU'
Notice the space between 'Any' and 'CPU' in the platform property.  In 2008 it seems like there was no space.  To fix this you have two options, change your project files to use 'Any CPU' or change your TFS build scripts to pass in 'AnyCPU'.

Thursday, 6 August 2015

Bug in SQL Server?

Found a little bug in SQL Server 2008. Maybe just a Management Studio bug, but still...

Restored a database from a server in another domain to my local instance of SQL Server.
Start running integration tests against the local copy and getting the following error:
Could not obtain information about Windows NT group/user  'domain2\Administrator' error code 0x5.
Some tests are passing, some not.  So I debug one that does not.  Turns out it is inserting records into a table with a trigger that inserts a record into an Audit table.

Nothing peculiar about that, have seen this pattern used in the wild, but never seen this error before.  I start looking at my local copy of the DB and first check the owner.  That is set to my login in the local domain 'domain3\MyUsername'.  Leave it alone for a while, have a look at the logins for the Database, No 'domain2\Administrator' to be found.  Try adding 'domain2\Administrator' as a user and get an error, user already exists.  WTF! I can't see this user anywhere.  Some serious head scratching going on...

Finally I decide to change the owner to 'sa', run the tests and they all work.  Then go and check the database in the 'domain2' domain and there it is the database owner is 'domain2\Administrator'.

So if anyone else runs into this issue, check your database owner first.

Don't ask about the domains, there are many (they are there to replicate our clients environment). And I did not have user access to domain2, but I did have access to the database server.

Wednesday, 5 August 2015

Anonymous types are internal

When testing against anonymous types you need to know that they are internal to the assembly they are declared in.

Add an InternalsVisibleTo assembly attribute to the declaring assembly to resolve this or you will get RuntimeBinderException exceptions like the following:
Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: 'object' does not contain a definition for 'Success'
For more detailed explanations and samples have a look at: