Hi,
I'm developing a Windows Control Library to use as Smart Client in a
ASP.NET application and one of the tasks of my custom control is call a
WebService. So, when i try to call the WebService using my control
through the IE, i get this exception:
System.Security .SecurityExcept ion: Request for the permission of type
'System.Securit y.Permissions.E nvironmentPermi ssion, mscorlib,
Version=2.0.0.0 , Culture=neutral , PublicKeyToken= b77a5c561934e08 9'
failed.
at System.Security .CodeAccessSecu rityEngine.Chec k(Object demand,
StackCrawlMark& stackMark, Boolean isPermSet)
at System.Security .CodeAccessPerm ission.Demand()
at System.Net.Cred entialCache.get _DefaultCredent ials()
at
System.Web.Serv ices.Protocols. WebClientProtoc ol.set_UseDefau ltCredentials(B oolean
value)
at
com.Enterprise. Impressao.webCa ixa.Caixa.set_U seDefaultCreden tials(Boolean
value)
at com.Enterprise. Impressao.webCa ixa.Caixa..ctor ()
at com.Enterprise. Impressao.PDV.e nviaReducao(Str ing[]
memoriaFiscal, Boolean isReducaoZ)
at com.Enterprise. Impressao.PDV.f echarCaixa()
The action that failed was:
Demand
The type of the first permission that failed was:
System.Security .Permissions.En vironmentPermis sion
and i call my webService at enviaReducao() method. I've trusted my
assembly as FullTrust too.
What should i do?
thanks in advance.