GithubHelp home page GithubHelp logo

codingadventures / linqbridgevs Goto Github PK

View Code? Open in Web Editor NEW
127.0 13.0 21.0 16.43 MB

Dumps the content of variables during debugging in Visual Studio to LINQPad

License: MIT License

C# 98.80% Smalltalk 1.20%
linqpad magnifier-glass visual-studio vsix-extensions debugger-visualizer debugger c-sharp aspect-oriented-programming

linqbridgevs's Introduction

LINQBridgeVs

Join the chat at https://gitter.im/nbasakuragi/LINQBridgeVs Build status GitHubIssues License: MIT Tweet

LINQBridgeVs is a Visual Studio Extension compatible with Visual Studio from 2012 through 2019. It is a bridge between a Visual Studio debugging session and LINQPad. It creates, at compile time, a Custom Debugger Visualizer making the magnifying glass available for all of the public classes and structs. By clicking on the magnifying glass on an object instance, this will be transmitted over a bus and 'Dumped' out by LINQPad.

Release Notes

  • 2.0

    • Adds support for Visual Studio 2019
    • Drops support for Visual Studio 2012 to 2015
    • Adds async loading to speed up Visual Studio loading times
  • 1.4.7

    • Visualizer generation for third party assemblies #25. When enabled (it's off by default) LINQBridgeVs will map types in every referenced dlls for every project in a solution.
    • LINQBridgeVs will now display an error message for unsupported solutions. #52. .NET Core, .NET Standard and UWP are not supported because of a Visual Studio limitation.
    • Added XmlSerialization #50. XmlSerialization has been added to the serialization methods used to transmit variables to LINQPad. This is useful to serialize objects that have xml content (XElement, XmlDocument etc).
    • Added support for AnonymousType #46 Are anonymous types supported when used inside a list? and private nested classes.
    • Added Json.NET failover serialization #56 Should LINQBridgeVs fail to transmit the object using the chosen serialization method (Binary, Json or Xml) it will try again using Json.NET. If Json.NET is set as the primary method, it will instead use Binary serialization.
    • Bug fixing #41 #49 #55 #58

Getting Started

Once the extension is installed, a new menu called "BridgeVs" will be available in the Visual Studio Menu Bar. This menu is only visible when a solution is loaded. There are two options available:

  • Bridge Solution
  • Un-Bridge Solution

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. Private and internal classes are not included, hence the magnifying glass will not be available for them.

Run the solution, set a breakpoint and hover the mouse pointer on any object instance then the magnifying glass will appear inside the data tip.

Compatibility

LINQBridgeVs is compatible with any Visual Studio edition from 2012 through 2019. The latest version 2.0 is only compatible with Visual Studio 2017 and 2019. It works only for .NET Framework 4.0 onwards. There is no support for .NET Framework 3.5 downwards, .NET Core or .NET Standard. This issue is due to a Visual Studio limitation hence this extension does not support .NET Core. There is a feature request in the Visual Studio Uservoice.

Visual Studio 2017 Preview

LINQBridgeVs 1.4.7 is compatible with the preview version of Visual Studio 2017, but it needs a workaround in order to work. Please refer to my last comment on this issue #47. This issue doesn't affect the latest version 2.0.

Configuration up to Version 1.4.7

This steps is necessary for versions of LINQBridgeVs up to 1.4.7 and thus is no longer needed for LINQBridgeVS 2.0. Visual Studio needs to be configured in order to run the extension. This is done only once by the extension itself. 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.

During this process one custom MsBuild Target, Custom.After.Microsoft.Common.targets is needed to extend the MsBuild process. It is copied into a specific Visual Studio version and edition's folder:

  • Visual Studio 2017 - C:\Program Files (x86)\Microsoft Visual Studio\2017\Edition\MSBuild\v15.0
  • Visual Studio 2015 - C:\Program Files (x86)\MSBuild\v14.0
  • Visual Studio 2013 - C:\Program Files (x86)\MSBuild\v12.0
  • Visual Studio 2012 - C:\Program Files (x86)\MSBuild\v4.0

You can skip this process but you will not be able to use the extension until you complete the configuration.

Uninstall

This extension can be uninstalled from Visual Studio. Go to "Tools/Extensions and Updates..." select LINQBridgeVs and then click on Uninstall. There is also a manual step involved: delete Custom.After.Microsoft.Common.targets from the corresponding MSBuild folder as explained in Configuration and delete the registry entry \HKEY_CURRENT_USER\Software\LINQBridgeVs. I will create a ps script at some stage to automate it.

