문제

사용자 컨트롤이 포함 된 컴파일 된 클래스 라이브러리가 있으며 웹 페이지에 추가하고 싶습니다. HTML 페이지에 객체 태그를 추가하고있는 것 같습니다.

 <OBJECT id="Main" classid="http://localhost/HelloWorld/Hello.World.dll#Hello.World.UserControl"></OBJECT>

그러나 컨트롤이 표시되지 않습니다. DLL은 내 임시 파일로 만들고 웹 페이지에서 객체 상자를 비워집니다. 임시 인터넷 파일에서 다음과 같은 오류 메시지가 표시됩니다.

? FusionBinderRor! name = hello.world.dll Hello.world.usercontrol

더 이상 디버깅하는 방법을 모르겠습니다. 네임 스케이팅 문제인지 궁금합니다.

편집하다

다음 오류가 로그에서 끝났습니다.

Creating security manager

Microsoft.IE.Manager: Microsoft.IE.Manager: unique id lgth = 42
Microsoft.IE.SecureFactory: Create SecureFactory() with security information
Microsoft.IE.Manager: Created secure factory
Microsoft.IE.SecureFactory: Creating instance of the object in the correct domain
Microsoft.IE.SecureFactory: pUrl = http://localhost/HelloWorld/
Microsoft.IE.SecureFactory: id = 86474707A31303E2234383E24333E2135330000000
Microsoft.IE.SecureFactory: link = 
Microsoft.IE.SecureFactory: licenses = 
Microsoft.IE.SecureFactory: deployment manifest = 
Microsoft.IE.SecureFactory: Security options = ZoneEvidence, SiteEvidence
Microsoft.IE.Manager: Url = http://localhost/HelloWorld/
Microsoft.IE.Manager: UrlGetPartW returned 0
Microsoft.IE.Manager: UrlGetPartW returned 80070057
Microsoft.IE.Manager: CodeBase = http://10.248.43.15
Microsoft.IE.Manager: Application = HelloWorld
Microsoft.IE.Manager: Found a codebase
Microsoft.IE.Manager: UrlCanonicalize returned 0
Microsoft.IE.SecureFactory: URL codeBase: http://localhost/
Microsoft.IE.SecureFactory: URL application: HelloWorld
Microsoft.IE.SecureFactory: Locating domain for http://localhost/
Microsoft.IE.IDKey: Created key
Microsoft.IE.Manager: The domain does not exist.
Microsoft.IE.IDKey: Created key
Microsoft.IE.Manager: The domain does not exist.
Microsoft.IE.SecureFactory: Need to create domain
Microsoft.IE.SecureFactory: Application base: http://localhost/
Microsoft.IE.SecureFactory: Private Bin Path: bin
Microsoft.IE.IDKey: Created key
Microsoft.IE.SecureFactory: Trying to create instance of type http://localhost/HelloWorld/Hello.World.dll#Hello.World.Main
Microsoft.IE.SecureFactory: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeInitializationException: The type initializer for 'ComponentFactory.Krypton.Toolkit.KryptonManager' threw an exception. ---> System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.UIPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
   at System.Windows.Forms.ToolStripManager.set_Renderer(ToolStripRenderer value)
   at ComponentFactory.Krypton.Toolkit.KryptonManager.b()
   at ComponentFactory.Krypton.Toolkit.KryptonManager..cctor()
The action that failed was:
Demand
The type of the first permission that failed was:
System.Security.Permissions.UIPermission
The first permission that failed was:
<IPermission class="System.Security.Permissions.UIPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Window="AllWindows"/>

The demand was for:
<PermissionSet class="System.Security.PermissionSet"
version="1">
<IPermission class="System.Security.Permissions.UIPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Window="AllWindows"/>
</PermissionSet>

The granted set of the failing assembly was:
<PermissionSet class="System.Security.PermissionSet"
version="1">
<IPermission class="System.Security.Permissions.FileDialogPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Access="Open"/>
<IPermission class="System.Security.Permissions.IsolatedStorageFilePermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Allowed="ApplicationIsolationByUser"
UserQuota="512000"/>
<IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Flags="Execution"/>
<IPermission class="System.Security.Permissions.UIPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Window="SafeTopLevelWindows"
Clipboard="OwnClipboard"/>
<IPermission class="System.Security.Permissions.SiteIdentityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Site="localhost"/>
<IPermission class="System.Security.Permissions.UrlIdentityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Url="http://localhost/HelloWorld/Hello.World.dll"/>
<IPermission class="System.Security.Permissions.ZoneIdentityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Zone="Internet"/>
<IPermission class="System.Drawing.Printing.PrintingPermission, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
version="1"
Level="SafePrinting"/>
<IPermission class="System.Net.WebPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1">
<ConnectAccess>
<URI uri="(http|https)://localhost/*"/>
</ConnectAccess>
</IPermission>
</PermissionSet>

