Skip to content

Commit 45a7208

Browse files
tries to fix unit tests in appveyor
fixes some grammar mistakes in the readme cleanups code
1 parent bbd1117 commit 45a7208

File tree

10 files changed

+38
-42
lines changed

10 files changed

+38
-42
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
[![](https://img.shields.io/github/downloads/codingadventures/LINQBridgeVs/total.svg)](https://github.com/codingadventures/LINQBridgeVs/releases)
88

99
LINQBridgeVs is a Visual Studio Extension compatible with Visual Studio 2012/2013/2015/2017.
10-
It is a bridge between a Visual Studio debugging session and [LINQPad](http://www.linqpad.net). It creates at compile time, a Custom Debugger Visualizer making the magnifier glass available for all of the public classes and structs. By clicking on the magnifier glass on an object instance, this will be transmitted over a
10+
It is a bridge between a Visual Studio debugging session and [LINQPad](http://www.linqpad.net). It creates, at compile time, a Custom Debugger Visualizer making the magnifier glass available for all of the public classes and structs. By clicking on the magnifier glass on an object instance, this will be transmitted over a
1111
bus and 'Dumped' out by LINQPad.
1212
<br><br>
1313
## Getting Started
@@ -49,7 +49,7 @@ Only for the first time, Visual Studio must be run with Administrator privileges
4949

5050
Once Visual Studio is restarted as Administrator, the configuration will complete and the form will never appear again.
5151

52-
During this process two custom MsBuild Targets, [Custom.After.Microsoft.Common.targets](https://github.com/codingadventures/LINQBridgeVs/blob/master/Src/VsExtension/Targets/Custom.After.Microsoft.Common.targets) and [Custom.Before.Microsoft.Common.targets](https://github.com/codingadventures/LINQBridgeVs/blob/master/Src/VsExtension/Targets/Custom.Before.Microsoft.Common.targets), are needed to extend the MsBuild process. They are copied into specific Visual Studio version and edition's folder:
52+
During this process two custom MsBuild Targets, [Custom.After.Microsoft.Common.targets](https://github.com/codingadventures/LINQBridgeVs/blob/master/Src/VsExtension/Targets/Custom.After.Microsoft.Common.targets) and [Custom.Before.Microsoft.Common.targets](https://github.com/codingadventures/LINQBridgeVs/blob/master/Src/VsExtension/Targets/Custom.Before.Microsoft.Common.targets), are needed to extend the MsBuild process. They are copied into a specific Visual Studio version and edition's folder:
5353
* Visual Studio 2017 - C:\Program Files (x86)\Microsoft Visual Studio\2017\{Edition}\MSBuild\v15.0
5454
* Visual Studio 2015 - C:\Program Files (x86)\MSBuild\v14.0
5555
* Visual Studio 2013 - C:\Program Files (x86)\MSBuild\v12.0
@@ -82,7 +82,7 @@ When a solution is *Bridged*, every project in is essentially flagged. Configura
8282

8383
* **Mapper Task** - This task creates a Custom Debugger Visualizer assembly for each project.
8484
* **SInjection Task** - SInjection stands for "Serializable Injection". This task reads the built assembly and marks every public class and struct as Serializable. It also ensures that any type is serializable using the [BinaryFormatter](https://msdn.microsoft.com/en-us/library/system.runtime.serialization.formatters.binary.binaryformatter(v=vs.110).aspx).
85-
* **Clean Task** - This task deletes the custom visualizers assemblies generated by the Mapper task.
85+
* **Clean Task** - This task deletes the Custom Debugger Visualizer assemblies generated by the Mapper task.
8686

8787
## Architecture of a Debugger Visualizer
8888

Src/Build/Properties/AssemblyInfo.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-

2-
#region License
3-
// Copyright (c) 2013 Coding Adventures
1+
#region License
2+
// Copyright (c) 2013 - 2018 Coding Adventures
43
//
54
// Permission is hereby granted, free of charge, to any person
65
// obtaining a copy of this software and associated documentation
@@ -37,7 +36,7 @@
3736
[assembly: AssemblyConfiguration("")]
3837
[assembly: AssemblyCompany("Coding Adventures")]
3938
[assembly: AssemblyProduct("BridgeVs.Build")]
40-
[assembly: AssemblyCopyright("Copyright © Coding Adventures 2013")]
39+
[assembly: AssemblyCopyright("Copyright © Coding Adventures 2013 - 2018")]
4140
[assembly: AssemblyTrademark("")]
4241
[assembly: AssemblyCulture("")]
4342

Src/Build/Tasks/SInjectionBuildTask.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public bool Execute()
4545

4646
try
4747
{
48-
var snkCertificate = File.Exists(Snk) ? Snk : null;
48+
string snkCertificate = File.Exists(Snk) ? Snk : null;
4949
var sInjection = new SInjection(Assembly, mode: PatchMode.Debug, snkCertificatePath: snkCertificate);
5050
sInjection.Patch(SerializationTypes.BinarySerialization);
5151
}

Src/Build/TypeMapper/VisualizerAttributeInjector.cs

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,13 @@ private void InitializeDebuggerAssembly()
9494
{
9595
_debuggerVisualizerAssembly.MainModule.TryGetTypeReference(SystemType, out TypeReference systemTypeReference);
9696

97-
var debuggerVisualizerAttributeTypeReference = _debuggerVisualizerAssembly.MainModule.GetType(SystemDiagnosticsDebuggerVisualizerAttribute, true);
97+
TypeReference debuggerVisualizerAttributeTypeReference = _debuggerVisualizerAssembly.MainModule.GetType(SystemDiagnosticsDebuggerVisualizerAttribute, true);
9898

99-
var customDebuggerVisualizerTypeReference = _debuggerVisualizerAssembly
99+
TypeDefinition customDebuggerVisualizerTypeReference = _debuggerVisualizerAssembly
100100
.MainModule
101101
.Types
102102
.SingleOrDefault(definition => BaseTypeFilter(definition, "DialogDebuggerVisualizer"));
103-
var customDebuggerVisualizerObjectSourceTypeReference = _debuggerVisualizerAssembly
103+
TypeDefinition customDebuggerVisualizerObjectSourceTypeReference = _debuggerVisualizerAssembly
104104
.MainModule
105105
.Types
106106
.SingleOrDefault(definition => BaseTypeFilter(definition, "VisualizerObjectSource"));
@@ -115,7 +115,7 @@ private void InitializeDebuggerAssembly()
115115
_visualizerObjectSourceCustomAttributeArgument = new CustomAttributeArgument(systemTypeReference, customDebuggerVisualizerObjectSourceTypeReference);
116116

117117

118-
var assemblyDescriptionAttribute = _debuggerVisualizerAssembly.CustomAttributes.FirstOrDefault(p => p.AttributeType.FullName.Equals(SystemReflectionAssemblyDescriptionAttribute));
118+
CustomAttribute assemblyDescriptionAttribute = _debuggerVisualizerAssembly.CustomAttributes.FirstOrDefault(p => p.AttributeType.FullName.Equals(SystemReflectionAssemblyDescriptionAttribute));
119119

120120
if (assemblyDescriptionAttribute != null)
121121
_assemblyDescriptionAttributeValue = assemblyDescriptionAttribute.ConstructorArguments[0].Value.ToString();
@@ -126,7 +126,7 @@ private void InitializeDebuggerAssembly()
126126

127127
private void MapType(TypeReference typeReference)
128128
{
129-
var scope = string.Empty;
129+
string scope = string.Empty;
130130

131131
switch (typeReference.Scope.MetadataScopeType)
132132
{
@@ -136,20 +136,20 @@ private void MapType(TypeReference typeReference)
136136
case MetadataScopeType.ModuleReference:
137137
break;
138138
case MetadataScopeType.ModuleDefinition:
139-
var moduleDefinition = typeReference.Scope as ModuleDefinition;
139+
ModuleDefinition moduleDefinition = typeReference.Scope as ModuleDefinition;
140140
if (moduleDefinition != null) scope = FromCILToTypeName(typeReference.FullName) + ", " + moduleDefinition.Assembly;
141141
break;
142142
default:
143143
throw new Exception($"Assembly Scope Null. Check assembly {typeReference.FullName}");
144144
}
145145

146-
var customAttribute = new CustomAttribute(_debuggerVisualizerAssembly.MainModule.Import(_debuggerVisualizerAttributeCtor));
146+
CustomAttribute customAttribute = new CustomAttribute(_debuggerVisualizerAssembly.MainModule.Import(_debuggerVisualizerAttributeCtor));
147147

148-
var targetType = new CustomAttributeArgument(_debuggerVisualizerAssembly.MainModule.TypeSystem.String, scope);
149-
var descriptionType = new CustomAttributeArgument(_debuggerVisualizerAssembly.MainModule.TypeSystem.String, _assemblyDescriptionAttributeValue);
148+
CustomAttributeArgument targetType = new CustomAttributeArgument(_debuggerVisualizerAssembly.MainModule.TypeSystem.String, scope);
149+
CustomAttributeArgument descriptionType = new CustomAttributeArgument(_debuggerVisualizerAssembly.MainModule.TypeSystem.String, _assemblyDescriptionAttributeValue);
150150

151-
var targetTypeProperty = new CustomAttributeNamedArgument("TargetTypeName", targetType);
152-
var descriptionTypeProperty = new CustomAttributeNamedArgument("Description", descriptionType);
151+
CustomAttributeNamedArgument targetTypeProperty = new CustomAttributeNamedArgument("TargetTypeName", targetType);
152+
CustomAttributeNamedArgument descriptionTypeProperty = new CustomAttributeNamedArgument("Description", descriptionType);
153153

154154
customAttribute.ConstructorArguments.Add(_customDebuggerVisualizerAttributeArgument);
155155
customAttribute.ConstructorArguments.Add(_visualizerObjectSourceCustomAttributeArgument);
@@ -166,7 +166,7 @@ private void MapType(TypeReference typeReference)
166166
/// <param name="type">The type.</param>
167167
public void MapType(Type type)
168168
{
169-
var typeReference = _debuggerVisualizerAssembly.MainModule.Import(type);
169+
TypeReference typeReference = _debuggerVisualizerAssembly.MainModule.Import(type);
170170

171171
MapType(typeReference);
172172
}
@@ -180,7 +180,7 @@ public void MapTypesFromAssembly(string assemblyToMapTypesFromLocation)
180180
if (!File.Exists(assemblyToMapTypesFromLocation))
181181
throw new FileNotFoundException($"Assembly doesn't exist at location {assemblyToMapTypesFromLocation}");
182182

183-
var assemblyDefinition = AssemblyDefinition.ReadAssembly(assemblyToMapTypesFromLocation, GetReaderParameters(assemblyToMapTypesFromLocation));
183+
AssemblyDefinition assemblyDefinition = AssemblyDefinition.ReadAssembly(assemblyToMapTypesFromLocation, GetReaderParameters(assemblyToMapTypesFromLocation));
184184

185185
assemblyDefinition
186186
.MainModule
@@ -196,10 +196,10 @@ public void MapTypesFromAssembly(string assemblyToMapTypesFromLocation)
196196
/// <param name="references">The Assembly references</param>
197197
public void SaveDebuggerVisualizer(string debuggerVisualizerDst, IEnumerable<string> references = null)
198198
{
199-
var success = false;
199+
bool success = false;
200200
const int maxCount = 3;
201-
var i = 0;
202-
var fileName = Path.GetFileNameWithoutExtension(debuggerVisualizerDst);
201+
int i = 0;
202+
string fileName = Path.GetFileNameWithoutExtension(debuggerVisualizerDst);
203203

204204
//I would have used a goto....can't forget my professor's quote: "Each GOTO can be superseeded by a Repeat Until...God bless Pascal!"
205205
while (!success && i++ < maxCount)
@@ -228,15 +228,15 @@ private static void DeployReferences(IEnumerable<string> references, string loca
228228

229229
private static ReaderParameters GetReaderParameters(string assemblyPath)
230230
{
231-
var assemblyResolver = new DefaultAssemblyResolver();
232-
var assemblyLocation = Path.GetDirectoryName(assemblyPath);
231+
DefaultAssemblyResolver assemblyResolver = new DefaultAssemblyResolver();
232+
string assemblyLocation = Path.GetDirectoryName(assemblyPath);
233233
assemblyResolver.AddSearchDirectory(assemblyLocation);
234234

235-
var readerParameters = new ReaderParameters { AssemblyResolver = assemblyResolver };
235+
ReaderParameters readerParameters = new ReaderParameters { AssemblyResolver = assemblyResolver };
236236

237-
var pdbName = Path.ChangeExtension(assemblyPath, "pdb");
237+
string pdbName = Path.ChangeExtension(assemblyPath, "pdb");
238238
if (!File.Exists(pdbName)) return readerParameters;
239-
var symbolReaderProvider = new PdbReaderProvider();
239+
PdbReaderProvider symbolReaderProvider = new PdbReaderProvider();
240240
readerParameters.SymbolReaderProvider = symbolReaderProvider;
241241
readerParameters.ReadSymbols = true;
242242

Src/Build/Util/EnumerableExtension.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ public static class EnumerableExtension
3434
[DebuggerStepThrough]
3535
public static void ForEach<T>(this IEnumerable<T> @t, Action<T> action) where T : class
3636
{
37-
foreach (var element in @t)
37+
foreach (T element in @t)
3838
{
39-
var el = element; //Avoiding enclosures
39+
T el = element; //Avoiding enclosures
4040
action(el);
4141
}
4242
}

Src/Build/Util/VisualizerAssemblyNameFormat.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ internal static string GetTargetVisualizerAssemblyName(string vsVersion, string
4747
throw new ArgumentException(@"The passed visual studio version is not correct", nameof(vsVersion));
4848
}
4949

50-
var versionNumber = vsVersion.Split('.')[0];
50+
string versionNumber = vsVersion.Split('.')[0];
5151
return $"{Path.GetFileNameWithoutExtension(assembly)}.Visualizer.V{versionNumber}.dll";
5252
}
5353

Test/LINQBridgeVs.Test/AnotherModel.Test/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
[assembly: AssemblyTitle("Assembly.AnotherModel.Test")]
88
[assembly: AssemblyDescription("")]
99
[assembly: AssemblyConfiguration("")]
10-
[assembly: AssemblyCompany("Microsoft")]
10+
[assembly: AssemblyCompany("Coding Adventures")]
1111
[assembly: AssemblyProduct("Assembly.AnotherModel.Test")]
12-
[assembly: AssemblyCopyright("Copyright © Microsoft 2013")]
12+
[assembly: AssemblyCopyright("Copyright © Coding Adventures 2013 - 2018")]
1313
[assembly: AssemblyTrademark("")]
1414
[assembly: AssemblyCulture("")]
1515

Test/LINQBridgeVs.Test/BuildTasks.Test/BridgeVs.Build.UnitTest.csproj

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,9 @@
3434
</PropertyGroup>
3535
<ItemGroup>
3636
<Reference Include="Microsoft.Build.Framework" />
37-
<Reference Include="Microsoft.VisualStudio.DebuggerVisualizers, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
38-
<HintPath>..\..\..\Src\packages\VSSDK.DebuggerVisualizers.11.0.4\lib\net20\Microsoft.VisualStudio.DebuggerVisualizers.dll</HintPath>
39-
<Private>True</Private>
40-
<Private>False</Private>
37+
<Reference Include="Microsoft.VisualStudio.DebuggerVisualizers, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
38+
<SpecificVersion>False</SpecificVersion>
39+
<HintPath>..\..\..\Lib\VS2017\Microsoft.VisualStudio.DebuggerVisualizers.dll</HintPath>
4140
</Reference>
4241
<Reference Include="Mono.Cecil, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
4342
<HintPath>..\..\..\Src\packages\Mono.Cecil.0.9.6.4\lib\net40\Mono.Cecil.dll</HintPath>
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
33
<package id="Mono.Cecil" version="0.9.6.4" targetFramework="net40" />
4-
<package id="VSSDK.DebuggerVisualizers" version="11.0.4" targetFramework="net40" />
54
<package id="VSSDK.DebuggerVisualizers.11" version="11.0.4" targetFramework="net40" />
6-
<package id="VSSDK.IDE.11" version="11.0.4" targetFramework="net40" />
75
</packages>

Test/LINQBridgeVs.Test/Model.Test/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
[assembly: AssemblyTitle("Bridge.Test.AssemblyModel")]
88
[assembly: AssemblyDescription("")]
99
[assembly: AssemblyConfiguration("")]
10-
[assembly: AssemblyCompany("")]
10+
[assembly: AssemblyCompany("Coding Adventures")]
1111
[assembly: AssemblyProduct("Bridge.Test.AssemblyModel")]
12-
[assembly: AssemblyCopyright("Copyright © 2013")]
12+
[assembly: AssemblyCopyright("Copyright © Coding Adventures 2013 - 2018")]
1313
[assembly: AssemblyTrademark("")]
1414
[assembly: AssemblyCulture("")]
1515

0 commit comments

Comments
 (0)