LINQPad

LINQPad must be present in the system before installing the extension otherwise it will not be possible to complete the configuration. Either the portable or the installed version are supported.

Custom folders for LINQPad queries and plugins are supported. This extension reads the configuration files located here:

  • %APPDATA%\LINQPad\PluginLocations.txt
  • %APPDATA%\LINQPad\QueryLocations.txt

Please remember that if you set a custom folder through LINQPad for either plugins or queries and then you go back to the default folder you need to manually delete either the two files above or their content.

Error Tracking

This extension uses Sentry error tracking to log exceptions. After the Configuration is finished a message box will appear asking if you want to enable this functionality. Should you click yes, you will help me keep this project bug free.


This feature can be turned on or off at any time through the option menu: Tools->Options->BridgeVs->ErrorTracking. See the BridgeVs Option Menu section for more details.

Data Protection

Sentry is compliant with the GDPR as a data processor, please refer to this article GDPR, Sentry and you.

In no way is personal data (such as email addresses, credit card information, name of the machine, username or IP address) sent to Sentry. A data scrubber is enabled by default to remove any values that look like they contain credit cards (using regular expression). Keys that contain any of the following values: password, secret, passwd, authorization, api_key, apikey, access_token are filtered as well. RavenWrapper is the wrapper class used to send exceptions to Sentry. Please refer to lines 54-61 to see how some data is filtered out before the request is sent.

Data sent through the extension will live for a maximum of 90 days, after which it will be deleted. If you're concerned that personal data has been accidentally sent, please drop an email to linqbridgevs [at] gmail [dot] com and I will delete the data as soon as possible.

BridgeVs Option Menu

The BridgeVs Option menu offers four options:

The error tracking feature, as explained in the Error Tracking section, can be switched on or off at any time. To enable diagnostic logging set Enable Logging to true. Logs will be saved in %TEMP%\BridgeVs\logs.txt. Be careful, logging is synchronous so it will slow down the transmission process.

The LINQPad installation path can also be changed should you prefer to use a portable version after the configuration is completed. Bear in mind that the folder provided must contain the LINQPad.exe, otherwise it won't change the path. The Serialization Type is the method used to transmit debugging variables to LINQPad. Binary serialization is set by default. Json.NET is also available.

Troubleshooting

If after bridging and rebuilding your solution the magnifying glass still does not appear, make sure that in this folder "C:\Users\youruser\Documents\Visual Studio 201x\Visualizers" there is/are assemblies with this name template "AssemblyName.Visualizer.V1x.dll" (where x is the version number of Visual Studio). If the folder does not contain any assembly then please open a new bug. There are a number of dependent assemblies required by the custom visualizer (BridgeVs.DynamicCore.dll, BridgeVs.Grapple.dll, BridgeVs.Shared.dll, Newtonsoft.Json.dll, System.IO.Abstractions.dll, SharpRaven.dll) which are copied in these two folders during the Configuration:

  • C:\Users\youruser\Documents\Visual Studio 201x\Visualizers
  • C:\Users\youruser\Documents\LINQPad Plugins

Please do not delete these files. If they are accidentally deleted, the extension must be re-installed.

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 automatically be sent to the lower version of LINQPad.

How it works

LINQBridgeVs uses a technique called Aspect Oriented Programming. 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. Specifically, in Visual Studio the Build Engine is called MsBuild and it is to be extended to use AOP. This can be done by either copying a custom Target file to a specific MsBuild folder or by adding Target tags in a project file like the following:

<!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
       Other similar extension points exist, see Microsoft.Common.targets. -->
 <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>

This extension uses custom build Targets in order to avoid the modification of each individual project.

When a solution is Bridged, every project in the solution is essentially flagged. Configuration values are stored in the Windows Registry at this location \HKEY_CURRENT_USER\Software\LINQBridgeVs

For each flagged project there are custom tasks that run before and after a project is built:

  • Mapper Task - This task creates a Custom Debugger Visualizer assembly for each project.
  • 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.
  • Clean Task - This task deletes the Custom Debugger Visualizer assemblies generated by the Mapper task.

Architecture of a Debugger Visualizer

From the MSDN documentation:

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.

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.

