Skip to content

Commit fe1af31

Browse files
author
nbasakuragi
committed
release version 1.3.1, bug fixing, still vs 2013 not fully working
1 parent 7dc063f commit fe1af31

6 files changed

Lines changed: 72 additions & 43 deletions

File tree

Src/LINQBridgeVs/BuildTasks/BuildTasks.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,13 @@
6969
<SpecificVersion>False</SpecificVersion>
7070
<HintPath>..\..\packages\Mono.Cecil.0.9.5.4\lib\net40\Mono.Cecil.Rocks.dll</HintPath>
7171
</Reference>
72-
<Reference Include="SInject, Version=0.1.5197.41327, Culture=neutral, processorArchitecture=MSIL">
72+
<Reference Include="SInject, Version=0.1.5200.1214, Culture=neutral, processorArchitecture=MSIL">
7373
<SpecificVersion>False</SpecificVersion>
74-
<HintPath>..\..\packages\SInject.0.1.8\lib\net40\SInject.dll</HintPath>
74+
<HintPath>..\..\packages\SInject.0.1.9\lib\net40\SInject.dll</HintPath>
7575
</Reference>
7676
<Reference Include="SInject.Logging, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
7777
<SpecificVersion>False</SpecificVersion>
78-
<HintPath>..\..\packages\SInject.0.1.8\lib\net40\SInject.Logging.dll</HintPath>
78+
<HintPath>..\..\packages\SInject.0.1.9\lib\net40\SInject.Logging.dll</HintPath>
7979
</Reference>
8080
<Reference Include="System" />
8181
<Reference Include="System.Core" />
Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,36 @@
1-
namespace LINQBridgeVs.BuildTasks
1+
#region License
2+
// Copyright (c) 2013 Giovanni Campo
3+
//
4+
// Permission is hereby granted, free of charge, to any person
5+
// obtaining a copy of this software and associated documentation
6+
// files (the "Software"), to deal in the Software without
7+
// restriction, including without limitation the rights to use,
8+
// copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
// copies of the Software, and to permit persons to whom the
10+
// Software is furnished to do so, subject to the following
11+
// conditions:
12+
//
13+
// The above copyright notice and this permission notice shall be
14+
// included in all copies or substantial portions of the Software.
15+
//
16+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17+
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
18+
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19+
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20+
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
21+
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22+
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23+
// OTHER DEALINGS IN THE SOFTWARE.
24+
#endregion
25+
26+
27+
namespace LINQBridgeVs.BuildTasks
228
{
329
internal static class VisualizerAssemblyNameFormat
430
{
531
internal static string GetTargetVisualizerAssemblyName(string vsVersion, string assembly)
632
{
733
return System.IO.Path.GetFileNameWithoutExtension(assembly) + ".Visualizer.V" + vsVersion + ".dll";
8-
934
}
1035
}
1136
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
33
<package id="Mono.Cecil" version="0.9.5.4" targetFramework="net40" />
4-
<package id="SInject" version="0.1.8" targetFramework="net40" />
4+
<package id="SInject" version="0.1.9" targetFramework="net40" />
55
</packages>

Src/LINQBridgeVs/LinqBridgeVsExtension/Configuration/PackageConfigurator.cs

Lines changed: 38 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ internal static class PackageConfigurator
1313
{
1414
private static string _vsVersion;
1515
private static readonly string CurrentAssemblyVersion = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location).FileVersion;
16-
private static readonly bool IsFramework45Installed = File.Exists(Locations.DotNet45FrameworkPath);
16+
private static readonly bool IsFramework45Installed = Directory.Exists(Locations.DotNet45FrameworkPath);
1717

1818
private static string LINQBridgeVsExtensionVersion
1919
{
@@ -22,13 +22,13 @@ private static string LINQBridgeVsExtensionVersion
2222
using (var key = Registry.CurrentUser.OpenSubKey(GetRegistryKeyWithVersion(Resources.ProductVersion)))
2323
{
2424
if (key == null) return string.Empty;
25-
25+
2626
var value = key.GetValue("LINQBridgeVsVersion");
2727

2828
if (value != null)
2929
return value.ToString();
3030
}
31-
31+
3232

3333
return string.Empty;
3434
}
@@ -115,6 +115,8 @@ private static void SetEnvironment()
115115
return;
116116
}
117117

118+
SetPermissions();
119+
118120

119121
//Copy the BridgeBuildTask.targets to the default .NET 4.0v framework location
120122
File.Copy(Locations.LinqBridgeTargetFileNamePath, Path.Combine(Locations.DotNet40FrameworkPath, Locations.LinqBridgeTargetFileName), true);
@@ -133,7 +135,6 @@ private static void SetEnvironment()
133135
Path.Combine(Locations.DotNet45FrameworkPath, Locations.LinqBridgeTargetFileName), true);
134136
Log.Write("LinqBridge Targets copied to {0} ", Locations.DotNet45FrameworkPath);
135137
}
136-
SetPermissions();
137138

