2

I've formatted my harddrive to reinstall Windows 8 x64.

After installing VisualStudio 2013 and then GhostDoc extension, in the moment that I try to run the VS IDE (an VB/C# project of any kind), it throws an exception related to GhostDoc that I would like to solve:

enter image description here

enter image description here

enter image description here

The English translation of the error message above (that is in Spanish) is this:

Exception Source: mscorlib

Exception Type: System.IO.FileLoadException

Exception Message: Loading this assembly would produce a different grant set from other instances. (Exception from HRESULT: 0x80131401)

I never had this problem until now.

The exception happens in GhostDoc version 4.8 and 4.9, the error seems not to be critical 'cause I'm still able to use GhostDoc after accepting the ErrorDialog, but anyways I would like to solve this 'cause I have other kind of problems, I need to install 3rd party controls/extensions silently and if I run the IDE and I get this error then just I can't install nothing 'cause it stops the execution of the IDE, so at the moment what I've did to avoid this error is editing the LoadBehavior property in the GhostDocPro.AddIn XML file, to disable the automatic loading of the extension:

<LoadBehavior>0</LoadBehavior>

Then now every time that I want to use GhostDoc I need to load it manually (see first image above), and of course I'm having the same exception, I need to solve this bug.

This is the Exception:

Detailed error information follows: Date and Time: 26/03/2014 11:55:17 IP Address: {0} OS Platform: Win32NT Processor: AMD64 OS version: 6.2.9200.0 Current user role: Administrator; User;

Allocated Memory: 51 Mb Available Physical Memory: 4096 Mb Available Virtual Memory: 3255 Mb Total Physical Memory: 4096 Mb Total Virtual Memory: 4096 Mb Percentage of physical memory In use: 44 %

Application Domain: DefaultDomain Product Version: 4.9.14064.0 Assembly Codebase: file:///C:/Program Files (x86)/Microsoft Visual Studio 12.0/Common7/IDE/Extensions/SubMain/GhostDoc/1.0/SubMain.GhostDoc.Core.DLL Assembly Version: 2.2.0.0 Assembly Build Date: 05/03/2014 1:39:38 Assembly Full Name: SubMain.GhostDoc.Core, Version=2.2.0.0, Culture=neutral, PublicKeyToken=94c677ee32cc1929

Exception Source: mscorlib Exception Type: System.IO.FileLoadException Exception Message: Si se carga este ensamblado, se generará un conjunto de permisos diferente de otras instancias. (Excepción de HRESULT: 0x80131401) Exception Target Site: CreateInstance

---- Stack Trace ---- System.AppDomain.nCreateDomain(friendlyName As String, setup As AppDomainSetup, providedSecurityInfo As Evidence, creatorsSecurityInfo As Evidence, parentSecurityDescriptor As IntPtr) SubMain.GhostDoc.Core.DLL: N 00000 System.AppDomainManager.CreateDomainHelper(friendlyName As String, securityInfo As Evidence, appDomainInfo As AppDomainSetup) SubMain.GhostDoc.Core.DLL: N 00283 System.AppDomainManager.CreateDomain(friendlyName As String, securityInfo As Evidence, appDomainInfo As AppDomainSetup) SubMain.GhostDoc.Core.DLL: N 00014 System.AppDomain.InternalCreateDomain(friendlyName As String, securityInfo As Evidence, info As AppDomainSetup) SubMain.GhostDoc.Core.DLL: N 10814956 System.AppDomain.CreateDomain(friendlyName As String, securityInfo As Evidence, info As AppDomainSetup) SubMain.GhostDoc.Core.DLL: N 00039 A.c112f74fdd78a5b016f03ca0edba39a26.c9495450a44f85fef6ae7cb241984a67a( As String, As Evidence, As AppDomainSetup) SubMain.GhostDoc.Core.DLL: N 00023 SubMain.Core.Utils.RemoteLoader.cc3c5bc8929eea714ac8c7a330d95ac0b( As String) SubMain.GhostDoc.Core.DLL: N 00142

Loaded assemblies: Assembly Name: mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 Assembly Location: C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll

More info ...

( The full stack trace is here )

Any ideas about the System.IO.FileLoadException exception that I'm facing?


PS: If someone is thinking why I'm posting this issue here in StackOverflow instead of contacting to GhostDoc team, well I've sent the bug to GhostDoc Developers but I remember that they didn't wanted to helped me in other StackOverFlow post (that was not related to any bug, was a very simple question about how to uninstall their product in X circunstances), so I really don't expect any help from GhostDoc team to solve this in StackOverflow and maybe (only maybe) I could have more choices to solve this issue with the help of other users that maybe has the same issue.

ElektroStudios
  • 19,105
  • 33
  • 200
  • 417
  • Spanish exception message in english: If you load this assembly, it will generate a different set of permissions for other instances. – Paul Zahra Mar 26 '14 at 11:36
  • Have you tried running vs2013 as administrator? – Paul Zahra Mar 26 '14 at 11:36
  • @Paul Zahra Yes I'm already the only Admin account on my PC, I've tried now to run the Devenv.exe as Administrator and the problem persists. thanks for comment! – ElektroStudios Mar 26 '14 at 11:40

1 Answers1

1

Try the following:

To add an assembly to the fully trusted assembly list (taken from here)

  • In the .NET Framework 1.0 and 1.1, at the command line, type %Systemroot%\Microsoft.NET\Framework\versionNumber\Mscorcfg.msc. In the .NET Framework 2.0, start the SDK Command Prompt and type mscorcfg.msc.
  • The user interface for the tool is displayed.
  • Expand the Runtime Security Policy node.
  • Expand the node for the policy level you want to add the new assembly to.
  • Right-click Policy Assemblies and choose Add.
  • Select the assembly name from the list that appears. These are the assemblies that are in the global assembly cache.
  • Click Select.
Paul Zahra
  • 9,522
  • 8
  • 54
  • 76
  • Thanks for answer, but in the folders (and subfolders) of `C:\Windows\Microsoft.NET\Framework` and/or `C:\Windows\Microsoft.NET\Framework64` I have any `Mscorcfg.msc` file to run, I've ran an explorer searcher in my PC but the file does not exists anywhere. Maybe the same could be done using other way in commandline? – ElektroStudios Mar 26 '14 at 11:49
  • Oh, I'm seeing this now http://msdn.microsoft.com/en-us/library/vstudio/771ss30w%28v=vs.100%29.aspx but I'm not sure which assembly I need to add (DevEnv.exe, GhostDoc.core.dll, other?) I'm trying things now – ElektroStudios Mar 26 '14 at 11:54
  • Using this simple Batch command `For %a in ("*.dll") Do (Start /W "" "C:\Windows\Microsoft.NET\Framework\v4.0.30319\caspol.exe" -y -user -addfulltrust "%a")` to add all the .NET Assemblies to the Security Policy inside these folders: `C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\SubMain\GhostDoc\1.0` and `C:\Program Files (x86)\GhostDoc` did not solved the exception – ElektroStudios Mar 26 '14 at 12:02
  • hmm... I take it you are running a 32 bit machine? http://msdn.microsoft.com/en-us/library/cb6t8dtz%28v=vs.110%29.aspx (For example, the location is %windir%\Microsoft.NET\Framework64\v4.030319\caspol.exe for the .NET Framework 4 on a 64-bit system.) Multiple versions of the tool might be installed if your computer is running multiple versions of the .NET Framework side by side. – Paul Zahra Mar 26 '14 at 14:10
  • Also note the caution section for addfulltrust... this was a bit of a long shot... especially as you seem to be the only one experiencing this issue - according to google at least ;) – Paul Zahra Mar 26 '14 at 14:17
  • I've clarified that I'm running Windows 8 x64, but the SO has installed by default both folders in "Framework" and "Framework64", from versions 1.0 to 4.0, I didn't tried all caspol's executables from those folders, I'm gonna try it now, thanks – ElektroStudios Mar 26 '14 at 14:47