The architecture of a debugger visualizer has two parts:

  • The debugger side runs within the Visual Studio debugger.
  • The debugger-side code creates and displays the user interface for your visualizer.

The debuggee side runs within the process Visual Studio is debugging (the debuggee). The debuggee side has to send that data object to the debugger side, which can then display it using a user interface you create. In order to send that data, the object needs to be serialized. Unless you use a serializer, like JSON.NET, that requires no markup on neither the class itself nor on the properties, the class must be marked as Serialized, or with other specific attributes depending on the serializer.

Below is an example of what is needed to map a class to a custom debugger visualizer:

using DebuggerVisualizerExample;
using Microsoft.VisualStudio.DebuggerVisualizers;
using Microsoft.Windows.Form;

[assembly: System.Diagnostics.DebuggerVisualizer(
    typeof(DebuggerSide),
    typeof(VisualizerObjectSource),
    Target = typeof(Class1),
    Description = "My First Visualizer")]
[assembly: System.Diagnostics.DebuggerVisualizer(
    typeof(DebuggerSide),
    typeof(VisualizerObjectSource),
    Target = typeof(Class2),
    Description = "My First Visualizer")]
[assembly: System.Diagnostics.DebuggerVisualizer(
    typeof(DebuggerSide),
    typeof(VisualizerObjectSource),
    Target = typeof(Class3),
    Description = "My First Visualizer")]
namespace DebuggerVisualizerExample
{
    [Serializable]
    public class Class1 { }

    [Serializable]
    public class Class2 { }

    [Serializable]
    public class Class3 { }

    public class DebuggerSide : DialogDebuggerVisualizer
    {
        protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider)
        {
            MessageBox.Show(objectProvider.GetObject()); //obviously MessageBox can't show any object we pass to it
        }
    }
}

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.

Special Thanks to my Sponsors

A very special thanks goes to Sentry, Advanced Installer, NDepend, TypeMock and Jetbrains for sponsoring this project.


Support

Your opinion is important, if you have some spare time please leave a review on the Visual Studio Marketplace.

Acknowledgments

I have also used several community open source projects to make this extension. So if you like LINQBridgeVs I recommend checking out the following:

  • LINQPad super useful scratch pad for C#, VB, F# and SQL. Without it this extension would not exist.
  • SharpRaven C# client for Sentry.
  • Mono.Cecil very famous and useful AOP library designed, written and maintained by JB Evain to generate and inspect programs and libraries in the ECMA CIL format.
  • JSON.NET 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.
  • VsRestart is an extension that restart Visual Studio under Administrator privileges. Unfortunately the project seems abandoned. The extension works only with Visual Studio 2013. However it seems the code works just fine with any Visual Studio version.
  • MahApps which was the first open source project to make WPF truly modern.

linqbridgevs's People

Contributors

codingadventures avatar gitter-badger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

linqbridgevs's Issues

Linqpad starts but does not display anything

I have been using linqbridgevs for sometime now and have grown dependent on it, so if you can help....
I just got a new machine, installed all appropriate software, and everything was working fine including linqbridge.
Under direction I remapped my MyDocuments folder to one-drive enterprise and since then when I attempt to use linqbridge I get nothing. I click on the little magnifying glass, Linqpad starts and then nothing but a blank page.
I have remapped my documents folder back to its original location and reinstalled everything except Visual Studio but still no results. If I have to I will reinstall Visual Studio 2013 but would rather not as I don't need a half day down time.
I have helped many coworkers get this tool installed and working while mine remains broken (I know I must be a saint).
I run as admin and have full control over my visualizer directory. Google tells me that I am the only one in the world with this problem and am quite frustrated.
-TIA

Are anonymous types supported when used inside a list?

In trying to display a list with items made from an anonymous type the code in LinqPAD could not be compiled and complained about a possible missing reference.

Part of the generated code:
truck.UnLoadCargo<List<AnonymousType<Guid, String ......

UnauthorizedAccessException: Access to the path 'C:\ProgramData\Grapple\LINQBridgeVsTruck\SqlException' is denied.

Sentry Issue: LINQBRIDGEVS-B

UnauthorizedAccessException: Access to the path 'C:\ProgramData\Grapple\LINQBridgeVsTruck\SqlException' is denied.
  Module "BridgeVs.Grapple.Truck", line 184, in DeliverTo
    Boolean DeliverTo(System.String)
  Module "BridgeVs.DynamicVisualizers.DynamicObjectSource", line 362, in BroadCastData
    Void BroadCastData(System.Object, System.IO.Stream)