The assembly or AppDomain that failed was:
Hello.World, Version=1.0.3460.18220, Culture=neutral, PublicKeyToken=null
The method that caused the failure was:
Void InitializeComponent()
The Zone of the assembly that failed was:
Internet
The Url of the assembly that failed was:
http://localhost/HelloWorld/Hello.World.dll
   --- End of inner exception stack trace ---
   at ComponentFactory.Krypton.Toolkit.KryptonManager.get_CurrentGlobalPalette()
   at ComponentFactory.Krypton.Toolkit.VisualPanel..ctor()
   at ComponentFactory.Krypton.Toolkit.KryptonPanel..ctor()
   at Hello.World.BottomPanel.InitializeComponent()
   at Hello.World.BottomPanel..ctor()
   at Hello.World.Main.InitializeComponent()
   at Hello.World.Main..ctor()
   --- End of inner exception stack trace ---
   at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck)
   at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache)
   at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache)
   at System.Activator.CreateInstance(Type type, Boolean nonPublic)
   at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
   at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
   at System.Activator.CreateComInstanceFrom(String assemblyName, String typeName, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm)
   at System.AppDomain.CreateComInstanceFrom(String assemblyFile, String typeName, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm)
   at System.AppDomain.CreateComInstanceFrom(String assemblyFile, String typeName, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm)
   at Microsoft.IE.SecureFactory.CreateInstanceWithSecurity2(Int32 dwFlags, Int32 dwZone, String wszSite, String wszId, String wszConfig, String wszLicenses, String wszDeploymentManifest)
Microsoft.IE.SecureFactory: LOG exception
Microsoft.IE.SecureFactory: Creating log entry ?FusionBindError!name=Hello.World.dll Hello.World.Main
Microsoft.IE.SecureFactory: Logging to file C:\Documents and Settings\----\Local Settings\Temporary Internet Files\Content.IE5\F84FN98R\CAMF3O8J.HTM

IEHOST 오류 로그 파일 (CAMF308J.HTM)이 포함되어 있습니다.

*****   IEHOST Error Log (Monday, 22 June 2009 12:00)   *****



URL:        http://localhost/HelloWorld/Hello.World.dll
Zone:       3
Assembly Name:  Hello.World.dll
Type Name:  Hello.World.Main



----- Thrown Exception -----


System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeInitializationException: The type initializer for 'ComponentFactory.Krypton.Toolkit.KryptonManager' threw an exception. ---> System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.UIPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
   at System.Windows.Forms.ToolStripManager.set_Renderer(ToolStripRenderer value)
   at ComponentFactory.Krypton.Toolkit.KryptonManager.b()
   at ComponentFactory.Krypton.Toolkit.KryptonManager..cctor()
The action that failed was:
Demand
The type of the first permission that failed was:
System.Security.Permissions.UIPermission
The first permission that failed was:


The demand was for:




The granted set of the failing assembly was:
















The assembly or AppDomain that failed was:
Hello.World, Version=1.0.3460.18220, Culture=neutral, PublicKeyToken=null
The method that caused the failure was:
Void InitializeComponent()
The Zone of the assembly that failed was:
Internet
The Url of the assembly that failed was:
http://localhost/HelloWorld/Hello.World.dll
   --- End of inner exception stack trace ---
   at ComponentFactory.Krypton.Toolkit.KryptonManager.get_CurrentGlobalPalette()
   at ComponentFactory.Krypton.Toolkit.VisualPanel..ctor()
   at ComponentFactory.Krypton.Toolkit.KryptonPanel..ctor()
   at Hello.World.BottomPanel.InitializeComponent()
   at Hello.World.BottomPanel..ctor()
   at Hello.World.Main.InitializeComponent()
   at Hello.World.Main..ctor()
   --- End of inner exception stack trace ---
   at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck)
   at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache)
   at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache)
   at System.Activator.CreateInstance(Type type, Boolean nonPublic)
   at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
   at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
   at System.Activator.CreateComInstanceFrom(String assemblyName, String typeName, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm)
   at System.AppDomain.CreateComInstanceFrom(String assemblyFile, String typeName, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm)
   at System.AppDomain.CreateComInstanceFrom(String assemblyFile, String typeName, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm)
   at Microsoft.IE.SecureFactory.CreateInstanceWithSecurity2(Int32 dwFlags, Int32 dwZone, String wszSite, String wszId, String wszConfig, String wszLicenses, String wszDeploymentManifest)
도움이 되었습니까?

해결책

해당 파일 안에는 스택 추적이 있습니다. 게시하면 도움이 될 수 있습니다.

또한 .NET XX 구성 제어판에 사이트를 설정 한 상태에서 완전히 트러스트해야합니다 (또는 CASPOL을 사용하여 설정).

디버그하는 방법은 다음과 같습니다

  1. Fiddler (Google, 다운로드 및 실행)를 사용하십시오.
  2. 페이지를 새로 고칩니다
  3. 컨트롤이 다운로드 되었습니까? IIS의 디렉토리에서 "스크립트 및 실행 파일"을 끄면 HTTP 500을 얻습니까?
  4. 당신은 퓨전 바인드를 얻습니까 (당신은 그 안에있는 것 - 스택 추적이어야합니다 - 당신은 그것을 던 졌습니까? 고칠 수 있습니까?
  5. 사이트에 완전한 트러스트 설정이 있습니까?

다른 팁

참고 : IE8은 인터넷 영역에서 사용자 컨트롤을 비활성화하므로 프로덕션 환경에 배포하려는 경우이를 명심하십시오.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top