Skip to content
This repository has been archived by the owner on Sep 15, 2022. It is now read-only.

Commit

Permalink
On a system that uses a european culture info the version string "12.…
Browse files Browse the repository at this point in the history
…0" is converted to a double with the value 120. To fix this simply cut all parts after the dot and convert it directly to an int
  • Loading branch information
Tobias Fabisch authored and Tobias Fabisch committed Sep 25, 2014
1 parent 35bb6c9 commit c19c70f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/Pendletron.Vsix.LocateInTFS/VSPackage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,13 @@ public int DetermineVisualStudioVersionNumber()
{
var d = GetDteAsDynamic();
string version = d.Version;
double result = 0;
Double.TryParse(version, out result);
return Convert.ToInt32(Math.Floor(result));
if (version.Contains("."))
{
version = version.Remove(version.IndexOf('.'));
}
int result = 0;
Int32.TryParse(version, out result);
return result;
}

public dynamic GetServiceAsDynamic(Type serviceInterfaceType)
Expand Down

0 comments on commit c19c70f

Please sign in to comment.