Error broadcasting the data to linqpad

Can't find LINQPad

If you install LINQPad on another path that the default one, LINQBridgeVs cannot find it.

Move LINQPadInstallationPath and LINQPadVersion to specific visual studio version subkey

LINQPadInstallationPath and LINQPadVersion are two registry values that store the installation information of linqpad.

Currently they represent global settings for the extensions which means having the extension installed on multiple visual studio versions on the same machine will share the same setting.

It would be better to move those two values from HKEY_CURRENT_USER\Software\LINQBridgeVs to HKEY_CURRENT_USER\Software\LINQBridgeVs{VsVersion} in order to make the linqpad installation configuration local to the visual studio version

vsregistryopt

Long List bridge

When I try to upload to bridge a Long list (60000 elements) I have such message.
Is it possible configure VS to increase the "time out"
image

Could not load DotNetDynamicVisualizerType or one of its dependencies

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
Microsoft.VisualStudio.DebuggerVisualizers.DebugViewerShim.RemoteObjectSourceException: Could not load file or assembly 'file:///C:\Users\jxb15\Documents\Visual Studio 2013\Visualizers\DotNetDynamicVisualizerType.V12.0.dll' or one of its dependencies. Access is denied. ---> System.IO.FileLoadException: Could not load file or assembly 'file:///C:\Users\jxb15\Documents\Visual Studio 2013\Visualizers\DotNetDynamicVisualizerType.V12.0.dll' or one of its dependencies. Access is denied.
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)
at System.Reflection.Assembly.LoadFrom(String assemblyFile)
at Microsoft.VisualStudio.DebuggerVisualizers.DebugViewerShim.ClassAndAssemblySpec.CreateAssembly(Dictionary2 dictionary, AbstractAssemblyResolver resolver) at Microsoft.VisualStudio.DebuggerVisualizers.DebugViewerShim.ClassAndAssemblySpec.CreateInstanceOrType(Dictionary2 dictionary, AbstractAssemblyResolver resolver, InstanceOrType instOrType)
at Microsoft.VisualStudio.DebuggerVisualizers.DebugViewerShim.ClassAndAssemblySpec.CreateInstance(Dictionary`2 dictionary, AbstractAssemblyResolver resolver)
at Microsoft.VisualStudio.DebuggerVisualizers.DebugViewerShim.DebugeeHost.CreateSourceInternal(String assemblyNameOrLoc, Byte[] assemblyBytes, String className, Boolean isLoc)
--- End of inner exception stack trace ---
at Microsoft.VisualStudio.DebuggerVisualizers.DebugViewerShim.PrivateCallback.MaybeDeserializeAndThrowException(Byte[] data)
at Microsoft.VisualStudio.DebuggerVisualizers.DebugViewerShim.ManagedShim.DelegatedHost.CreateViewer(IntPtr hwnd, HostServicesHelper hsh, SafeProxyWrapper proxy)

************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.18444 built by: FX451RTMGDR

CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll

Microsoft.VisualStudio.Platform.AppDomainManager
Assembly Version: 12.0.0.0
Win32 Version: 12.0.21005.1

CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualStudio.Platform.AppDomainManager/v4.0_12.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.Platform.AppDomainManager.dll

System
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34238 built by: FX452RTMGDR

CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll

System.Xml
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.34234 built by: FX452RTMGDR

CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll

System.Configuration
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.18408 built by: FX451RTMGREL

CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll

System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.18408 built by: FX451RTMGREL

CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll

System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.18408 built by: FX451RTMGREL

CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll

Microsoft.VisualStudio.DebuggerVisualizers
Assembly Version: 12.0.0.0
Win32 Version: 12.0.21005.1

CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Microsoft.VisualStudio.DebuggerVisualizers/12.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.DebuggerVisualizers.dll

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

Linqpad script generation needs full type name

visualizing the mem variable in Using mem As New System.IO.MemoryStream(My.Resources.Bill_of_Lading) I get this linqpad script.

void Main()
{
    Truck truck = new Truck("LINQBridgeVsTruck");
	truck.WaitDelivery("MemoryStream").Wait();
    var @object = truck.UnLoadCargo<IO.MemoryStream>();
    @object.Dump("IO.MemoryStream", 2);
}

It should be

void Main()
{
    Truck truck = new Truck("LINQBridgeVsTruck");
	truck.WaitDelivery("MemoryStream").Wait();
    var @object = truck.UnLoadCargo<System.IO.MemoryStream>();
    @object.Dump("IO.MemoryStream", 2);
}

This doesn't do anything

I'm confused... the extension does nothing because both the Enable and Disable options are disabled. LINQPad is installed to its default path, it is the Pro version, and I'm using VS2013 SP4. I've tried and get the same results on 2 different computers however both are Win7 x64 if that makes a difference. What do I need to do or look at to get this working? Thanks!

Can't find the magnifying glass

i have it installed, i can enable it for my project, and verify thats the case by what is allowed/greyed out in the linqbridge menu, compile, breakpoint, but i can never see this magnifying glass. I'm not sure whether its a conflict with other tools i have like reshaper. I'm on vs.net 2013. Is there a way to do invoke via a menu, right click, or hot key?

Implement a lightweight and fast logger

It would be nice to implement a better logging system like NLog than BridgeVs.Logging, which is the current implementation. This logger is used for debug builds only, but it would be ideal to be able to enable/disable logging with the live extension.

Improve building times

Currently ILMerge is used to combine all the dlls generated at compile time for the custom debugger visualizer. This process is very slow, and should probably be avoided. Remove ILMerge from the build process.

Throws exception when magnifying glass is clicked

LinqBridge throws the following exception on clicking the magnifying glass then fails to launch viewer
this does not occur every time but very often it does

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.Exception: Function evaluation timed out.
at Microsoft.VisualStudio.DebuggerVisualizers.DebugViewerShim.PrivateCallback.MaybeDeserializeAndThrowException(Byte[] data)
at Microsoft.VisualStudio.DebuggerVisualizers.DebugViewerShim.PrivateCallback.WriteDataToStreamAndThrowOnException(Byte[] data, Stream dataStream)
at Microsoft.VisualStudio.DebuggerVisualizers.DebugViewerShim.PrivateCallback.WriteDataToStreamAndThrowOnException(Byte[] data)
at Microsoft.VisualStudio.DebuggerVisualizers.DebugViewerShim.PrivateCallback.Microsoft.VisualStudio.DebuggerVisualizers.IVisualizerObjectProvider.GetData()
at LINQBridgeVs.DynamicVisualizer.V11.DynamicDebuggerVisualizerV11.Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider)
at Microsoft.VisualStudio.DebuggerVisualizers.DebugViewerShim.ManagedShim.DelegatedHost.CreateViewer(IntPtr hwnd, HostServicesHelper hsh, SafeProxyWrapper proxy)

************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.18449 built by: FX451RTMGDR

CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll

Microsoft.VisualStudio.Platform.AppDomainManager
Assembly Version: 11.0.0.0
Win32 Version: 11.0.50727.1

CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualStudio.Platform.AppDomainManager/v4.0_11.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.Platform.AppDomainManager.dll

System
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.18408 built by: FX451RTMGREL

CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll

System.Configuration
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.18408 built by: FX451RTMGREL

CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll

System.Xml
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.18408 built by: FX451RTMGREL

CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll

System.Data.SqlXml
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.18408 built by: FX451RTMGREL

CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Data.SqlXml/v4.0_4.0.0.0__b77a5c561934e089/System.Data.SqlXml.dll

System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.18408 built by: FX451RTMGREL

CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll

System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.18408 built by: FX451RTMGREL

CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll

Microsoft.VisualStudio.DebuggerVisualizers
Assembly Version: 11.0.0.0
Win32 Version: 11.0.50727.1

CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Microsoft.VisualStudio.DebuggerVisualizers/11.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.DebuggerVisualizers.dll

DotNetDynamicVisualizerType.V11.0
Assembly Version: 1.0.5235.17029
Win32 Version: 1.0.0.0

CodeBase: file:///C:/Users/colm.oconnell/Documents/Visual%20Studio%202012/Visualizers/DotNetDynamicVisualizerType.V11.0.dll

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

No magnifier glass

I installed the 2017 version. I enabled the bridge, set a breakpoint after an instance of my class was initialized, run it. I don't see a magnifying glass on the instance. I also created a string array and no magnifying.

It's not clear how the whole process works. What do in the LinqPad? Is there something visible in there? Do we start using the same variable names as in the VS code?
Appreciate a quick YouTube video where you are showing how it works.

Can't enable LinqBridge

LinqPad was installed in the default location (C:\Program Files (x86)\LINQPad4) and after installing LinqBridge the menu options to Enable/Disable remain greyed out.

Can't use with portable LINQPad

I have always used the portable version of LINQPad rather than the installed version. I seems that I am forced to use the installed version for LINQBridgeVs as each time I open VS I'm told to install LINQPad. Any chance you can make it work with portable LINQPad?

linq generated file

correct the full name of the library on the file name
remove mscorlib reference

Add support for .NET Core

Adds support for .NET Core. The new version of Mono.Cecil 0.10 is needed along with some tweaks to BridgeVs.SInject

XElement nodes are not serialized correctly

Hello,
I have an object with a property of type XElement. When I inspect the object I can see all properties in LinqPAD but the only one of type XElement is always Null.

Regards,
Filippo.

VS2013 uninstall problem

I uninstalled this extension, but VS keeps showing linqbridge visualizer...
What is even more annoying, it has removed or replaced all standard visualizers, even string variables are shown in linqpad, there is no option anymore to show them in a plain textbox...

If I reinstall it, when choosing enable LinqBridge or disable LinqBridge , I get following error
image

I'm having the impression that it messed up my vs2013 installation

2017 version

When will the 2017 version show up in the marketplace? I was notified a week ago that it was submitted.
Is there a way we can build it ourselves? I built the solution but there was no vsix file produced.

Another known issue

This is probably obvious but may be worth adding to the known issues list in case it catches anyone else out, as it did me for a minute or two.

The magnifying glass will only be visible for public classes.

SymbolsNotMatchingException - Mono.Cecil crashes when mismatching symbols are found

I keep seeing this in the log file:

2018-07-10T14:50:58.5818167+01:00 Assembly being Injected C:\Development\CMSi\CMSi-Full\ams\AMS-MDI\bin\Debug\CMSI-MDI.exe
2018-07-10T14:50:59.0958376+01:00 Error Executing MSBuild Task SInjectionBuildTask -
SymbolsNotMatchingException: Symbols were found but are not matching the assembly
at Mono.Cecil.ModuleDefinition.ReadSymbols(ISymbolReader reader, Boolean throwIfSymbolsAreNotMaching)
at Mono.Cecil.ModuleReader.ReadSymbols(ModuleDefinition module, ReaderParameters parameters)
at Mono.Cecil.ModuleReader.CreateModule(Image image, ReaderParameters parameters)
at Mono.Cecil.ModuleDefinition.ReadModule(String fileName, ReaderParameters parameters)
at BridgeVs.Build.SInjection..ctor(String assemblyLocation, String snkCertificatePath, PatchMode mode)
at BridgeVs.Build.Tasks.SInjectionBuildTask.Execute()

No visualizers are output

Windows x86 - Error during installation - v1.4.6

The type initializer for 'BridgeVs.Shared.Common.CommonFolderPaths' threw an exception.
at BridgeVs.VsPackage.Helper.Configuration.PackageConfigurator.IsLINQPadInstalled(String vsVersion)
at BridgeVs.VsPackage.Helper.Configuration.PackageConfigurator.Install(String vsVersion, String vsEdition)
at BridgeVs.VsPackage.Package.BridgeVsPackage.Initialize()
Value cannot be null.
Parameter name: path1 at System.IO.Path.Combine(String path1, String path2)
at BridgeVs.Shared.Common.CommonFolderPaths..cctor()

Add serialization type as an option

As of now an object is serialized using a binary formatter or Json.NET. There is no option to choose the serialization type. Add it to visual studio option and implement it into Grapple

IndexOutOfRangeExceptionBridgeVs.Grapple.Grapple.BinaryGrapple in Grab

IndexOutOfRangeException: Index was outside the bounds of the array.
Module "BridgeVs.Grapple.Grapple.BinaryGrapple", line 0, col 0, in Grab
System.Tuple`2[System.Type,System.Byte[]] GrabT
Module "BridgeVs.Grapple.Truck", line 16, col 0, in LoadCargo
Void LoadCargoT
Module "BridgeVs.DynamicVisualizers.DynamicObjectSource", line 355, col 0, in BroadCastData
Void BroadCastData(System.Object, System.IO.Stream)

Unhandled exception... Function evaluation was aborted

I installed and enabled LINQbridge on VS2013 Professional with Windows 10 Professional as SO. I launched VS2013 as administrator, when I click on magnifying glass I receive the error below. LINQPad4 is installed in the proper folder and I gave rights to C:\Users\myuser\Documents\Visual Studio 2013 to user Everyone with full control. My project is a WPF one and I was debugging a dll referenced by WPF project.

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.Exception: Function evaluation was aborted.
at Microsoft.VisualStudio.DebuggerVisualizers.DebugViewerShim.PrivateCallback.MaybeDeserializeAndThrowException(Byte[] data)
at Microsoft.VisualStudio.DebuggerVisualizers.DebugViewerShim.PrivateCallback.WriteDataToStreamAndThrowOnException(Byte[] data, Stream dataStream)
at Microsoft.VisualStudio.DebuggerVisualizers.DebugViewerShim.PrivateCallback.WriteDataToStreamAndThrowOnException(Byte[] data)
at Microsoft.VisualStudio.DebuggerVisualizers.DebugViewerShim.PrivateCallback.Microsoft.VisualStudio.DebuggerVisualizers.IVisualizerObjectProvider.GetData()
at LINQBridgeVs.DynamicVisualizer.V12.DynamicDebuggerVisualizerV12.Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider)
at Microsoft.VisualStudio.DebuggerVisualizers.DebugViewerShim.ManagedShim.DelegatedHost.CreateViewer(IntPtr hwnd, HostServicesHelper hsh, SafeProxyWrapper proxy)

