开发者

Calling mshtml from limited priviledge (Could not load type, because assembly is not fully trusted)

In ASP.NET application run on remote hosting server i get this error:

Could not load type 'mshtml.IHTMLDocument' from assembly 'myassembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. The type is marked as eligible for type equivalence, but the containing assembly is not loaded as fully trusted.

t开发者_JAVA技巧his Exeption triggers when my function is called but before it gets to execute anything in function body. (body contains call to IHTMLDocument2 doc = (IHTMLDocument2)new HTMLDocument(); among other things) So i guess it is error in function prolog then? wierd

this assembly mshtml will be embedded into my assembly as i understand correctly (Because "Embed interop Tyoes" is set to true). And i want to keep it that way. And at the same time grant it full trust. (It is also not clear from exception message who should get full trust and from whom? my assembly from hosting admin or mshtml from me? )

I actually tried give it full trust like in this Could not load type Microsoft.Office.Interop.Excel._Application topic, i set it inside Web.config in my root directory on server, but it seems that admin set <location allowOverride="false"> and disabled that. , dont' know if that has to do anything with what i want to acomplish. and that is call some function from mshtml assembly wich i trust because it is (partially?) embedded in assembly that i created, and it should not require higher priviledges (it just parses HTML from given string)

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