138139
Log.Write("Setting IsEnvironmentConfigured to True");
139140
IsEnvironmentConfigured = true;
@@ -164,19 +165,11 @@ private static void SetPermissions()
164165
Log.Write("SetPermission Starts");
165166
var processOutputs = new StringBuilder();
166167

167-
var icaclsProcess = new Process
168+
var icaclsProcess45Folder = new Process
168169
{
169-
StartInfo = { UseShellExecute = false, CreateNoWindow = true, WindowStyle = ProcessWindowStyle.Hidden, RedirectStandardError = true, RedirectStandardInput = true, RedirectStandardOutput = true, FileName = "icacls.exe", Arguments = Locations.IcaclsArguments }
170+
StartInfo = { UseShellExecute = false, CreateNoWindow = true, WindowStyle = ProcessWindowStyle.Hidden, RedirectStandardError = true, RedirectStandardInput = true, RedirectStandardOutput = true, FileName = "icacls.exe", Arguments = Locations.IcaclsArguments45, LoadUserProfile = true }
170171
};
171172

172-
var icaclsProcess45 = new Process
173-
{
174-
StartInfo = { UseShellExecute = false, CreateNoWindow = true, WindowStyle = ProcessWindowStyle.Hidden, RedirectStandardError = true, RedirectStandardInput = true, RedirectStandardOutput = true, FileName = "icacls.exe", Arguments = Locations.IcaclsArguments45 }
175-
};
176-
var icaclsProcessX64 = new Process
177-
{
178-
StartInfo = { UseShellExecute = false, CreateNoWindow = true, WindowStyle = ProcessWindowStyle.Hidden, RedirectStandardError = true, FileName = "icacls.exe", Arguments = Locations.IcaclsArgumentsX64, LoadUserProfile = true }
179-
};
180173
var icaclsProcessCommonTarget = new Process
181174
{
182175
StartInfo = { UseShellExecute = false, CreateNoWindow = true, WindowStyle = ProcessWindowStyle.Hidden, RedirectStandardError = true, RedirectStandardInput = true, RedirectStandardOutput = true, FileName = "icacls.exe", Arguments = Locations.IcaclsArgumentsCommonTarget, LoadUserProfile = true }
@@ -186,6 +179,12 @@ private static void SetPermissions()
186179
StartInfo = { UseShellExecute = false, CreateNoWindow = true, WindowStyle = ProcessWindowStyle.Hidden, RedirectStandardError = true, RedirectStandardInput = true, RedirectStandardOutput = true, FileName = "icacls.exe", Arguments = Locations.IcaclsArgumentsX64CommonTarget, LoadUserProfile = true }
187180
};
188181

182+
var icaclsProcess45CommonTarget = new Process
183+
{
184+
StartInfo = { UseShellExecute = false, CreateNoWindow = true, WindowStyle = ProcessWindowStyle.Hidden, RedirectStandardError = true, RedirectStandardInput = true, RedirectStandardOutput = true, FileName = "icacls.exe", Arguments = Locations.IcaclsArguments45CommonTarget, LoadUserProfile = true }
185+
};
186+
187+
#region [ Take Own ]
189188
var takeownProcess = Process.Start("takeown", String.Format("/f {0}", Locations.MicrosoftCommonTargetFileNamePath));
190189
if (takeownProcess != null) takeownProcess.WaitForExit();
191190

@@ -196,47 +195,54 @@ private static void SetPermissions()
196195

197196
if (takeownProcessx64 != null) takeownProcessx64.WaitForExit();
198197
}
199-
icaclsProcess.Start();
198+
if (IsFramework45Installed)
199+
{
200+
var takeownProcess45 = Process.Start("takeown",
201+
String.Format("/f \"{0}\"", Locations.DotNet45FrameworkPath));
202+
203+
if (takeownProcess45 != null) takeownProcess45.WaitForExit();
204+
}
205+
#endregion
206+
200207

201208
if (IsFramework45Installed)
202-
icaclsProcess45.Start();
209+
{
210+
icaclsProcess45Folder.Start();
211+
icaclsProcess45CommonTarget.Start();
212+
}
203213

204214
icaclsProcessCommonTarget.Start();
205215

206216
if (Environment.Is64BitOperatingSystem)
207217
{
208-
icaclsProcessX64.Start();
209218
icaclsProcessX64CommonTarget.Start();
210-
Log.Write("Setting Permission to {0} and {1} ", Locations.IcaclsArguments, Locations.IcaclsArgumentsX64);
211219
Log.Write("Setting Permission to {0} and {1} ", Locations.IcaclsArgumentsCommonTarget, Locations.IcaclsArgumentsX64CommonTarget);
212-
213220
}
214221

