开发者

Show Visualizers Error "could not load this custom viewer"

When I try to inspect DataSet by standard DataSet visualizer I see this error "could not load this custom viewer". I wrote simple dataset visualizer, but error throw开发者_开发问答s anyway too.

On other computers with the same configuration visualizer show without any errors.

OS: Windows 7 x86 (Release)

VS: Visual Studio 2010 RC

has somebody any ideas?

I reinstall VS with no effect.


Try the following.

-Go to Tools->options->Debugging->Plz Uncheck "Use Managed Compatibility Mode"


I had the same issue in VS 2015 and none of the answers here helped me but I found an issue on github that described my problem.

The solution, or workaround might be more accurate, for me was to turn off the option "Use the legacy C# and VB evaluators" that I (apparently) had turned on in Tools -> Options -> Debugging -> General.


The best way to diagnose this is to debug Visual Studio itself. Try the following

  • Get Visual Studio into the state where you want to use your Visualizer
  • Attach another version of Visual Studio to the original one (managed only)
  • Disable Just My Code (Tools -> Options -> Debugger -> uncheck "Just my Code")
  • Go to Debug -> Exceptions
  • Check the Throw box for "CLR Exceptions"
  • Switch back to the first VS and Attempt to show your Visualizer

This should throw an exception which will then show up in the second instance of Visual Studio. Please post back with this information if it's not enough to solve your problem.


For me. Visual Studio 2010 restart helped.


I had the same issue in VS2017, I tried a lot but nothing was worked and finally, I reset all the VS settings which I made and the error was gone.

https://blogs.msdn.microsoft.com/zainnab/2010/07/16/reset-all-your-development-settings/


I found workaround! I changed source code of DevExpress module and recompile it. After that I undo parameter to NetFx40_LegacySecurityPolicy enabled="false", and enjoy. :)

File is "%DeveloperExpress.NET%\Sources\DevExpress.Data\Utils\Security.cs"

using System;
using System.Security;
using System.Security.Permissions;
namespace DevExpress.Data.Helpers {
    public static class SecurityHelper {
        public static bool IsPartialTrust {
            get {
                return !IsPermissionGranted(new ReflectionPermission(ReflectionPermissionFlag.MemberAccess));
            }
        }
        public static bool IsPermissionGranted(IPermission permission) {
            bool result = true;
/* (changed by Lion)
            try {
                PermissionSet ps = SecurityManager.ResolvePolicy((System.Security.Policy.Evidence)null);
                ps = ps.Copy();
                ps.AddPermission(permission);
                ps.Demand();
            }
            catch (SecurityException) {
                result = false;
            }
*/
            return result;
        }
    }
}


For me, I had written my own visualizer for a type that I had created. Apparently, this was interfering with VS 2017's ability to display the built-in visualizer for datasets. Once I removed my own visualizer and the Microsoft Debugger Visualizer reference, I could use the built-in ones.
I have written other visualizers in earlier versions of VS that didn't cause any problems.


I found the cause of this error. According this advice http://go.microsoft.com/fwlink/?LinkID=155570 I add to devenv.exe.config this parameter NetFx40_LegacySecurityPolicy enabled="true" and with this parameter in .config file I have the error when try to open DataSet visualizer.

When I remove this parameter all became ok. Execption "The security state of an AppDomain was modified by an AppDomainManager configured with the NoSecurityChanges flag" fixed too.

But I NEED NetFx40_LegacySecurityPolicy enabled="true" parameter to work with old projects.


Clearing Visual Studio Cache fixed it for me.

Just follow these basic steps:

Step 1: clear the Component Cache

  1. Close Visual Studio (ensure devenv.exe is not present in the Task Manager)
  2. Delete the directory:

%USERPROFILE%\AppData\Local\Microsoft\VisualStudio\14.0\ComponentModelCache

If step 1 doesn't work then

Step 2: cleanup your user’s temp folder. Delete this directory:

%USERPROFILE%\AppData\Local\Temp

If step 2 doesn't work then

Step 3: Delete all these directories:

%USERPROFILE%\AppData\Local\Microsoft\Team Foundation

%USERPROFILE%\AppData\Local\Microsoft\VisualStudio

%USERPROFILE%\AppData\Local\Microsoft\VSCommon

Credit : https://errorhandlinginskills.wordpress.com/2018/07/28/how-to-clear-visual-studio-cache/


visual studio -> Tools-> options-> Debugging-> "Use Managed Compatibility Mode" - uncheck this and maybe it works fine then.

Show Visualizers Error "could not load this custom viewer"


in visual studio 2019 community after an update between 16.4.x - 16.7.5 mine was broken all I had to do was uncheck "Warn when using custom debugger visualizers against potentially unsafe processes (Managed only)" and it allowed me to see a visual of the datatable. Under the tools>options>Debugging>general menu.


Just Restart your system. Your problem will be resolved.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