************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.6.1586.0 built by: NETFXREL2
CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll

Microsoft.VisualStudio.Platform.AppDomainManager
Assembly Version: 12.0.0.0
Win32 Version: 12.0.21005.1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualStudio.Platform.AppDomainManager/v4.0_12.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.Platform.AppDomainManager.dll

System
Assembly Version: 4.0.0.0
Win32 Version: 4.6.1586.0 built by: NETFXREL2
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll

System.Configuration
Assembly Version: 4.0.0.0
Win32 Version: 4.6.1586.0 built by: NETFXREL2
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll

System.Core
Assembly Version: 4.0.0.0
Win32 Version: 4.6.1586.0 built by: NETFXREL2
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll

System.Xml
Assembly Version: 4.0.0.0
Win32 Version: 4.6.1586.0 built by: NETFXREL2
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll

System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.6.1586.0 built by: NETFXREL2
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll

System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.6.1586.0 built by: NETFXREL2
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll

Microsoft.VisualStudio.DebuggerVisualizers
Assembly Version: 12.0.0.0
Win32 Version: 12.0.21005.1
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualStudio.DebuggerVisualizers/12.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.DebuggerVisualizers.dll

DotNetDynamicVisualizerType.V12.0
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Users/f.delpozzo.HYLASOFT/Documents/Visual%20Studio%202013/Visualizers/DotNetDynamicVisualizerType.V12.0.dll

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

