You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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).
11
-
When enabled on a solution containing C#, VB, ASP.NET or MVC projects, it creates at compile time a Custom Debugger Visualizer assembly
12
-
mapping to all the public complex types and making the magnifier glass available for all of them. 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
13
11
bus and 'Dumped' out by LINQPad.
14
12
<br><br>
15
13
## Getting Started
16
14
17
-
Once the extension is installed a new menu will be available in the Visual Studio Menu Bar, only visible
18
-
when a solution is loaded, called "BridgeVs". There are two options available:
15
+
Once the extension is installed, a new menu called *"BridgeVs"*will be available in the Visual Studio Menu Bar. Such menu is only visible
16
+
when a solution is loaded. There are two options available:
19
17
20
18
**Bridge Solution*
21
19
**Un-Bridge Solution*
22
20
23
21
Bridging a solution will extend the MsBuild process to create a custom debugger visualizer assembly for each project. These assemblies are created or updated when you build your projects.
24
-
Private and internal classes _are not_ included, magnifier glass will not be available for them.
25
-
Run the solution, set a breakpoint and hover the mouse pointer on any object instance and the magnifier glass will appear.
26
-
If the magnifier glass does not appear, after you bridged and rebuilt your solution, make sure that in this folder _"C:\Users\youruser\Documents\Visual Studio 201**x**\Visualizers"_ there is/are assemblies with this name template "***AssemblyName**.Visualizer.V1**x**.dll*" (where x is the version number of Visual Studio).
27
-
If the folder does not contain any assembly then please check the log files here: *C:\Users\youruser\AppData\Local\LINQBridgeVs* and open [a new bug](https://github.com/codingadventures/LINQBridgeVs/issues/new).
22
+
Private and internal classes _are not_ included, hence the magnifier glass will not be available for them.
28
23
29
-
Do not keep two instances of two different version of LINQPad running (e.g. LINQPad 4 and LINQPad 5) at the same time. If you do so, the data will be automatically sent to the lower version of LINQPad.
24
+
Run the solution, set a breakpoint and hover the mouse pointer on any object instance then the magnifier glass will appear inside the data tip.
25
+
26
+
## Compatibility
27
+
28
+
LINQBridgeVs is compatible with any Visual Studio edition from 2012 to 2017. It works only for **.NET Framework 4.0 to 4.6.2**. There is no support for .NET Framework 3.5 downwards. LINQPad 4 and 5 are both supported.
29
+
30
+
## Troubleshooting
31
+
32
+
If after bridging and rebuilding your solution the magnifier glass still does not appear, make sure that in this folder _"C:\Users\youruser\Documents\Visual Studio 201**x**\Visualizers"_ there is/are assemblies with this name template "***AssemblyName**.Visualizer.V1**x**.dll*" (where x is the version number of Visual Studio).
33
+
If the folder does not contain any assembly then please check the log files here *C:\Users\youruser\AppData\Local\LINQBridgeVs* and send them with [a new bug](https://github.com/codingadventures/LINQBridgeVs/issues/new).
34
+
35
+
Do not keep two instances of two different versions of LINQPad running (e.g. LINQPad 4 and LINQPad 5) at the same time. If you do so, the data will be automatically sent to the lower version of LINQPad.
@@ -35,29 +41,26 @@ Do not keep two instances of two different version of LINQPad running (e.g. LINQ
35
41
## Configuration
36
42
37
43
Unfortunately an installer is not available yet, therefore Visual Studio needs to be configured in order to run the extension. This is done only once by the extension itself.
38
-
Only for the first time, Visual Studio must be run with Administrator privileges, if not a form will appear asking to restart Visual Studio:
44
+
Only for the first time, Visual Studio must be run with Administrator privileges. If not, a form will appear asking to restart Visual Studio:
Once Visual Studio is restarted as Administrator, the configuration will complete and the form will never appear again.
45
51
46
-
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 specific Visual Studio version and edition's folder:
47
53
* Visual Studio 2017 - C:\Program Files (x86)\Microsoft Visual Studio\2017\{Edition}\MSBuild\v15.0
48
54
* Visual Studio 2015 - C:\Program Files (x86)\MSBuild\v14.0
49
55
* Visual Studio 2013 - C:\Program Files (x86)\MSBuild\v12.0
50
56
* Visual Studio 2012 - C:\Program Files (x86)\MSBuild\v4.0
51
57
52
58
You can skip this process but you will not be able to use the extension until you complete the configuration.
53
59
54
-
## Compatibility
55
-
56
-
LINQBridgeVs is compatible with any Visual Studio edition from 2012 to 2017. It works only for **.NET Framework 4.0 to 4.6.2**. There is no support for .NET Framework 3.5 downwards. LINQPad 4 and 5 are either supported.
57
-
58
60
## How it works
59
61
60
-
LINQBridgeVs uses a technique called [Aspect Oriented Programming](https://wikipedia.AOP). AOP is a programming paradigm that aims to increase modularity by allowing separations of cross-cutting concerns (read behaviors) without modifying the code itself. In general this is achieved by adding an extra step in the build process, usually after the assembly is created. Specifically in Visual Studio the [MsBuild](https://en.wikipedia.org/wiki/MSBuild), which is the Microsoft Build Engine, is to be extended to use AOP. This can be done by either copying a [custom Target file](https://msdn.microsoft.com/en-us/library/ms164312.aspx) to the MsBuild installation folder or by adding ***Target*** tags in a project file like the following:
62
+
LINQBridgeVs uses a technique called [Aspect Oriented Programming](https://wikipedia.AOP). AOP is a programming paradigm that aims to increase modularity, by allowing separations of cross-cutting concerns (read behaviors) without modifying the code itself. Usually this is achieved by adding an extra step into the build process after the assembly is created.
63
+
Specifically, in Visual Studio the Build Engine is called [MsBuild](https://en.wikipedia.org/wiki/MSBuild) and it is to be extended to use AOP. This can be done by either copying a [custom Target file](https://msdn.microsoft.com/en-us/library/ms164312.aspx) to a specific MsBuild folder or by adding ***Target*** tags in a project file like the following:
61
64
```xml
62
65
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
63
66
Other similar extension points exist, see Microsoft.Common.targets. -->
@@ -69,24 +72,24 @@ LINQBridgeVs uses a technique called [Aspect Oriented Programming](https://wikip
69
72
70
73
This extension uses custom build Targets in order to avoid the modification of each individual project.
71
74
72
-
When a solution is *Bridged*, every projects in it is essentially flagged. Configuration values are stored in the Windows Registry at this location ***\HKEY_CURRENT_USER\Software\LINQBridgeVs***
75
+
When a solution is *Bridged*, every project in is essentially flagged. Configuration values are stored in the Windows Registry at this location ***\HKEY_CURRENT_USER\Software\LINQBridgeVs***
For each flagged project the custom tasks that extend the MsBuild engine mentioned earlier, perform some operation on the corresponding generated assembly. These tasks are:
81
+
For each flagged project there are custom tasks that run before and after a project is built:
79
82
80
83
***Mapper Task** - This task creates a Custom Debugger Visualizer assembly for each project.
81
-
***SInjection Task** - SInjection stands for "Serializable Injection". This task reads the built assembly and mark every public class and struct as Serializable. By doing so it's then possible to use binary serialization through the [BinaryFormatter](https://msdn.microsoft.com/en-us/library/system.runtime.serialization.formatters.binary.binaryformatter(v=vs.110).aspx) which is the standard binary serializer available in the .NET framework. Binary serialization is pretty powerful, and also fast. I prefer it over Json serialization, as it proved to be more suitable for complex object graphs.
82
-
***Clean Task** - This taks deletes the custom visualizers assemblies. It is invoked either by rebuilding or cleaning the solution.
84
+
***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.
83
86
84
87
## Architecture of a Debugger Visualizer
85
88
86
89
From the [MSDN documentation](https://docs.microsoft.com/en-us/visualstudio/debugger/create-custom-visualizers-of-data):
87
90
>Visualizers are components of the Visual Studio debugger user interface. A visualizer creates a dialog box or another interface to display a variable or object in a manner that is appropriate to its data type. For example, an HTML visualizer interprets an HTML string and displays the result as it would appear in a browser window; a bitmap visualizer interprets a bitmap structure and displays the graphic it represents. The Visual Studio debugger includes six standard visualizers.
88
91
>
89
-
The process of creating custom visualizers to extend the debugger is not too complicated. However it requires a lot of setup, either for mapping a class to custom visualizer but also to prepare the class for serialization.
92
+
The process of creating custom visualizers to extend the debugger is not too complicated. However, it requires a lot of setup, either for mapping a class to custom visualizer but also to prepare the class for serialization.
90
93
91
94
The architecture of a debugger visualizer has two parts:
For each class, *Class1, Class2, Class3* it is needed a global assembly attribute that maps the type to a debugger visualizer. This extension does all of this automatically. Internally it uses the .NET BinaryFormatter to send the data from the debuggee to the debugger. In case the BinaryFormatter fails to serialize the data, JSON.NET is used instead.
143
+
For each class (*Class1, Class2, Class3*) a global assembly attribute that maps the type to a debugger visualizer is needed. This extension does all of this automatically. Internally it uses the .NET BinaryFormatter to send the data from the debuggee to the debugger. If the BinaryFormatter fails to serialize the data, JSON.NET is used instead.
141
144
142
145
## Acknowledgments
143
146
144
147
I have used several community open source projects to make this extension. So if you like LINQBridgeVs I recommend checking out the following:
145
148
146
-
-[JSON.NET](https://github.com/JamesNK/Newtonsoft.Json) is an awesome serializer. It has become part of the .NET Framework and it is used by millions worlwide, now it has become the standard. LINQBridgeVs mainly uses the BinaryFormatter but in case it fails it falls back on JSON.NET.
147
-
-[VsRestart](https://github.com/ilmax/vs-restart) is an extension that restart Visual Studio under Administrator privileges. Unfortunately the project seems abandoned and the extension works only with Visual Studio 2013. However but code proved to be working with any version really.
148
-
-[MahApps](https://github.com/MahApps/MahApps.Metro) which was the first open source project to make WPF truly modern.
149
-
-[LINQPad](http://www.linqpad.net) super useful scratch pad for C#, VB, F#, SQL. Without it this extension wouldn't exist.
149
+
-[LINQPad](http://www.linqpad.net) super useful scratch pad for C#, VB, F# and SQL. Without it this extension would not exist.
150
150
-[Mono.Cecil](http://www.mono-project.com/docs/tools+libraries/libraries/Mono.Cecil/) very famous and useful AOP library designed, written and maintaned by JB Evain to generate and inspect programs and libraries in the ECMA CIL format.
151
+
-[JSON.NET](https://github.com/JamesNK/Newtonsoft.Json) is an awesome serializer. It has become part of the .NET Framework and it is used by millions worlwide, now it has become the standard. LINQBridgeVs mainly uses the BinaryFormatter, but should it fail, it uses JSON.NET as a fallback mechanism.
152
+
-[VsRestart](https://github.com/ilmax/vs-restart) is an extension that restart Visual Studio under Administrator privileges. Unfortunately the project seems abandoned. The extension works only with Visual Studio 2013. However, code proved to be working with any Visual Studio version.
153
+
-[MahApps](https://github.com/MahApps/MahApps.Metro) which was the first open source project to make WPF truly modern.
151
154
-[ILMerge](https://github.com/Microsoft/ILMerge) is a utility that merges multiple .NET assemblies into a single assembly.
0 commit comments