Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to load the custom visualizer. #162

Closed
yuipcheng opened this issue Jul 6, 2018 · 6 comments

Comments

@yuipcheng
Copy link

commented Jul 6, 2018

When I click on the magnifying glass icon, I get this error message from Visual Studio.
Error on Visual Studio Enterprise 2017 v15.7.4 on Windows 10 Enterprise v10.0.15063

Unable to load the custom visualizer.
Additional information:
The UI-side visualizer type 
'NRules.Debugger.Visualizer.SessionVisualizer' must derive from 
'Microsoft.VisualStudio.DebuggerVisualizers.DialogDebuggerVisualizer'.

I did not make changes to any source code prior to running build.bat.
After the build is completed, I copied the following files to C:\Users\xxxx\Documents\Visual Studio 2017\Visualizers
Built with Visual Studio Enterprise v15.7.4 on Windows 10 Enterprise v10.0.16299.492


1. Microsoft.VisualStudio.DebuggerVisualizers.dll
2. NRules.Debugger.Visualizer.dll
3. NRules.Debugger.Visualizer.pdb
4. NRules.dll
5. NRules.Fluent.dll
6. NRules.Fluent.pdb
7. NRules.Fluent.xml
8. NRules.pdb
9. NRules.RuleModel.dll
10. NRules.RuleModel.pdb
11. NRules.RuleModel.xml
12. NRules.xml

@snikolayev

This comment has been minimized.

Copy link
Collaborator

commented Jul 12, 2018

The nuget package that the visualizer is referencing for Microsoft.VisualStudio.DebuggerVisualizers.dll is for VS 2013. Unfortunately there is no nuget package for VS2015 or VS2017. You can slightly modify the references to make it work for 2017.
First, make sure to clone the sources for the same version of NRules you are using. You can clone by tag under "releases".
Then, modify csproj files for the Visualizer and Visualizer Tests, to reference the visualizer DLL from under the Visual Studio install location.

NRules.Debugger.Visualizer.csproj:

<Project Sdk="Microsoft.NET.Sdk">

  <Import Project="..\..\..\Common.props" />

  <PropertyGroup>
    <TargetFramework>net45</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <Compile Include="..\..\..\GlobalAssemblyInfo.cs" Link="Properties\GlobalAssemblyInfo.cs" />
    <Compile Include="..\CommonAssemblyInfo.cs" Link="Properties\CommonAssemblyInfo.cs" />
  </ItemGroup>

  <ItemGroup>
    <Reference Include="Microsoft.VisualStudio.DebuggerVisualizers">
      <HintPath>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Packages\Debugger\Visualizers\Microsoft.VisualStudio.DebuggerVisualizers.dll</HintPath>
    </Reference>
    <Reference Include="NRules">
      <HintPath>..\..\..\binaries\NRules\net45\NRules.dll</HintPath>
    </Reference>
    <Reference Include="NRules.Fluent">
      <HintPath>..\..\..\binaries\NRules\net45\NRules.Fluent.dll</HintPath>
    </Reference>
    <Reference Include="NRules.RuleModel">
      <HintPath>..\..\..\binaries\NRules\net45\NRules.RuleModel.dll</HintPath>
    </Reference>
  </ItemGroup>
  
</Project>

NRules.Debugger.Visualizer.Tests.csproj:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>net45</TargetFramework>
    <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
    <OutputType>Exe</OutputType>
  </PropertyGroup>

  <ItemGroup>
    <ProjectReference Include="..\NRules.Debugger.Visualizer\NRules.Debugger.Visualizer.csproj" />
  </ItemGroup>

  <ItemGroup>
    <Reference Include="Microsoft.VisualStudio.DebuggerVisualizers">
      <HintPath>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Packages\Debugger\Visualizers\Microsoft.VisualStudio.DebuggerVisualizers.dll</HintPath>
    </Reference>
    <Reference Include="NRules">
      <HintPath>..\..\..\binaries\NRules\net45\NRules.dll</HintPath>
    </Reference>
    <Reference Include="NRules.Fluent">
      <HintPath>..\..\..\binaries\NRules\net45\NRules.Fluent.dll</HintPath>
    </Reference>
    <Reference Include="NRules.RuleModel">
      <HintPath>..\..\..\binaries\NRules\net45\NRules.RuleModel.dll</HintPath>
    </Reference>
  </ItemGroup>

</Project>

Then run the build again, and copy the files from under <GitRoot>\NRules\binaries\NRules.Debugger.Visualizer\net45 to <Documents>\Visual Studio 2017\Visualizers

Let me know if this workaround works for you. I'll see if I can have a more permanent solution.

@yuipcheng

This comment has been minimized.

Copy link
Author

commented Jul 13, 2018

Yes, that works for me. Thank you!

@snikolayev

This comment has been minimized.

Copy link
Collaborator

commented Jul 15, 2018

I'm closing this for now. I'm also working on making a VSIX extension for the VS, instead of a visualizer (see #112), which will provide a permanent solution to this issue.

@snikolayev snikolayev closed this Jul 15, 2018

@bigken

This comment has been minimized.

Copy link

commented Oct 11, 2018

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Packages\Debugger\Visualizers\Microsoft.VisualStudio.DebuggerVisualizers.dll

it's for vs2017 Community Version, if you use other editon , please update the Microsoft.VisualStudio.DebuggerVisualizers.dll's Path.

e.g. profession editor path is
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\Packages\Debugger\Visualizers\Microsoft.VisualStudio.DebuggerVisualizers.dll

@pachumon

This comment has been minimized.

Copy link

commented Feb 13, 2019

@snikolayev is the above work around required for version NRules-0.8.4 since here the debuggervisualizer is added as nuget package.

I tried to do the changes but i cant find Microsoft.VisualStudio.DebuggerVisualizers.dll in the specified path i am using enterprise edition of vs2017 any help would be much appreciated

@snikolayev

This comment has been minimized.

Copy link
Collaborator

commented Feb 14, 2019

@pachumon yes, the workaround is required. Debugger visualizer is not distributed as a nuget package and requires installation using the procedure described above.
If you are using the Enterprise edition of VS change the path where it says Community to (I suppose) Enterprise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.