AssemblyResolutionException: Failed to resolve assembly: 'netstandard'

This is one of many assembly resolution exception errors. A warning message should be showed in case LINQBridgeVs is used with netstandard, asp.net core, .net core and other unsupported projects

Sentry Issue: LINQBRIDGEVS-J

AssemblyResolutionException: Failed to resolve assembly: 'netstandard'
  Module "Mono.Cecil.BaseAssemblyResolver", line 116, in Resolve
    Mono.Cecil.AssemblyDefinition Resolve(Mono.Cecil.AssemblyNameReference, Mono.Cecil.ReaderParameters)
  Module "Mono.Cecil.DefaultAssemblyResolver", line 29, in Resolve
    Mono.Cecil.AssemblyDefinition Resolve(Mono.Cecil.AssemblyNameReference)
  Module "Mono.Cecil.MetadataResolver", line 56, in Resolve
    Mono.Cecil.TypeDefinition Resolve(Mono.Cecil.TypeReference)
  Module "Mono.Cecil.TypeReference", line 0, in Resolve
    Mono.Cecil.TypeDefinition Resolve()
  Module "Mono.Cecil.Mixin", line 0, in CheckedResolve
    Mono.Cecil.TypeDefinition CheckedResolve(Mono.Cecil.TypeReference)
...
(22 additional frame(s) were not displayed)

Error Executing MSBuild Task SInjectionBuildTask

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.