215222
if (IsFramework45Installed)
216-
icaclsProcess45.WaitForExit();
223+
{
224+
icaclsProcess45Folder.WaitForExit();
225+
icaclsProcess45CommonTarget.WaitForExit();
226+
}
217227

218-
icaclsProcess.WaitForExit();
219228
icaclsProcessCommonTarget.WaitForExit();
229+
220230
if (Environment.Is64BitOperatingSystem)
221-
{
222-
icaclsProcessX64.WaitForExit();
223231
icaclsProcessX64CommonTarget.WaitForExit();
224-
}
225232

226-
if (icaclsProcess.ExitCode != 0)
227-
processOutputs.AppendLine(icaclsProcess.StandardOutput.ReadToEnd());
228-
if (icaclsProcess.ExitCode != 0)
233+
if (icaclsProcessCommonTarget.ExitCode != 0)
229234
processOutputs.AppendLine(icaclsProcessCommonTarget.StandardOutput.ReadToEnd());
230235

231-
if (IsFramework45Installed && icaclsProcess.ExitCode != 0)
232-
processOutputs.AppendLine(icaclsProcess45.StandardOutput.ReadToEnd());
236+
if (IsFramework45Installed && icaclsProcess45CommonTarget.ExitCode != 0)
237+
processOutputs.AppendLine(icaclsProcess45CommonTarget.StandardOutput.ReadToEnd());
238+
239+
if (IsFramework45Installed && icaclsProcess45Folder.ExitCode != 0)
240+
processOutputs.AppendLine(icaclsProcess45Folder.StandardOutput.ReadToEnd());
233241

234242

235243
if (Environment.Is64BitOperatingSystem)
236244
{
237-
if (icaclsProcess.ExitCode != 0)
238-
processOutputs.AppendLine(icaclsProcessX64.StandardOutput.ReadToEnd());
239-
if (icaclsProcess.ExitCode != 0)
245+
if (icaclsProcessX64CommonTarget.ExitCode != 0)
240246
processOutputs.AppendLine(icaclsProcessX64CommonTarget.StandardOutput.ReadToEnd());
241247
}
242248

Src/LINQBridgeVs/LinqBridgeVsExtension/Locations.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,10 @@ public static string InstallFolder
5757

5858
public static readonly string MicrosoftCommonTarget64FileNamePath = Path.Combine(DotNet40Framework64Path, "Microsoft.Common.targets");
5959

60-
public static readonly string IcaclsArguments = String.Format("{0} /grant Everyone:F", Path.Combine(DotNet40FrameworkPath, LinqBridgeTargetFileName));
61-
public static readonly string IcaclsArguments45 = String.Format("{0} /grant Everyone:F", Path.Combine(DotNet45FrameworkPath, LinqBridgeTargetFileName));
62-
public static readonly string IcaclsArgumentsX64 = String.Format("{0} /grant Everyone:F", Path.Combine(DotNet40Framework64Path, LinqBridgeTargetFileName));
60+
public static readonly string IcaclsArguments45 = String.Format("\"{0}\" /grant Everyone:F", DotNet45FrameworkPath);
6361

6462
public static readonly string IcaclsArgumentsCommonTarget = String.Format("{0} /grant Everyone:F", MicrosoftCommonTargetFileNamePath);
65-
public static readonly string IcaclsArguments45CommonTarget = String.Format("{0} /grant Everyone:F", MicrosoftCommonTarget45FileNamePath);
63+
public static readonly string IcaclsArguments45CommonTarget = String.Format("\"{0}\" /grant Everyone:F", MicrosoftCommonTarget45FileNamePath);
6664
public static readonly string IcaclsArgumentsX64CommonTarget = String.Format("{0} /grant Everyone:F", MicrosoftCommonTarget64FileNamePath);
6765
}
6866
}

Src/LINQBridgeVs/LinqBridgeVsExtension/source.extension.vsixmanifest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<Identifier Id="fa136bfd-0b1d-4721-9159-1dbefcb5c4fc">
44
<Name>LINQBridgeVs Extension</Name>
55
<Author>Giovanni Campo</Author>
6-
<Version>1.3</Version>
6+
<Version>1.3.1</Version>
77
<Description xml:space="preserve">Bridge between a Visual Studio debugging session and LINQPad (http://www.linqpad.net). When enabled on a selection of VB/C# projects, it creates a Custom Debugger Visualizer
88
mapping to all the complex types and making the magnifier glass available for all of them.</Description>
99
<Locale>1033</Locale>

0 commit comments

Comments
 (0)