473,386 Members | 1,791 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Security.Exception

I think I'll never come across that error. It happens when running code from
a DLL that tries to write to disk. I added permissions in the project
folder, the wwwroot and in IIS to NETWORK_SERVICE and Everyone, with Full
Control to see if it's a permissions problem.

The project is hosted in a Windows 2003 Server and developed from PCs in a
domain, developing with Visual Studio 2005 Beta 1.

--
Regards,

Diego F.

Nov 19 '05 #1
19 3176
What is the exact exception you are seeing? (If possible, could you please
provide the full output from the exception's ToString method?)
"Diego F." <di*******@terra.es> wrote in message
news:uM**************@TK2MSFTNGP12.phx.gbl...
I think I'll never come across that error. It happens when running code
from a DLL that tries to write to disk. I added permissions in the project
folder, the wwwroot and in IIS to NETWORK_SERVICE and Everyone, with Full
Control to see if it's a permissions problem.

The project is hosted in a Windows 2003 Server and developed from PCs in a
domain, developing with Visual Studio 2005 Beta 1.

--
Regards,

Diego F.

Nov 19 '05 #2
The complete error message:

Security Exception
Description: The application attempted to perform an operation not allowed
by the security policy. To grant this application the required permission
please contact your system administrator or change the application's trust
level in the configuration file.

Exception Details: System.Security.SecurityException: That assembly does not
allow partially trusted callers.

Source Error:
Line 54: fichero))
Line 55: HttpContext.Current.Response.ContentType =
"application/pdf"
Line 56:
myPdfDocument.SaveToStream(HttpContext.Current.Res ponse.OutputStream)
Line 57: HttpContext.Current.Response.End()
Line 58:
Source File:
\\Mantelnorserv\Proyectos\Mantelnor\Bampimor\Code\ Aplicacion\Gestores\GestorPDF.vb
Line: 56

--
Regards,

Diego F.

"Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> escribió en el
mensaje news:%2****************@TK2MSFTNGP10.phx.gbl...
What is the exact exception you are seeing? (If possible, could you
please provide the full output from the exception's ToString method?)
"Diego F." <di*******@terra.es> wrote in message
news:uM**************@TK2MSFTNGP12.phx.gbl...
I think I'll never come across that error. It happens when running code
from a DLL that tries to write to disk. I added permissions in the project
folder, the wwwroot and in IIS to NETWORK_SERVICE and Everyone, with Full
Control to see if it's a permissions problem.

The project is hosted in a Windows 2003 Server and developed from PCs in
a domain, developing with Visual Studio 2005 Beta 1.

--
Regards,

Diego F.


Nov 19 '05 #3
the message is pretty clear. your code is calling a untrusted assembly
method, and your asp.net security policy says this is not allowed. in
machine.config check what the location trustLevel is set to for web apps.

-- bruce (sqlwork.com)


"Diego F." <di*******@terra.es> wrote in message
news:OB**************@TK2MSFTNGP10.phx.gbl...
The complete error message:

Security Exception
Description: The application attempted to perform an operation not allowed
by the security policy. To grant this application the required permission
please contact your system administrator or change the application's trust
level in the configuration file.

Exception Details: System.Security.SecurityException: That assembly does
not allow partially trusted callers.

Source Error:
Line 54: fichero))
Line 55: HttpContext.Current.Response.ContentType =
"application/pdf"
Line 56:
myPdfDocument.SaveToStream(HttpContext.Current.Res ponse.OutputStream)
Line 57: HttpContext.Current.Response.End()
Line 58:
Source File:
\\Mantelnorserv\Proyectos\Mantelnor\Bampimor\Code\ Aplicacion\Gestores\GestorPDF.vb
Line: 56

--
Regards,

Diego F.

"Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> escribió en el
mensaje news:%2****************@TK2MSFTNGP10.phx.gbl...
What is the exact exception you are seeing? (If possible, could you
please provide the full output from the exception's ToString method?)
"Diego F." <di*******@terra.es> wrote in message
news:uM**************@TK2MSFTNGP12.phx.gbl...
I think I'll never come across that error. It happens when running code
from a DLL that tries to write to disk. I added permissions in the
project folder, the wwwroot and in IIS to NETWORK_SERVICE and Everyone,
with Full Control to see if it's a permissions problem.

The project is hosted in a Windows 2003 Server and developed from PCs in
a domain, developing with Visual Studio 2005 Beta 1.

--
Regards,

Diego F.



Nov 19 '05 #4
This exception is thrown by the version 2.0 .NET Framework when an assembly
that is not fully trusted calls attempts to call into a strongly named
assembly that is not marked with AllowPartiallyTrustedCallersAttribute. (A
far more obscure exception is thrown in the v. 1.x Framework.) This is
meant to prevent certain kinds of attacks in which fully trusted code might
be tricked into running potentially dangerous operations on behalf of code
with more restricted permissions.

Based on the error output you provided, it seems a little unlikely that the
partially trusted assembly that is causing the problem is actually your web
application. If this were the case, the exception should have been thrown
for the first line of code in which any use of the assembly in which the
type of your myPdfDocument object is declared. However, given that this is
happening on a beta platform, there could very well be a problem in the
exception details output. To rule out this possibility, might you be able
to trap the exception so that its full details (including the call stack
listing) could be captured via its ToString method?

"Diego F." <di*******@terra.es> wrote in message
news:OB**************@TK2MSFTNGP10.phx.gbl...
The complete error message:

Security Exception
Description: The application attempted to perform an operation not allowed
by the security policy. To grant this application the required permission
please contact your system administrator or change the application's trust
level in the configuration file.

Exception Details: System.Security.SecurityException: That assembly does
not allow partially trusted callers.

Source Error:
Line 54: fichero))
Line 55: HttpContext.Current.Response.ContentType =
"application/pdf"
Line 56:
myPdfDocument.SaveToStream(HttpContext.Current.Res ponse.OutputStream)
Line 57: HttpContext.Current.Response.End()
Line 58:
Source File:
\\Mantelnorserv\Proyectos\Mantelnor\Bampimor\Code\ Aplicacion\Gestores\GestorPDF.vb
Line: 56

--
Regards,

Diego F.

"Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> escribió en el
mensaje news:%2****************@TK2MSFTNGP10.phx.gbl...
What is the exact exception you are seeing? (If possible, could you
please provide the full output from the exception's ToString method?)
"Diego F." <di*******@terra.es> wrote in message
news:uM**************@TK2MSFTNGP12.phx.gbl...
I think I'll never come across that error. It happens when running code
from a DLL that tries to write to disk. I added permissions in the
project folder, the wwwroot and in IIS to NETWORK_SERVICE and Everyone,
with Full Control to see if it's a permissions problem.

The project is hosted in a Windows 2003 Server and developed from PCs in
a domain, developing with Visual Studio 2005 Beta 1.

--
Regards,

Diego F.



Nov 19 '05 #5
"Bruce Barker" <br******************@safeco.com> wrote in message
news:OG**************@TK2MSFTNGP09.phx.gbl...
the message is pretty clear. your code is calling a untrusted assembly
method,
Umm... What's an "untrusted assembly method"?
and your asp.net security policy says this is not allowed. in
machine.config check what the location trustLevel is set to for web apps.
Code in some partially trusted assembly is calling into a strongly named
assembly, but it's not necessarily Diego's web application, and the lack of
full trust grant is not necessarily due to the ASP.NET policy.


-- bruce (sqlwork.com)


"Diego F." <di*******@terra.es> wrote in message
news:OB**************@TK2MSFTNGP10.phx.gbl...
The complete error message:

Security Exception
Description: The application attempted to perform an operation not
allowed by the security policy. To grant this application the required
permission please contact your system administrator or change the
application's trust level in the configuration file.

Exception Details: System.Security.SecurityException: That assembly does
not allow partially trusted callers.

Source Error:
Line 54: fichero))
Line 55: HttpContext.Current.Response.ContentType =
"application/pdf"
Line 56:
myPdfDocument.SaveToStream(HttpContext.Current.Res ponse.OutputStream)
Line 57: HttpContext.Current.Response.End()
Line 58:
Source File:
\\Mantelnorserv\Proyectos\Mantelnor\Bampimor\Code\ Aplicacion\Gestores\GestorPDF.vb
Line: 56

--
Regards,

Diego F.

"Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> escribió en el
mensaje news:%2****************@TK2MSFTNGP10.phx.gbl...
What is the exact exception you are seeing? (If possible, could you
please provide the full output from the exception's ToString method?)
"Diego F." <di*******@terra.es> wrote in message
news:uM**************@TK2MSFTNGP12.phx.gbl...
I think I'll never come across that error. It happens when running code
from a DLL that tries to write to disk. I added permissions in the
project folder, the wwwroot and in IIS to NETWORK_SERVICE and Everyone,
with Full Control to see if it's a permissions problem.

The project is hosted in a Windows 2003 Server and developed from PCs
in a domain, developing with Visual Studio 2005 Beta 1.

--
Regards,

Diego F.




Nov 19 '05 #6
In the server? Where is that?

--
Regards,

Diego F.
"Bruce Barker" <br******************@safeco.com> escribió en el mensaje
news:OG**************@TK2MSFTNGP09.phx.gbl...
the message is pretty clear. your code is calling a untrusted assembly
method, and your asp.net security policy says this is not allowed. in
machine.config check what the location trustLevel is set to for web apps.

-- bruce (sqlwork.com)


"Diego F." <di*******@terra.es> wrote in message
news:OB**************@TK2MSFTNGP10.phx.gbl...
The complete error message:

Security Exception
Description: The application attempted to perform an operation not
allowed by the security policy. To grant this application the required
permission please contact your system administrator or change the
application's trust level in the configuration file.

Exception Details: System.Security.SecurityException: That assembly does
not allow partially trusted callers.

Source Error:
Line 54: fichero))
Line 55: HttpContext.Current.Response.ContentType =
"application/pdf"
Line 56:
myPdfDocument.SaveToStream(HttpContext.Current.Res ponse.OutputStream)
Line 57: HttpContext.Current.Response.End()
Line 58:
Source File:
\\Mantelnorserv\Proyectos\Mantelnor\Bampimor\Code\ Aplicacion\Gestores\GestorPDF.vb
Line: 56

--
Regards,

Diego F.

"Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> escribió en el
mensaje news:%2****************@TK2MSFTNGP10.phx.gbl...
What is the exact exception you are seeing? (If possible, could you
please provide the full output from the exception's ToString method?)
"Diego F." <di*******@terra.es> wrote in message
news:uM**************@TK2MSFTNGP12.phx.gbl...
I think I'll never come across that error. It happens when running code
from a DLL that tries to write to disk. I added permissions in the
project folder, the wwwroot and in IIS to NETWORK_SERVICE and Everyone,
with Full Control to see if it's a permissions problem.

The project is hosted in a Windows 2003 Server and developed from PCs
in a domain, developing with Visual Studio 2005 Beta 1.

--
Regards,

Diego F.




Nov 19 '05 #7
That's what I have in my server machine.config: I suppose that's the
relevant part.

- <system.web>
- <securityPolicy>
<trustLevel name="Full" policyFile="internal" />
<trustLevel name="High" policyFile="web_hightrust.config" />
<trustLevel name="Medium" policyFile="web_mediumtrust.config" />
<trustLevel name="Low" policyFile="web_lowtrust.config" />
<trustLevel name="Minimal" policyFile="web_minimaltrust.config" />
</securityPolicy>
<trust level="Full" originUrl="" />
</system.web>
--
Regards,

Diego F.


"Bruce Barker" <br******************@safeco.com> escribió en el mensaje
news:OG**************@TK2MSFTNGP09.phx.gbl...
the message is pretty clear. your code is calling a untrusted assembly
method, and your asp.net security policy says this is not allowed. in
machine.config check what the location trustLevel is set to for web apps.

-- bruce (sqlwork.com)


"Diego F." <di*******@terra.es> wrote in message
news:OB**************@TK2MSFTNGP10.phx.gbl...
The complete error message:

Security Exception
Description: The application attempted to perform an operation not
allowed by the security policy. To grant this application the required
permission please contact your system administrator or change the
application's trust level in the configuration file.

Exception Details: System.Security.SecurityException: That assembly does
not allow partially trusted callers.

Source Error:
Line 54: fichero))
Line 55: HttpContext.Current.Response.ContentType =
"application/pdf"
Line 56:
myPdfDocument.SaveToStream(HttpContext.Current.Res ponse.OutputStream)
Line 57: HttpContext.Current.Response.End()
Line 58:
Source File:
\\Mantelnorserv\Proyectos\Mantelnor\Bampimor\Code\ Aplicacion\Gestores\GestorPDF.vb
Line: 56

--
Regards,

Diego F.

"Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> escribió en el
mensaje news:%2****************@TK2MSFTNGP10.phx.gbl...
What is the exact exception you are seeing? (If possible, could you
please provide the full output from the exception's ToString method?)
"Diego F." <di*******@terra.es> wrote in message
news:uM**************@TK2MSFTNGP12.phx.gbl...
I think I'll never come across that error. It happens when running code
from a DLL that tries to write to disk. I added permissions in the
project folder, the wwwroot and in IIS to NETWORK_SERVICE and Everyone,
with Full Control to see if it's a permissions problem.

The project is hosted in a Windows 2003 Server and developed from PCs
in a domain, developing with Visual Studio 2005 Beta 1.

--
Regards,

Diego F.




Nov 19 '05 #8
Here is the stack info:

Stack Trace:

[SecurityException: That assembly does not allow partially trusted callers.]
System.Security.CodeAccessSecurityEngine.ThrowSecu rityException(Assembly
asm, PermissionSet granted, PermissionSet refused, RuntimeMethodHandle rmh,
SecurityAction action, Object demand, IPermission permThatFailed) +130
Gios.Pdf.Utility.Deflate(Byte[] b) in C:\Documents and
Settings\MS006\Escritorio\diego\Gios Pdf.NET\Utility.cs:81
Gios.Pdf.PdfTablePage.StreamWrite(Stream stream) in C:\Documents and
Settings\MS006\Escritorio\diego\Gios Pdf.NET\Table
Objects\PdfTablePage.cs:114
Gios.Pdf.PdfDocument.SaveToStream(Stream m) in C:\Documents and
Settings\MS006\Escritorio\diego\Gios Pdf.NET\PdfDocument.cs:237
GestorPDF.GenerarPDF(String titulo, DataTable Table, String fichero) in
\\Mantelnorserv\Proyectos\Mantelnor\Bampimor\Code\ Aplicacion\Gestores\GestorPDF.vb:56
ExportarDatos_aspx.ExportarPDF() in
\\Mantelnorserv\Proyectos\Mantelnor\Bampimor\Expor tarDatos.aspx.vb:121
ExportarDatos_aspx.Page_Load(Object sender, EventArgs e) in
\\Mantelnorserv\Proyectos\Mantelnor\Bampimor\Expor tarDatos.aspx.vb:25
System.Web.UI.Control.OnLoad(EventArgs e) +87
System.Web.UI.Control.LoadRecursive() +55
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6828
System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint,
Boolean includeStagesAfterAsyncPoint) +229
System.Web.UI.Page.ProcessRequest(HttpContext context) +34
System.Web.CallHandlerExecutionStep.System.Web.Htt pApplication.IExecutionStep.Execute()
+305
System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean&
completedSynchronously) +76

--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.40607.16; ASP.NET
Version:2.0.40607.16

__
Regards,

Diego F.
"Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> escribió en el
mensaje news:uV**************@tk2msftngp13.phx.gbl...
This exception is thrown by the version 2.0 .NET Framework when an
assembly that is not fully trusted calls attempts to call into a strongly
named assembly that is not marked with
AllowPartiallyTrustedCallersAttribute. (A far more obscure exception is
thrown in the v. 1.x Framework.) This is meant to prevent certain kinds
of attacks in which fully trusted code might be tricked into running
potentially dangerous operations on behalf of code with more restricted
permissions.

Based on the error output you provided, it seems a little unlikely that
the partially trusted assembly that is causing the problem is actually
your web application. If this were the case, the exception should have
been thrown for the first line of code in which any use of the assembly in
which the type of your myPdfDocument object is declared. However, given
that this is happening on a beta platform, there could very well be a
problem in the exception details output. To rule out this possibility,
might you be able to trap the exception so that its full details
(including the call stack listing) could be captured via its ToString
method?

"Diego F." <di*******@terra.es> wrote in message
news:OB**************@TK2MSFTNGP10.phx.gbl...
The complete error message:

Security Exception
Description: The application attempted to perform an operation not
allowed by the security policy. To grant this application the required
permission please contact your system administrator or change the
application's trust level in the configuration file.

Exception Details: System.Security.SecurityException: That assembly does
not allow partially trusted callers.

Source Error:
Line 54: fichero))
Line 55: HttpContext.Current.Response.ContentType =
"application/pdf"
Line 56:
myPdfDocument.SaveToStream(HttpContext.Current.Res ponse.OutputStream)
Line 57: HttpContext.Current.Response.End()
Line 58:
Source File:
\\Mantelnorserv\Proyectos\Mantelnor\Bampimor\Code\ Aplicacion\Gestores\GestorPDF.vb
Line: 56

--
Regards,

Diego F.

"Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> escribió en el
mensaje news:%2****************@TK2MSFTNGP10.phx.gbl...
What is the exact exception you are seeing? (If possible, could you
please provide the full output from the exception's ToString method?)
"Diego F." <di*******@terra.es> wrote in message
news:uM**************@TK2MSFTNGP12.phx.gbl...
I think I'll never come across that error. It happens when running code
from a DLL that tries to write to disk. I added permissions in the
project folder, the wwwroot and in IIS to NETWORK_SERVICE and Everyone,
with Full Control to see if it's a permissions problem.

The project is hosted in a Windows 2003 Server and developed from PCs
in a domain, developing with Visual Studio 2005 Beta 1.

--
Regards,

Diego F.




Nov 19 '05 #9
The Gios.Pdf.Utility.Deflate method shown in the call stack is calling into
the ICSharpCode.SharpZipLib.dll library assembly, which is strongly named.
Given that the exception is being thrown, it would appear that the Gios
Pdf.NET.dll assembly is not fully trusted. If you verify the permissions
for the Gios library as described in the "To evaluate an assembly" section
at
http://msdn.microsoft.com/library/en...scorcfgmsc.asp,
does it appear to be granted unrestricted permissions (full trust)? If not,
can you tell why not based on its code group membership?

"Diego F." <di*******@terra.es> wrote in message
news:OQ**************@tk2msftngp13.phx.gbl...
Here is the stack info:

Stack Trace:

[SecurityException: That assembly does not allow partially trusted
callers.]
System.Security.CodeAccessSecurityEngine.ThrowSecu rityException(Assembly
asm, PermissionSet granted, PermissionSet refused, RuntimeMethodHandle
rmh, SecurityAction action, Object demand, IPermission permThatFailed)
+130
Gios.Pdf.Utility.Deflate(Byte[] b) in C:\Documents and
Settings\MS006\Escritorio\diego\Gios Pdf.NET\Utility.cs:81
Gios.Pdf.PdfTablePage.StreamWrite(Stream stream) in C:\Documents and
Settings\MS006\Escritorio\diego\Gios Pdf.NET\Table
Objects\PdfTablePage.cs:114
Gios.Pdf.PdfDocument.SaveToStream(Stream m) in C:\Documents and
Settings\MS006\Escritorio\diego\Gios Pdf.NET\PdfDocument.cs:237
GestorPDF.GenerarPDF(String titulo, DataTable Table, String fichero) in
\\Mantelnorserv\Proyectos\Mantelnor\Bampimor\Code\ Aplicacion\Gestores\GestorPDF.vb:56
ExportarDatos_aspx.ExportarPDF() in
\\Mantelnorserv\Proyectos\Mantelnor\Bampimor\Expor tarDatos.aspx.vb:121
ExportarDatos_aspx.Page_Load(Object sender, EventArgs e) in
\\Mantelnorserv\Proyectos\Mantelnor\Bampimor\Expor tarDatos.aspx.vb:25
System.Web.UI.Control.OnLoad(EventArgs e) +87
System.Web.UI.Control.LoadRecursive() +55
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6828
System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint,
Boolean includeStagesAfterAsyncPoint) +229
System.Web.UI.Page.ProcessRequest(HttpContext context) +34

System.Web.CallHandlerExecutionStep.System.Web.Htt pApplication.IExecutionStep.Execute()
+305
System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean&
completedSynchronously) +76

--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.40607.16;
ASP.NET Version:2.0.40607.16

__
Regards,

Diego F.
"Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> escribió en el
mensaje news:uV**************@tk2msftngp13.phx.gbl...
This exception is thrown by the version 2.0 .NET Framework when an
assembly that is not fully trusted calls attempts to call into a strongly
named assembly that is not marked with
AllowPartiallyTrustedCallersAttribute. (A far more obscure exception is
thrown in the v. 1.x Framework.) This is meant to prevent certain kinds
of attacks in which fully trusted code might be tricked into running
potentially dangerous operations on behalf of code with more restricted
permissions.

Based on the error output you provided, it seems a little unlikely that
the partially trusted assembly that is causing the problem is actually
your web application. If this were the case, the exception should have
been thrown for the first line of code in which any use of the assembly
in which the type of your myPdfDocument object is declared. However,
given that this is happening on a beta platform, there could very well be
a problem in the exception details output. To rule out this possibility,
might you be able to trap the exception so that its full details
(including the call stack listing) could be captured via its ToString
method?

"Diego F." <di*******@terra.es> wrote in message
news:OB**************@TK2MSFTNGP10.phx.gbl...
The complete error message:

Security Exception
Description: The application attempted to perform an operation not
allowed by the security policy. To grant this application the required
permission please contact your system administrator or change the
application's trust level in the configuration file.

Exception Details: System.Security.SecurityException: That assembly does
not allow partially trusted callers.

Source Error:
Line 54: fichero))
Line 55: HttpContext.Current.Response.ContentType =
"application/pdf"
Line 56:
myPdfDocument.SaveToStream(HttpContext.Current.Res ponse.OutputStream)
Line 57: HttpContext.Current.Response.End()
Line 58:
Source File:
\\Mantelnorserv\Proyectos\Mantelnor\Bampimor\Code\ Aplicacion\Gestores\GestorPDF.vb
Line: 56

--
Regards,

Diego F.

"Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> escribió en el
mensaje news:%2****************@TK2MSFTNGP10.phx.gbl...
What is the exact exception you are seeing? (If possible, could you
please provide the full output from the exception's ToString method?)
"Diego F." <di*******@terra.es> wrote in message
news:uM**************@TK2MSFTNGP12.phx.gbl...
>I think I'll never come across that error. It happens when running code
>from a DLL that tries to write to disk. I added permissions in the
>project folder, the wwwroot and in IIS to NETWORK_SERVICE and Everyone,
>with Full Control to see if it's a permissions problem.
>
> The project is hosted in a Windows 2003 Server and developed from PCs
> in a domain, developing with Visual Studio 2005 Beta 1.
>
> --
> Regards,
>
> Diego F.
>
>
>



Nov 19 '05 #10
I have the source of gios.dll. Should I strong name it? I tried it but I
found no difference.

--
Regards,

Diego F.

"Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> escribió en el
mensaje news:uB*************@TK2MSFTNGP12.phx.gbl...
The Gios.Pdf.Utility.Deflate method shown in the call stack is calling
into the ICSharpCode.SharpZipLib.dll library assembly, which is strongly
named. Given that the exception is being thrown, it would appear that the
Gios Pdf.NET.dll assembly is not fully trusted. If you verify the
permissions for the Gios library as described in the "To evaluate an
assembly" section at
http://msdn.microsoft.com/library/en...scorcfgmsc.asp,
does it appear to be granted unrestricted permissions (full trust)? If
not, can you tell why not based on its code group membership?

"Diego F." <di*******@terra.es> wrote in message
news:OQ**************@tk2msftngp13.phx.gbl...
Here is the stack info:

Stack Trace:

[SecurityException: That assembly does not allow partially trusted
callers.]

System.Security.CodeAccessSecurityEngine.ThrowSecu rityException(Assembly
asm, PermissionSet granted, PermissionSet refused, RuntimeMethodHandle
rmh, SecurityAction action, Object demand, IPermission permThatFailed)
+130
Gios.Pdf.Utility.Deflate(Byte[] b) in C:\Documents and
Settings\MS006\Escritorio\diego\Gios Pdf.NET\Utility.cs:81
Gios.Pdf.PdfTablePage.StreamWrite(Stream stream) in C:\Documents and
Settings\MS006\Escritorio\diego\Gios Pdf.NET\Table
Objects\PdfTablePage.cs:114
Gios.Pdf.PdfDocument.SaveToStream(Stream m) in C:\Documents and
Settings\MS006\Escritorio\diego\Gios Pdf.NET\PdfDocument.cs:237
GestorPDF.GenerarPDF(String titulo, DataTable Table, String fichero) in
\\Mantelnorserv\Proyectos\Mantelnor\Bampimor\Code\ Aplicacion\Gestores\GestorPDF.vb:56
ExportarDatos_aspx.ExportarPDF() in
\\Mantelnorserv\Proyectos\Mantelnor\Bampimor\Expor tarDatos.aspx.vb:121
ExportarDatos_aspx.Page_Load(Object sender, EventArgs e) in
\\Mantelnorserv\Proyectos\Mantelnor\Bampimor\Expor tarDatos.aspx.vb:25
System.Web.UI.Control.OnLoad(EventArgs e) +87
System.Web.UI.Control.LoadRecursive() +55
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
+6828
System.Web.UI.Page.ProcessRequest(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +229
System.Web.UI.Page.ProcessRequest(HttpContext context) +34

System.Web.CallHandlerExecutionStep.System.Web.Htt pApplication.IExecutionStep.Execute()
+305
System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean&
completedSynchronously) +76

--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.40607.16;
ASP.NET Version:2.0.40607.16

__
Regards,

Diego F.
"Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> escribió en el
mensaje news:uV**************@tk2msftngp13.phx.gbl...
This exception is thrown by the version 2.0 .NET Framework when an
assembly that is not fully trusted calls attempts to call into a
strongly named assembly that is not marked with
AllowPartiallyTrustedCallersAttribute. (A far more obscure exception is
thrown in the v. 1.x Framework.) This is meant to prevent certain kinds
of attacks in which fully trusted code might be tricked into running
potentially dangerous operations on behalf of code with more restricted
permissions.

Based on the error output you provided, it seems a little unlikely that
the partially trusted assembly that is causing the problem is actually
your web application. If this were the case, the exception should have
been thrown for the first line of code in which any use of the assembly
in which the type of your myPdfDocument object is declared. However,
given that this is happening on a beta platform, there could very well
be a problem in the exception details output. To rule out this
possibility, might you be able to trap the exception so that its full
details (including the call stack listing) could be captured via its
ToString method?

"Diego F." <di*******@terra.es> wrote in message
news:OB**************@TK2MSFTNGP10.phx.gbl...
The complete error message:

Security Exception
Description: The application attempted to perform an operation not
allowed by the security policy. To grant this application the required
permission please contact your system administrator or change the
application's trust level in the configuration file.

Exception Details: System.Security.SecurityException: That assembly
does not allow partially trusted callers.

Source Error:
Line 54: fichero))
Line 55: HttpContext.Current.Response.ContentType =
"application/pdf"
Line 56:
myPdfDocument.SaveToStream(HttpContext.Current.Res ponse.OutputStream)
Line 57: HttpContext.Current.Response.End()
Line 58:
Source File:
\\Mantelnorserv\Proyectos\Mantelnor\Bampimor\Code\ Aplicacion\Gestores\GestorPDF.vb
Line: 56

--
Regards,

Diego F.

"Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> escribió en el
mensaje news:%2****************@TK2MSFTNGP10.phx.gbl...
> What is the exact exception you are seeing? (If possible, could you
> please provide the full output from the exception's ToString method?)
>
>
> "Diego F." <di*******@terra.es> wrote in message
> news:uM**************@TK2MSFTNGP12.phx.gbl...
>>I think I'll never come across that error. It happens when running
>>code from a DLL that tries to write to disk. I added permissions in
>>the project folder, the wwwroot and in IIS to NETWORK_SERVICE and
>>Everyone, with Full Control to see if it's a permissions problem.
>>
>> The project is hosted in a Windows 2003 Server and developed from PCs
>> in a domain, developing with Visual Studio 2005 Beta 1.
>>
>> --
>> Regards,
>>
>> Diego F.
>>
>>
>>
>
>



Nov 19 '05 #11
Strong naming it won't help. The problem is that it is partially trusted,
not that it doesn't have a strong name. Have you tried verifying its
permission grant using the instructions from
http://msdn.microsoft.com/library/en...corcfgmsc.asp?

"Diego F." <di*******@terra.es> wrote in message
news:OF**************@TK2MSFTNGP14.phx.gbl...
I have the source of gios.dll. Should I strong name it? I tried it but I
found no difference.

--
Regards,

Diego F.

"Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> escribió en el
mensaje news:uB*************@TK2MSFTNGP12.phx.gbl...
The Gios.Pdf.Utility.Deflate method shown in the call stack is calling
into the ICSharpCode.SharpZipLib.dll library assembly, which is strongly
named. Given that the exception is being thrown, it would appear that the
Gios Pdf.NET.dll assembly is not fully trusted. If you verify the
permissions for the Gios library as described in the "To evaluate an
assembly" section at
http://msdn.microsoft.com/library/en...scorcfgmsc.asp,
does it appear to be granted unrestricted permissions (full trust)? If
not, can you tell why not based on its code group membership?

"Diego F." <di*******@terra.es> wrote in message
news:OQ**************@tk2msftngp13.phx.gbl...
Here is the stack info:

Stack Trace:

[SecurityException: That assembly does not allow partially trusted
callers.]

System.Security.CodeAccessSecurityEngine.ThrowSecu rityException(Assembly
asm, PermissionSet granted, PermissionSet refused, RuntimeMethodHandle
rmh, SecurityAction action, Object demand, IPermission permThatFailed)
+130
Gios.Pdf.Utility.Deflate(Byte[] b) in C:\Documents and
Settings\MS006\Escritorio\diego\Gios Pdf.NET\Utility.cs:81
Gios.Pdf.PdfTablePage.StreamWrite(Stream stream) in C:\Documents and
Settings\MS006\Escritorio\diego\Gios Pdf.NET\Table
Objects\PdfTablePage.cs:114
Gios.Pdf.PdfDocument.SaveToStream(Stream m) in C:\Documents and
Settings\MS006\Escritorio\diego\Gios Pdf.NET\PdfDocument.cs:237
GestorPDF.GenerarPDF(String titulo, DataTable Table, String fichero)
in
\\Mantelnorserv\Proyectos\Mantelnor\Bampimor\Code\ Aplicacion\Gestores\GestorPDF.vb:56
ExportarDatos_aspx.ExportarPDF() in
\\Mantelnorserv\Proyectos\Mantelnor\Bampimor\Expor tarDatos.aspx.vb:121
ExportarDatos_aspx.Page_Load(Object sender, EventArgs e) in
\\Mantelnorserv\Proyectos\Mantelnor\Bampimor\Expor tarDatos.aspx.vb:25
System.Web.UI.Control.OnLoad(EventArgs e) +87
System.Web.UI.Control.LoadRecursive() +55
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
+6828
System.Web.UI.Page.ProcessRequest(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
+229
System.Web.UI.Page.ProcessRequest(HttpContext context) +34

System.Web.CallHandlerExecutionStep.System.Web.Htt pApplication.IExecutionStep.Execute()
+305
System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean&
completedSynchronously) +76

--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.40607.16;
ASP.NET Version:2.0.40607.16

__
Regards,

Diego F.
"Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> escribió en el
mensaje news:uV**************@tk2msftngp13.phx.gbl...
This exception is thrown by the version 2.0 .NET Framework when an
assembly that is not fully trusted calls attempts to call into a
strongly named assembly that is not marked with
AllowPartiallyTrustedCallersAttribute. (A far more obscure exception
is thrown in the v. 1.x Framework.) This is meant to prevent certain
kinds of attacks in which fully trusted code might be tricked into
running potentially dangerous operations on behalf of code with more
restricted permissions.

Based on the error output you provided, it seems a little unlikely that
the partially trusted assembly that is causing the problem is actually
your web application. If this were the case, the exception should have
been thrown for the first line of code in which any use of the assembly
in which the type of your myPdfDocument object is declared. However,
given that this is happening on a beta platform, there could very well
be a problem in the exception details output. To rule out this
possibility, might you be able to trap the exception so that its full
details (including the call stack listing) could be captured via its
ToString method?

"Diego F." <di*******@terra.es> wrote in message
news:OB**************@TK2MSFTNGP10.phx.gbl...
> The complete error message:
>
> Security Exception
> Description: The application attempted to perform an operation not
> allowed by the security policy. To grant this application the required
> permission please contact your system administrator or change the
> application's trust level in the configuration file.
>
> Exception Details: System.Security.SecurityException: That assembly
> does not allow partially trusted callers.
>
> Source Error:
>
>
> Line 54: fichero))
> Line 55: HttpContext.Current.Response.ContentType =
> "application/pdf"
> Line 56:
> myPdfDocument.SaveToStream(HttpContext.Current.Res ponse.OutputStream)
> Line 57: HttpContext.Current.Response.End()
> Line 58:
>
>
> Source File:
> \\Mantelnorserv\Proyectos\Mantelnor\Bampimor\Code\ Aplicacion\Gestores\GestorPDF.vb
> Line: 56
>
> --
> Regards,
>
> Diego F.
>
>
>
> "Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> escribió en
> el mensaje news:%2****************@TK2MSFTNGP10.phx.gbl...
>> What is the exact exception you are seeing? (If possible, could you
>> please provide the full output from the exception's ToString method?)
>>
>>
>> "Diego F." <di*******@terra.es> wrote in message
>> news:uM**************@TK2MSFTNGP12.phx.gbl...
>>>I think I'll never come across that error. It happens when running
>>>code from a DLL that tries to write to disk. I added permissions in
>>>the project folder, the wwwroot and in IIS to NETWORK_SERVICE and
>>>Everyone, with Full Control to see if it's a permissions problem.
>>>
>>> The project is hosted in a Windows 2003 Server and developed from
>>> PCs in a domain, developing with Visual Studio 2005 Beta 1.
>>>
>>> --
>>> Regards,
>>>
>>> Diego F.
>>>
>>>
>>>
>>
>>
>
>



Nov 19 '05 #12
I can't run that tool in the server. I have installed framewrok 2.0 beta2
and don't know why but there is no .net tools.

Anyway, and don't ask me why, it's working again. It happened a few weeks
ago; suddenly it started working. I put the strong-name, that's the only
change. Since the last time it was working, I just moved the code to other
class and the error reappeared. Now it's working, don't know how much time.

--
Regards,

Diego F.

"Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> escribió en el
mensaje news:eG**************@TK2MSFTNGP10.phx.gbl...
Strong naming it won't help. The problem is that it is partially trusted,
not that it doesn't have a strong name. Have you tried verifying its
permission grant using the instructions from
http://msdn.microsoft.com/library/en...corcfgmsc.asp?

"Diego F." <di*******@terra.es> wrote in message
news:OF**************@TK2MSFTNGP14.phx.gbl...
I have the source of gios.dll. Should I strong name it? I tried it but I
found no difference.

--
Regards,

Diego F.

"Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> escribió en el
mensaje news:uB*************@TK2MSFTNGP12.phx.gbl...
The Gios.Pdf.Utility.Deflate method shown in the call stack is calling
into the ICSharpCode.SharpZipLib.dll library assembly, which is strongly
named. Given that the exception is being thrown, it would appear that
the Gios Pdf.NET.dll assembly is not fully trusted. If you verify the
permissions for the Gios library as described in the "To evaluate an
assembly" section at
http://msdn.microsoft.com/library/en...scorcfgmsc.asp,
does it appear to be granted unrestricted permissions (full trust)? If
not, can you tell why not based on its code group membership?

"Diego F." <di*******@terra.es> wrote in message
news:OQ**************@tk2msftngp13.phx.gbl...
Here is the stack info:

Stack Trace:

[SecurityException: That assembly does not allow partially trusted
callers.]

System.Security.CodeAccessSecurityEngine.ThrowSecu rityException(Assembly
asm, PermissionSet granted, PermissionSet refused, RuntimeMethodHandle
rmh, SecurityAction action, Object demand, IPermission permThatFailed)
+130
Gios.Pdf.Utility.Deflate(Byte[] b) in C:\Documents and
Settings\MS006\Escritorio\diego\Gios Pdf.NET\Utility.cs:81
Gios.Pdf.PdfTablePage.StreamWrite(Stream stream) in C:\Documents and
Settings\MS006\Escritorio\diego\Gios Pdf.NET\Table
Objects\PdfTablePage.cs:114
Gios.Pdf.PdfDocument.SaveToStream(Stream m) in C:\Documents and
Settings\MS006\Escritorio\diego\Gios Pdf.NET\PdfDocument.cs:237
GestorPDF.GenerarPDF(String titulo, DataTable Table, String fichero)
in
\\Mantelnorserv\Proyectos\Mantelnor\Bampimor\Code\ Aplicacion\Gestores\GestorPDF.vb:56
ExportarDatos_aspx.ExportarPDF() in
\\Mantelnorserv\Proyectos\Mantelnor\Bampimor\Expor tarDatos.aspx.vb:121
ExportarDatos_aspx.Page_Load(Object sender, EventArgs e) in
\\Mantelnorserv\Proyectos\Mantelnor\Bampimor\Expor tarDatos.aspx.vb:25
System.Web.UI.Control.OnLoad(EventArgs e) +87
System.Web.UI.Control.LoadRecursive() +55
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
+6828
System.Web.UI.Page.ProcessRequest(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
+229
System.Web.UI.Page.ProcessRequest(HttpContext context) +34

System.Web.CallHandlerExecutionStep.System.Web.Htt pApplication.IExecutionStep.Execute()
+305
System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean&
completedSynchronously) +76

--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.40607.16;
ASP.NET Version:2.0.40607.16

__
Regards,

Diego F.
"Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> escribió en el
mensaje news:uV**************@tk2msftngp13.phx.gbl...
> This exception is thrown by the version 2.0 .NET Framework when an
> assembly that is not fully trusted calls attempts to call into a
> strongly named assembly that is not marked with
> AllowPartiallyTrustedCallersAttribute. (A far more obscure exception
> is thrown in the v. 1.x Framework.) This is meant to prevent certain
> kinds of attacks in which fully trusted code might be tricked into
> running potentially dangerous operations on behalf of code with more
> restricted permissions.
>
> Based on the error output you provided, it seems a little unlikely
> that the partially trusted assembly that is causing the problem is
> actually your web application. If this were the case, the exception
> should have been thrown for the first line of code in which any use of
> the assembly in which the type of your myPdfDocument object is
> declared. However, given that this is happening on a beta platform,
> there could very well be a problem in the exception details output.
> To rule out this possibility, might you be able to trap the exception
> so that its full details (including the call stack listing) could be
> captured via its ToString method?
>
>
>
> "Diego F." <di*******@terra.es> wrote in message
> news:OB**************@TK2MSFTNGP10.phx.gbl...
>> The complete error message:
>>
>> Security Exception
>> Description: The application attempted to perform an operation not
>> allowed by the security policy. To grant this application the
>> required permission please contact your system administrator or
>> change the application's trust level in the configuration file.
>>
>> Exception Details: System.Security.SecurityException: That assembly
>> does not allow partially trusted callers.
>>
>> Source Error:
>>
>>
>> Line 54: fichero))
>> Line 55: HttpContext.Current.Response.ContentType =
>> "application/pdf"
>> Line 56:
>> myPdfDocument.SaveToStream(HttpContext.Current.Res ponse.OutputStream)
>> Line 57: HttpContext.Current.Response.End()
>> Line 58:
>>
>>
>> Source File:
>> \\Mantelnorserv\Proyectos\Mantelnor\Bampimor\Code\ Aplicacion\Gestores\GestorPDF.vb
>> Line: 56
>>
>> --
>> Regards,
>>
>> Diego F.
>>
>>
>>
>> "Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> escribió en
>> el mensaje news:%2****************@TK2MSFTNGP10.phx.gbl...
>>> What is the exact exception you are seeing? (If possible, could you
>>> please provide the full output from the exception's ToString
>>> method?)
>>>
>>>
>>> "Diego F." <di*******@terra.es> wrote in message
>>> news:uM**************@TK2MSFTNGP12.phx.gbl...
>>>>I think I'll never come across that error. It happens when running
>>>>code from a DLL that tries to write to disk. I added permissions in
>>>>the project folder, the wwwroot and in IIS to NETWORK_SERVICE and
>>>>Everyone, with Full Control to see if it's a permissions problem.
>>>>
>>>> The project is hosted in a Windows 2003 Server and developed from
>>>> PCs in a domain, developing with Visual Studio 2005 Beta 1.
>>>>
>>>> --
>>>> Regards,
>>>>
>>>> Diego F.
>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>



Nov 19 '05 #13
"Diego F." <di*******@terra.es> wrote in message
news:OA**************@TK2MSFTNGP12.phx.gbl...
I can't run that tool in the server. I have installed framewrok 2.0 beta2
and don't know why but there is no .net tools.
Unfortunately, Microsoft has been mucking about with the availability of the
tools throughout the beta. In at least some releases, the functionality is
still there, but you need to load it by adding the relevant snap-in after
launching MMC. If you can't get this to work, could you please provide the
following information:

1. Which release of the beta are you using (product(s) and release month)?
2. Is this a development machine or a server on which you've installed only
the framework but not any dev tools?

Anyway, and don't ask me why, it's working again. It happened a few weeks
ago; suddenly it started working. I put the strong-name, that's the only
change.
Have you ever made any changes to the CAS policy on this machine, such as
adding a code group that grants full trust to assemblies signed with the key
you used to sign this assembly?

Since the last time it was working, I just moved the code to other class
and the error reappeared. Now it's working, don't know how much time.
The exact same error or a similar error? (The relevant code in the Gios
library, which I'm guessing you didn't alter, so your change is unlikely to
have affected this particular problem point.)

--
Regards,

Diego F.

"Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> escribió en el
mensaje news:eG**************@TK2MSFTNGP10.phx.gbl...
Strong naming it won't help. The problem is that it is partially
trusted, not that it doesn't have a strong name. Have you tried
verifying its permission grant using the instructions from
http://msdn.microsoft.com/library/en...corcfgmsc.asp?

"Diego F." <di*******@terra.es> wrote in message
news:OF**************@TK2MSFTNGP14.phx.gbl...
I have the source of gios.dll. Should I strong name it? I tried it but I
found no difference.

--
Regards,

Diego F.

"Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> escribió en el
mensaje news:uB*************@TK2MSFTNGP12.phx.gbl...
The Gios.Pdf.Utility.Deflate method shown in the call stack is calling
into the ICSharpCode.SharpZipLib.dll library assembly, which is
strongly named. Given that the exception is being thrown, it would
appear that the Gios Pdf.NET.dll assembly is not fully trusted. If you
verify the permissions for the Gios library as described in the "To
evaluate an assembly" section at
http://msdn.microsoft.com/library/en...scorcfgmsc.asp,
does it appear to be granted unrestricted permissions (full trust)? If
not, can you tell why not based on its code group membership?

"Diego F." <di*******@terra.es> wrote in message
news:OQ**************@tk2msftngp13.phx.gbl...
> Here is the stack info:
>
> Stack Trace:
>
> [SecurityException: That assembly does not allow partially trusted
> callers.]
>
> System.Security.CodeAccessSecurityEngine.ThrowSecu rityException(Assembly
> asm, PermissionSet granted, PermissionSet refused, RuntimeMethodHandle
> rmh, SecurityAction action, Object demand, IPermission permThatFailed)
> +130
> Gios.Pdf.Utility.Deflate(Byte[] b) in C:\Documents and
> Settings\MS006\Escritorio\diego\Gios Pdf.NET\Utility.cs:81
> Gios.Pdf.PdfTablePage.StreamWrite(Stream stream) in C:\Documents and
> Settings\MS006\Escritorio\diego\Gios Pdf.NET\Table
> Objects\PdfTablePage.cs:114
> Gios.Pdf.PdfDocument.SaveToStream(Stream m) in C:\Documents and
> Settings\MS006\Escritorio\diego\Gios Pdf.NET\PdfDocument.cs:237
> GestorPDF.GenerarPDF(String titulo, DataTable Table, String fichero)
> in
> \\Mantelnorserv\Proyectos\Mantelnor\Bampimor\Code\ Aplicacion\Gestores\GestorPDF.vb:56
> ExportarDatos_aspx.ExportarPDF() in
> \\Mantelnorserv\Proyectos\Mantelnor\Bampimor\Expor tarDatos.aspx.vb:121
> ExportarDatos_aspx.Page_Load(Object sender, EventArgs e) in
> \\Mantelnorserv\Proyectos\Mantelnor\Bampimor\Expor tarDatos.aspx.vb:25
> System.Web.UI.Control.OnLoad(EventArgs e) +87
> System.Web.UI.Control.LoadRecursive() +55
> System.Web.UI.Page.ProcessRequestMain(Boolean
> includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
> +6828
> System.Web.UI.Page.ProcessRequest(Boolean
> includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
> +229
> System.Web.UI.Page.ProcessRequest(HttpContext context) +34
>
> System.Web.CallHandlerExecutionStep.System.Web.Htt pApplication.IExecutionStep.Execute()
> +305
> System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean&
> completedSynchronously) +76
>
>
>
> --------------------------------------------------------------------------------
> Version Information: Microsoft .NET Framework Version:2.0.40607.16;
> ASP.NET Version:2.0.40607.16
>
> __
> Regards,
>
> Diego F.
>
>
> "Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> escribió en
> el mensaje news:uV**************@tk2msftngp13.phx.gbl...
>> This exception is thrown by the version 2.0 .NET Framework when an
>> assembly that is not fully trusted calls attempts to call into a
>> strongly named assembly that is not marked with
>> AllowPartiallyTrustedCallersAttribute. (A far more obscure exception
>> is thrown in the v. 1.x Framework.) This is meant to prevent certain
>> kinds of attacks in which fully trusted code might be tricked into
>> running potentially dangerous operations on behalf of code with more
>> restricted permissions.
>>
>> Based on the error output you provided, it seems a little unlikely
>> that the partially trusted assembly that is causing the problem is
>> actually your web application. If this were the case, the exception
>> should have been thrown for the first line of code in which any use
>> of the assembly in which the type of your myPdfDocument object is
>> declared. However, given that this is happening on a beta platform,
>> there could very well be a problem in the exception details output.
>> To rule out this possibility, might you be able to trap the exception
>> so that its full details (including the call stack listing) could be
>> captured via its ToString method?
>>
>>
>>
>> "Diego F." <di*******@terra.es> wrote in message
>> news:OB**************@TK2MSFTNGP10.phx.gbl...
>>> The complete error message:
>>>
>>> Security Exception
>>> Description: The application attempted to perform an operation not
>>> allowed by the security policy. To grant this application the
>>> required permission please contact your system administrator or
>>> change the application's trust level in the configuration file.
>>>
>>> Exception Details: System.Security.SecurityException: That assembly
>>> does not allow partially trusted callers.
>>>
>>> Source Error:
>>>
>>>
>>> Line 54: fichero))
>>> Line 55: HttpContext.Current.Response.ContentType =
>>> "application/pdf"
>>> Line 56:
>>> myPdfDocument.SaveToStream(HttpContext.Current.Res ponse.OutputStream)
>>> Line 57: HttpContext.Current.Response.End()
>>> Line 58:
>>>
>>>
>>> Source File:
>>> \\Mantelnorserv\Proyectos\Mantelnor\Bampimor\Code\ Aplicacion\Gestores\GestorPDF.vb
>>> Line: 56
>>>
>>> --
>>> Regards,
>>>
>>> Diego F.
>>>
>>>
>>>
>>> "Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> escribió en
>>> el mensaje news:%2****************@TK2MSFTNGP10.phx.gbl...
>>>> What is the exact exception you are seeing? (If possible, could
>>>> you please provide the full output from the exception's ToString
>>>> method?)
>>>>
>>>>
>>>> "Diego F." <di*******@terra.es> wrote in message
>>>> news:uM**************@TK2MSFTNGP12.phx.gbl...
>>>>>I think I'll never come across that error. It happens when running
>>>>>code from a DLL that tries to write to disk. I added permissions in
>>>>>the project folder, the wwwroot and in IIS to NETWORK_SERVICE and
>>>>>Everyone, with Full Control to see if it's a permissions problem.
>>>>>
>>>>> The project is hosted in a Windows 2003 Server and developed from
>>>>> PCs in a domain, developing with Visual Studio 2005 Beta 1.
>>>>>
>>>>> --
>>>>> Regards,
>>>>>
>>>>> Diego F.
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>



Nov 19 '05 #14
Wanna hear something funny? I use the library in two methods: one sends a
pdf file via http and the other saves it to disk. Now is the second that
doesn't work. I gave permissions to Everyone but it gives me the error.

--
Regards,

Diego F.

"Diego F." <di*******@terra.es> escribió en el mensaje
news:OA**************@TK2MSFTNGP12.phx.gbl...
I can't run that tool in the server. I have installed framewrok 2.0 beta2
and don't know why but there is no .net tools.

Anyway, and don't ask me why, it's working again. It happened a few weeks
ago; suddenly it started working. I put the strong-name, that's the only
change. Since the last time it was working, I just moved the code to other
class and the error reappeared. Now it's working, don't know how much
time.

--
Regards,

Diego F.

"Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> escribió en el
mensaje news:eG**************@TK2MSFTNGP10.phx.gbl...
Strong naming it won't help. The problem is that it is partially
trusted, not that it doesn't have a strong name. Have you tried
verifying its permission grant using the instructions from
http://msdn.microsoft.com/library/en...corcfgmsc.asp?

"Diego F." <di*******@terra.es> wrote in message
news:OF**************@TK2MSFTNGP14.phx.gbl...
I have the source of gios.dll. Should I strong name it? I tried it but I
found no difference.

--
Regards,

Diego F.

"Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> escribió en el
mensaje news:uB*************@TK2MSFTNGP12.phx.gbl...
The Gios.Pdf.Utility.Deflate method shown in the call stack is calling
into the ICSharpCode.SharpZipLib.dll library assembly, which is
strongly named. Given that the exception is being thrown, it would
appear that the Gios Pdf.NET.dll assembly is not fully trusted. If you
verify the permissions for the Gios library as described in the "To
evaluate an assembly" section at
http://msdn.microsoft.com/library/en...scorcfgmsc.asp,
does it appear to be granted unrestricted permissions (full trust)? If
not, can you tell why not based on its code group membership?

"Diego F." <di*******@terra.es> wrote in message
news:OQ**************@tk2msftngp13.phx.gbl...
> Here is the stack info:
>
> Stack Trace:
>
> [SecurityException: That assembly does not allow partially trusted
> callers.]
>
> System.Security.CodeAccessSecurityEngine.ThrowSecu rityException(Assembly
> asm, PermissionSet granted, PermissionSet refused, RuntimeMethodHandle
> rmh, SecurityAction action, Object demand, IPermission permThatFailed)
> +130
> Gios.Pdf.Utility.Deflate(Byte[] b) in C:\Documents and
> Settings\MS006\Escritorio\diego\Gios Pdf.NET\Utility.cs:81
> Gios.Pdf.PdfTablePage.StreamWrite(Stream stream) in C:\Documents and
> Settings\MS006\Escritorio\diego\Gios Pdf.NET\Table
> Objects\PdfTablePage.cs:114
> Gios.Pdf.PdfDocument.SaveToStream(Stream m) in C:\Documents and
> Settings\MS006\Escritorio\diego\Gios Pdf.NET\PdfDocument.cs:237
> GestorPDF.GenerarPDF(String titulo, DataTable Table, String fichero)
> in
> \\Mantelnorserv\Proyectos\Mantelnor\Bampimor\Code\ Aplicacion\Gestores\GestorPDF.vb:56
> ExportarDatos_aspx.ExportarPDF() in
> \\Mantelnorserv\Proyectos\Mantelnor\Bampimor\Expor tarDatos.aspx.vb:121
> ExportarDatos_aspx.Page_Load(Object sender, EventArgs e) in
> \\Mantelnorserv\Proyectos\Mantelnor\Bampimor\Expor tarDatos.aspx.vb:25
> System.Web.UI.Control.OnLoad(EventArgs e) +87
> System.Web.UI.Control.LoadRecursive() +55
> System.Web.UI.Page.ProcessRequestMain(Boolean
> includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
> +6828
> System.Web.UI.Page.ProcessRequest(Boolean
> includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
> +229
> System.Web.UI.Page.ProcessRequest(HttpContext context) +34
>
> System.Web.CallHandlerExecutionStep.System.Web.Htt pApplication.IExecutionStep.Execute()
> +305
> System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean&
> completedSynchronously) +76
>
>
>
> --------------------------------------------------------------------------------
> Version Information: Microsoft .NET Framework Version:2.0.40607.16;
> ASP.NET Version:2.0.40607.16
>
> __
> Regards,
>
> Diego F.
>
>
> "Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> escribió en
> el mensaje news:uV**************@tk2msftngp13.phx.gbl...
>> This exception is thrown by the version 2.0 .NET Framework when an
>> assembly that is not fully trusted calls attempts to call into a
>> strongly named assembly that is not marked with
>> AllowPartiallyTrustedCallersAttribute. (A far more obscure exception
>> is thrown in the v. 1.x Framework.) This is meant to prevent certain
>> kinds of attacks in which fully trusted code might be tricked into
>> running potentially dangerous operations on behalf of code with more
>> restricted permissions.
>>
>> Based on the error output you provided, it seems a little unlikely
>> that the partially trusted assembly that is causing the problem is
>> actually your web application. If this were the case, the exception
>> should have been thrown for the first line of code in which any use
>> of the assembly in which the type of your myPdfDocument object is
>> declared. However, given that this is happening on a beta platform,
>> there could very well be a problem in the exception details output.
>> To rule out this possibility, might you be able to trap the exception
>> so that its full details (including the call stack listing) could be
>> captured via its ToString method?
>>
>>
>>
>> "Diego F." <di*******@terra.es> wrote in message
>> news:OB**************@TK2MSFTNGP10.phx.gbl...
>>> The complete error message:
>>>
>>> Security Exception
>>> Description: The application attempted to perform an operation not
>>> allowed by the security policy. To grant this application the
>>> required permission please contact your system administrator or
>>> change the application's trust level in the configuration file.
>>>
>>> Exception Details: System.Security.SecurityException: That assembly
>>> does not allow partially trusted callers.
>>>
>>> Source Error:
>>>
>>>
>>> Line 54: fichero))
>>> Line 55: HttpContext.Current.Response.ContentType =
>>> "application/pdf"
>>> Line 56:
>>> myPdfDocument.SaveToStream(HttpContext.Current.Res ponse.OutputStream)
>>> Line 57: HttpContext.Current.Response.End()
>>> Line 58:
>>>
>>>
>>> Source File:
>>> \\Mantelnorserv\Proyectos\Mantelnor\Bampimor\Code\ Aplicacion\Gestores\GestorPDF.vb
>>> Line: 56
>>>
>>> --
>>> Regards,
>>>
>>> Diego F.
>>>
>>>
>>>
>>> "Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> escribió en
>>> el mensaje news:%2****************@TK2MSFTNGP10.phx.gbl...
>>>> What is the exact exception you are seeing? (If possible, could
>>>> you please provide the full output from the exception's ToString
>>>> method?)
>>>>
>>>>
>>>> "Diego F." <di*******@terra.es> wrote in message
>>>> news:uM**************@TK2MSFTNGP12.phx.gbl...
>>>>>I think I'll never come across that error. It happens when running
>>>>>code from a DLL that tries to write to disk. I added permissions in
>>>>>the project folder, the wwwroot and in IIS to NETWORK_SERVICE and
>>>>>Everyone, with Full Control to see if it's a permissions problem.
>>>>>
>>>>> The project is hosted in a Windows 2003 Server and developed from
>>>>> PCs in a domain, developing with Visual Studio 2005 Beta 1.
>>>>>
>>>>> --
>>>>> Regards,
>>>>>
>>>>> Diego F.
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>



Nov 19 '05 #15

"Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> escribió en el
mensaje news:%2****************@tk2msftngp13.phx.gbl...
"Diego F." <di*******@terra.es> wrote in message
news:OA**************@TK2MSFTNGP12.phx.gbl...
I can't run that tool in the server. I have installed framewrok 2.0 beta2
and don't know why but there is no .net tools.
Unfortunately, Microsoft has been mucking about with the availability of
the tools throughout the beta. In at least some releases, the
functionality is still there, but you need to load it by adding the
relevant snap-in after launching MMC. If you can't get this to work,
could you please provide the following information:

1. Which release of the beta are you using (product(s) and release
month)?


In my computer (Windows XP) I'm using Visual Studio 2005 Beta 1 that runs
framework 2.0.40607
In the server (Windows 2003) there is only Framework 2.0 Beta 2 (2.0.50215)
2. Is this a development machine or a server on which you've installed
only the framework but not any dev tools?
The project is in a server folder and I run from my computer, using the
VS2005 integrated web server
In the server I don't have neither VS nor SDK

Anyway, and don't ask me why, it's working again. It happened a few weeks
ago; suddenly it started working. I put the strong-name, that's the only
change.
Have you ever made any changes to the CAS policy on this machine, such as
adding a code group that grants full trust to assemblies signed with the
key you used to sign this assembly?


I tried changing that, but with the previous version of the framework (beta
1) I had errors with my assemblies.
I can change it from my own computer but I suppose it doesn't affect the
global application.

Since the last time it was working, I just moved the code to other class
and the error reappeared. Now it's working, don't know how much time.
The exact same error or a similar error? (The relevant code in the Gios
library, which I'm guessing you didn't alter, so your change is unlikely
to have affected this particular problem point.)


The error always comes when trying to save to disk or send the file.

--
Regards,

Diego F.

"Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> escribió en el
mensaje news:eG**************@TK2MSFTNGP10.phx.gbl...
Strong naming it won't help. The problem is that it is partially
trusted, not that it doesn't have a strong name. Have you tried
verifying its permission grant using the instructions from
http://msdn.microsoft.com/library/en...corcfgmsc.asp?

"Diego F." <di*******@terra.es> wrote in message
news:OF**************@TK2MSFTNGP14.phx.gbl...
I have the source of gios.dll. Should I strong name it? I tried it but I
found no difference.

--
Regards,

Diego F.

"Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> escribió en el
mensaje news:uB*************@TK2MSFTNGP12.phx.gbl...
> The Gios.Pdf.Utility.Deflate method shown in the call stack is calling
> into the ICSharpCode.SharpZipLib.dll library assembly, which is
> strongly named. Given that the exception is being thrown, it would
> appear that the Gios Pdf.NET.dll assembly is not fully trusted. If
> you verify the permissions for the Gios library as described in the
> "To evaluate an assembly" section at
> http://msdn.microsoft.com/library/en...scorcfgmsc.asp,
> does it appear to be granted unrestricted permissions (full trust)?
> If not, can you tell why not based on its code group membership?
>
>
>
> "Diego F." <di*******@terra.es> wrote in message
> news:OQ**************@tk2msftngp13.phx.gbl...
>> Here is the stack info:
>>
>> Stack Trace:
>>
>> [SecurityException: That assembly does not allow partially trusted
>> callers.]
>>
>> System.Security.CodeAccessSecurityEngine.ThrowSecu rityException(Assembly
>> asm, PermissionSet granted, PermissionSet refused,
>> RuntimeMethodHandle rmh, SecurityAction action, Object demand,
>> IPermission permThatFailed) +130
>> Gios.Pdf.Utility.Deflate(Byte[] b) in C:\Documents and
>> Settings\MS006\Escritorio\diego\Gios Pdf.NET\Utility.cs:81
>> Gios.Pdf.PdfTablePage.StreamWrite(Stream stream) in C:\Documents
>> and Settings\MS006\Escritorio\diego\Gios Pdf.NET\Table
>> Objects\PdfTablePage.cs:114
>> Gios.Pdf.PdfDocument.SaveToStream(Stream m) in C:\Documents and
>> Settings\MS006\Escritorio\diego\Gios Pdf.NET\PdfDocument.cs:237
>> GestorPDF.GenerarPDF(String titulo, DataTable Table, String
>> fichero) in
>> \\Mantelnorserv\Proyectos\Mantelnor\Bampimor\Code\ Aplicacion\Gestores\GestorPDF.vb:56
>> ExportarDatos_aspx.ExportarPDF() in
>> \\Mantelnorserv\Proyectos\Mantelnor\Bampimor\Expor tarDatos.aspx.vb:121
>> ExportarDatos_aspx.Page_Load(Object sender, EventArgs e) in
>> \\Mantelnorserv\Proyectos\Mantelnor\Bampimor\Expor tarDatos.aspx.vb:25
>> System.Web.UI.Control.OnLoad(EventArgs e) +87
>> System.Web.UI.Control.LoadRecursive() +55
>> System.Web.UI.Page.ProcessRequestMain(Boolean
>> includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
>> +6828
>> System.Web.UI.Page.ProcessRequest(Boolean
>> includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
>> +229
>> System.Web.UI.Page.ProcessRequest(HttpContext context) +34
>>
>> System.Web.CallHandlerExecutionStep.System.Web.Htt pApplication.IExecutionStep.Execute()
>> +305
>> System.Web.HttpApplication.ExecuteStep(IExecutionS tep step,
>> Boolean& completedSynchronously) +76
>>
>>
>>
>> --------------------------------------------------------------------------------
>> Version Information: Microsoft .NET Framework Version:2.0.40607.16;
>> ASP.NET Version:2.0.40607.16
>>
>> __
>> Regards,
>>
>> Diego F.
>>
>>
>> "Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> escribió en
>> el mensaje news:uV**************@tk2msftngp13.phx.gbl...
>>> This exception is thrown by the version 2.0 .NET Framework when an
>>> assembly that is not fully trusted calls attempts to call into a
>>> strongly named assembly that is not marked with
>>> AllowPartiallyTrustedCallersAttribute. (A far more obscure
>>> exception is thrown in the v. 1.x Framework.) This is meant to
>>> prevent certain kinds of attacks in which fully trusted code might
>>> be tricked into running potentially dangerous operations on behalf
>>> of code with more restricted permissions.
>>>
>>> Based on the error output you provided, it seems a little unlikely
>>> that the partially trusted assembly that is causing the problem is
>>> actually your web application. If this were the case, the exception
>>> should have been thrown for the first line of code in which any use
>>> of the assembly in which the type of your myPdfDocument object is
>>> declared. However, given that this is happening on a beta platform,
>>> there could very well be a problem in the exception details output.
>>> To rule out this possibility, might you be able to trap the
>>> exception so that its full details (including the call stack
>>> listing) could be captured via its ToString method?
>>>
>>>
>>>
>>> "Diego F." <di*******@terra.es> wrote in message
>>> news:OB**************@TK2MSFTNGP10.phx.gbl...
>>>> The complete error message:
>>>>
>>>> Security Exception
>>>> Description: The application attempted to perform an operation not
>>>> allowed by the security policy. To grant this application the
>>>> required permission please contact your system administrator or
>>>> change the application's trust level in the configuration file.
>>>>
>>>> Exception Details: System.Security.SecurityException: That assembly
>>>> does not allow partially trusted callers.
>>>>
>>>> Source Error:
>>>>
>>>>
>>>> Line 54: fichero))
>>>> Line 55: HttpContext.Current.Response.ContentType =
>>>> "application/pdf"
>>>> Line 56:
>>>> myPdfDocument.SaveToStream(HttpContext.Current.Res ponse.OutputStream)
>>>> Line 57: HttpContext.Current.Response.End()
>>>> Line 58:
>>>>
>>>>
>>>> Source File:
>>>> \\Mantelnorserv\Proyectos\Mantelnor\Bampimor\Code\ Aplicacion\Gestores\GestorPDF.vb
>>>> Line: 56
>>>>
>>>> --
>>>> Regards,
>>>>
>>>> Diego F.
>>>>
>>>>
>>>>
>>>> "Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> escribió
>>>> en el mensaje news:%2****************@TK2MSFTNGP10.phx.gbl...
>>>>> What is the exact exception you are seeing? (If possible, could
>>>>> you please provide the full output from the exception's ToString
>>>>> method?)
>>>>>
>>>>>
>>>>> "Diego F." <di*******@terra.es> wrote in message
>>>>> news:uM**************@TK2MSFTNGP12.phx.gbl...
>>>>>>I think I'll never come across that error. It happens when running
>>>>>>code from a DLL that tries to write to disk. I added permissions
>>>>>>in the project folder, the wwwroot and in IIS to NETWORK_SERVICE
>>>>>>and Everyone, with Full Control to see if it's a permissions
>>>>>>problem.
>>>>>>
>>>>>> The project is hosted in a Windows 2003 Server and developed from
>>>>>> PCs in a domain, developing with Visual Studio 2005 Beta 1.
>>>>>>
>>>>>> --
>>>>>> Regards,
>>>>>>
>>>>>> Diego F.
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>



Nov 19 '05 #16
"Diego F." <di*******@terra.es> wrote in message
news:O2**************@TK2MSFTNGP10.phx.gbl...
The project is in a server folder and I run from my computer, using the
VS2005 integrated web server
In the server I don't have neither VS nor SDK
Well, that's very likely the problem right there. The assemblies are being
loaded from the network, so they're most likely being assessed as falling in
the intranet zone. Under default CAS settings, the code group for the
intranet zone doesn't grant any FileIOPermission.

Anyway, and don't ask me why, it's working again. It happened a few
weeks ago; suddenly it started working. I put the strong-name, that's
the only change.
Did you perhaps also start using a local copy of the assembly?

Have you ever made any changes to the CAS policy on this machine, such as
adding a code group that grants full trust to assemblies signed with the
key you used to sign this assembly?


I tried changing that, but with the previous version of the framework
(beta 1) I had errors with my assemblies.
I can change it from my own computer but I suppose it doesn't affect the
global application.


The policy changes must be made on the machine on which the application is
running, not the one on which the assemblies happen to be stored. Since the
app is running on your dev machine, that's where the changes should be made.
Since the last time it was working, I just moved the code to other class
and the error reappeared. Now it's working, don't know how much time.


The exact same error or a similar error? (The relevant code in the Gios
library, which I'm guessing you didn't alter, so your change is unlikely
to have affected this particular problem point.)


The error always comes when trying to save to disk or send the file.


Probably due to a lack of FileIOPermission. Do you still see
SecurityException problems on file operations if you use local copies of the
application assemblies?

--
Regards,

Diego F.

"Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> escribió en el
mensaje news:eG**************@TK2MSFTNGP10.phx.gbl...
Strong naming it won't help. The problem is that it is partially
trusted, not that it doesn't have a strong name. Have you tried
verifying its permission grant using the instructions from
http://msdn.microsoft.com/library/en...corcfgmsc.asp?

"Diego F." <di*******@terra.es> wrote in message
news:OF**************@TK2MSFTNGP14.phx.gbl...
>I have the source of gios.dll. Should I strong name it? I tried it but
>I found no difference.
>
> --
> Regards,
>
> Diego F.
>
>
>
> "Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> escribió en
> el mensaje news:uB*************@TK2MSFTNGP12.phx.gbl...
>> The Gios.Pdf.Utility.Deflate method shown in the call stack is
>> calling into the ICSharpCode.SharpZipLib.dll library assembly, which
>> is strongly named. Given that the exception is being thrown, it would
>> appear that the Gios Pdf.NET.dll assembly is not fully trusted. If
>> you verify the permissions for the Gios library as described in the
>> "To evaluate an assembly" section at
>> http://msdn.microsoft.com/library/en...scorcfgmsc.asp,
>> does it appear to be granted unrestricted permissions (full trust)?
>> If not, can you tell why not based on its code group membership?
>>
>>
>>
>> "Diego F." <di*******@terra.es> wrote in message
>> news:OQ**************@tk2msftngp13.phx.gbl...
>>> Here is the stack info:
>>>
>>> Stack Trace:
>>>
>>> [SecurityException: That assembly does not allow partially trusted
>>> callers.]
>>>
>>> System.Security.CodeAccessSecurityEngine.ThrowSecu rityException(Assembly
>>> asm, PermissionSet granted, PermissionSet refused,
>>> RuntimeMethodHandle rmh, SecurityAction action, Object demand,
>>> IPermission permThatFailed) +130
>>> Gios.Pdf.Utility.Deflate(Byte[] b) in C:\Documents and
>>> Settings\MS006\Escritorio\diego\Gios Pdf.NET\Utility.cs:81
>>> Gios.Pdf.PdfTablePage.StreamWrite(Stream stream) in C:\Documents
>>> and Settings\MS006\Escritorio\diego\Gios Pdf.NET\Table
>>> Objects\PdfTablePage.cs:114
>>> Gios.Pdf.PdfDocument.SaveToStream(Stream m) in C:\Documents and
>>> Settings\MS006\Escritorio\diego\Gios Pdf.NET\PdfDocument.cs:237
>>> GestorPDF.GenerarPDF(String titulo, DataTable Table, String
>>> fichero) in
>>> \\Mantelnorserv\Proyectos\Mantelnor\Bampimor\Code\ Aplicacion\Gestores\GestorPDF.vb:56
>>> ExportarDatos_aspx.ExportarPDF() in
>>> \\Mantelnorserv\Proyectos\Mantelnor\Bampimor\Expor tarDatos.aspx.vb:121
>>> ExportarDatos_aspx.Page_Load(Object sender, EventArgs e) in
>>> \\Mantelnorserv\Proyectos\Mantelnor\Bampimor\Expor tarDatos.aspx.vb:25
>>> System.Web.UI.Control.OnLoad(EventArgs e) +87
>>> System.Web.UI.Control.LoadRecursive() +55
>>> System.Web.UI.Page.ProcessRequestMain(Boolean
>>> includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
>>> +6828
>>> System.Web.UI.Page.ProcessRequest(Boolean
>>> includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
>>> +229
>>> System.Web.UI.Page.ProcessRequest(HttpContext context) +34
>>>
>>> System.Web.CallHandlerExecutionStep.System.Web.Htt pApplication.IExecutionStep.Execute()
>>> +305
>>> System.Web.HttpApplication.ExecuteStep(IExecutionS tep step,
>>> Boolean& completedSynchronously) +76
>>>
>>>
>>>
>>> --------------------------------------------------------------------------------
>>> Version Information: Microsoft .NET Framework Version:2.0.40607.16;
>>> ASP.NET Version:2.0.40607.16
>>>
>>> __
>>> Regards,
>>>
>>> Diego F.
>>>
>>>
>>> "Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> escribió en
>>> el mensaje news:uV**************@tk2msftngp13.phx.gbl...
>>>> This exception is thrown by the version 2.0 .NET Framework when an
>>>> assembly that is not fully trusted calls attempts to call into a
>>>> strongly named assembly that is not marked with
>>>> AllowPartiallyTrustedCallersAttribute. (A far more obscure
>>>> exception is thrown in the v. 1.x Framework.) This is meant to
>>>> prevent certain kinds of attacks in which fully trusted code might
>>>> be tricked into running potentially dangerous operations on behalf
>>>> of code with more restricted permissions.
>>>>
>>>> Based on the error output you provided, it seems a little unlikely
>>>> that the partially trusted assembly that is causing the problem is
>>>> actually your web application. If this were the case, the
>>>> exception should have been thrown for the first line of code in
>>>> which any use of the assembly in which the type of your
>>>> myPdfDocument object is declared. However, given that this is
>>>> happening on a beta platform, there could very well be a problem in
>>>> the exception details output. To rule out this possibility, might
>>>> you be able to trap the exception so that its full details
>>>> (including the call stack listing) could be captured via its
>>>> ToString method?
>>>>
>>>>
>>>>
>>>> "Diego F." <di*******@terra.es> wrote in message
>>>> news:OB**************@TK2MSFTNGP10.phx.gbl...
>>>>> The complete error message:
>>>>>
>>>>> Security Exception
>>>>> Description: The application attempted to perform an operation not
>>>>> allowed by the security policy. To grant this application the
>>>>> required permission please contact your system administrator or
>>>>> change the application's trust level in the configuration file.
>>>>>
>>>>> Exception Details: System.Security.SecurityException: That
>>>>> assembly does not allow partially trusted callers.
>>>>>
>>>>> Source Error:
>>>>>
>>>>>
>>>>> Line 54: fichero))
>>>>> Line 55: HttpContext.Current.Response.ContentType =
>>>>> "application/pdf"
>>>>> Line 56:
>>>>> myPdfDocument.SaveToStream(HttpContext.Current.Res ponse.OutputStream)
>>>>> Line 57: HttpContext.Current.Response.End()
>>>>> Line 58:
>>>>>
>>>>>
>>>>> Source File:
>>>>> \\Mantelnorserv\Proyectos\Mantelnor\Bampimor\Code\ Aplicacion\Gestores\GestorPDF.vb
>>>>> Line: 56
>>>>>
>>>>> --
>>>>> Regards,
>>>>>
>>>>> Diego F.
>>>>>
>>>>>
>>>>>
>>>>> "Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> escribió
>>>>> en el mensaje news:%2****************@TK2MSFTNGP10.phx.gbl...
>>>>>> What is the exact exception you are seeing? (If possible, could
>>>>>> you please provide the full output from the exception's ToString
>>>>>> method?)
>>>>>>
>>>>>>
>>>>>> "Diego F." <di*******@terra.es> wrote in message
>>>>>> news:uM**************@TK2MSFTNGP12.phx.gbl...
>>>>>>>I think I'll never come across that error. It happens when
>>>>>>>running code from a DLL that tries to write to disk. I added
>>>>>>>permissions in the project folder, the wwwroot and in IIS to
>>>>>>>NETWORK_SERVICE and Everyone, with Full Control to see if it's a
>>>>>>>permissions problem.
>>>>>>>
>>>>>>> The project is hosted in a Windows 2003 Server and developed
>>>>>>> from PCs in a domain, developing with Visual Studio 2005 Beta 1.
>>>>>>>
>>>>>>> --
>>>>>>> Regards,
>>>>>>>
>>>>>>> Diego F.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>



Nov 19 '05 #17
"Diego F." <di*******@terra.es> wrote in message
news:uY**************@TK2MSFTNGP12.phx.gbl...
Wanna hear something funny? I use the library in two methods: one sends a
pdf file via http and the other saves it to disk. Now is the second that
doesn't work. I gave permissions to Everyone but it gives me the error.
What is the exact exception? If it's a SecurityException, then chances are
excellent that the problem is due to CAS permissions, not user permissions,
so no changs to the user permissions will help. You should probably revert
to more restrictive user permissions if you want to avoid unnecessary risk.

--
Regards,

Diego F.

"Diego F." <di*******@terra.es> escribió en el mensaje
news:OA**************@TK2MSFTNGP12.phx.gbl...
I can't run that tool in the server. I have installed framewrok 2.0 beta2
and don't know why but there is no .net tools.

Anyway, and don't ask me why, it's working again. It happened a few weeks
ago; suddenly it started working. I put the strong-name, that's the only
change. Since the last time it was working, I just moved the code to
other class and the error reappeared. Now it's working, don't know how
much time.

--
Regards,

Diego F.

"Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> escribió en el
mensaje news:eG**************@TK2MSFTNGP10.phx.gbl...
Strong naming it won't help. The problem is that it is partially
trusted, not that it doesn't have a strong name. Have you tried
verifying its permission grant using the instructions from
http://msdn.microsoft.com/library/en...corcfgmsc.asp?

"Diego F." <di*******@terra.es> wrote in message
news:OF**************@TK2MSFTNGP14.phx.gbl...
I have the source of gios.dll. Should I strong name it? I tried it but I
found no difference.

--
Regards,

Diego F.

"Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> escribió en el
mensaje news:uB*************@TK2MSFTNGP12.phx.gbl...
> The Gios.Pdf.Utility.Deflate method shown in the call stack is calling
> into the ICSharpCode.SharpZipLib.dll library assembly, which is
> strongly named. Given that the exception is being thrown, it would
> appear that the Gios Pdf.NET.dll assembly is not fully trusted. If
> you verify the permissions for the Gios library as described in the
> "To evaluate an assembly" section at
> http://msdn.microsoft.com/library/en...scorcfgmsc.asp,
> does it appear to be granted unrestricted permissions (full trust)?
> If not, can you tell why not based on its code group membership?
>
>
>
> "Diego F." <di*******@terra.es> wrote in message
> news:OQ**************@tk2msftngp13.phx.gbl...
>> Here is the stack info:
>>
>> Stack Trace:
>>
>> [SecurityException: That assembly does not allow partially trusted
>> callers.]
>>
>> System.Security.CodeAccessSecurityEngine.ThrowSecu rityException(Assembly
>> asm, PermissionSet granted, PermissionSet refused,
>> RuntimeMethodHandle rmh, SecurityAction action, Object demand,
>> IPermission permThatFailed) +130
>> Gios.Pdf.Utility.Deflate(Byte[] b) in C:\Documents and
>> Settings\MS006\Escritorio\diego\Gios Pdf.NET\Utility.cs:81
>> Gios.Pdf.PdfTablePage.StreamWrite(Stream stream) in C:\Documents
>> and Settings\MS006\Escritorio\diego\Gios Pdf.NET\Table
>> Objects\PdfTablePage.cs:114
>> Gios.Pdf.PdfDocument.SaveToStream(Stream m) in C:\Documents and
>> Settings\MS006\Escritorio\diego\Gios Pdf.NET\PdfDocument.cs:237
>> GestorPDF.GenerarPDF(String titulo, DataTable Table, String
>> fichero) in
>> \\Mantelnorserv\Proyectos\Mantelnor\Bampimor\Code\ Aplicacion\Gestores\GestorPDF.vb:56
>> ExportarDatos_aspx.ExportarPDF() in
>> \\Mantelnorserv\Proyectos\Mantelnor\Bampimor\Expor tarDatos.aspx.vb:121
>> ExportarDatos_aspx.Page_Load(Object sender, EventArgs e) in
>> \\Mantelnorserv\Proyectos\Mantelnor\Bampimor\Expor tarDatos.aspx.vb:25
>> System.Web.UI.Control.OnLoad(EventArgs e) +87
>> System.Web.UI.Control.LoadRecursive() +55
>> System.Web.UI.Page.ProcessRequestMain(Boolean
>> includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
>> +6828
>> System.Web.UI.Page.ProcessRequest(Boolean
>> includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
>> +229
>> System.Web.UI.Page.ProcessRequest(HttpContext context) +34
>>
>> System.Web.CallHandlerExecutionStep.System.Web.Htt pApplication.IExecutionStep.Execute()
>> +305
>> System.Web.HttpApplication.ExecuteStep(IExecutionS tep step,
>> Boolean& completedSynchronously) +76
>>
>>
>>
>> --------------------------------------------------------------------------------
>> Version Information: Microsoft .NET Framework Version:2.0.40607.16;
>> ASP.NET Version:2.0.40607.16
>>
>> __
>> Regards,
>>
>> Diego F.
>>
>>
>> "Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> escribió en
>> el mensaje news:uV**************@tk2msftngp13.phx.gbl...
>>> This exception is thrown by the version 2.0 .NET Framework when an
>>> assembly that is not fully trusted calls attempts to call into a
>>> strongly named assembly that is not marked with
>>> AllowPartiallyTrustedCallersAttribute. (A far more obscure
>>> exception is thrown in the v. 1.x Framework.) This is meant to
>>> prevent certain kinds of attacks in which fully trusted code might
>>> be tricked into running potentially dangerous operations on behalf
>>> of code with more restricted permissions.
>>>
>>> Based on the error output you provided, it seems a little unlikely
>>> that the partially trusted assembly that is causing the problem is
>>> actually your web application. If this were the case, the exception
>>> should have been thrown for the first line of code in which any use
>>> of the assembly in which the type of your myPdfDocument object is
>>> declared. However, given that this is happening on a beta platform,
>>> there could very well be a problem in the exception details output.
>>> To rule out this possibility, might you be able to trap the
>>> exception so that its full details (including the call stack
>>> listing) could be captured via its ToString method?
>>>
>>>
>>>
>>> "Diego F." <di*******@terra.es> wrote in message
>>> news:OB**************@TK2MSFTNGP10.phx.gbl...
>>>> The complete error message:
>>>>
>>>> Security Exception
>>>> Description: The application attempted to perform an operation not
>>>> allowed by the security policy. To grant this application the
>>>> required permission please contact your system administrator or
>>>> change the application's trust level in the configuration file.
>>>>
>>>> Exception Details: System.Security.SecurityException: That assembly
>>>> does not allow partially trusted callers.
>>>>
>>>> Source Error:
>>>>
>>>>
>>>> Line 54: fichero))
>>>> Line 55: HttpContext.Current.Response.ContentType =
>>>> "application/pdf"
>>>> Line 56:
>>>> myPdfDocument.SaveToStream(HttpContext.Current.Res ponse.OutputStream)
>>>> Line 57: HttpContext.Current.Response.End()
>>>> Line 58:
>>>>
>>>>
>>>> Source File:
>>>> \\Mantelnorserv\Proyectos\Mantelnor\Bampimor\Code\ Aplicacion\Gestores\GestorPDF.vb
>>>> Line: 56
>>>>
>>>> --
>>>> Regards,
>>>>
>>>> Diego F.
>>>>
>>>>
>>>>
>>>> "Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> escribió
>>>> en el mensaje news:%2****************@TK2MSFTNGP10.phx.gbl...
>>>>> What is the exact exception you are seeing? (If possible, could
>>>>> you please provide the full output from the exception's ToString
>>>>> method?)
>>>>>
>>>>>
>>>>> "Diego F." <di*******@terra.es> wrote in message
>>>>> news:uM**************@TK2MSFTNGP12.phx.gbl...
>>>>>>I think I'll never come across that error. It happens when running
>>>>>>code from a DLL that tries to write to disk. I added permissions
>>>>>>in the project folder, the wwwroot and in IIS to NETWORK_SERVICE
>>>>>>and Everyone, with Full Control to see if it's a permissions
>>>>>>problem.
>>>>>>
>>>>>> The project is hosted in a Windows 2003 Server and developed from
>>>>>> PCs in a domain, developing with Visual Studio 2005 Beta 1.
>>>>>>
>>>>>> --
>>>>>> Regards,
>>>>>>
>>>>>> Diego F.
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>



Nov 19 '05 #18
And now how can I change the CAS settings without the .NET Configuration
tools? Anyway I did that before and put full permissions to the intranet
zone.

--
Regards,

Diego F.

"Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> escribió en el
mensaje news:ec**************@TK2MSFTNGP10.phx.gbl...
"Diego F." <di*******@terra.es> wrote in message
news:uY**************@TK2MSFTNGP12.phx.gbl...
Wanna hear something funny? I use the library in two methods: one sends a
pdf file via http and the other saves it to disk. Now is the second that
doesn't work. I gave permissions to Everyone but it gives me the error.


What is the exact exception? If it's a SecurityException, then chances
are excellent that the problem is due to CAS permissions, not user
permissions, so no changs to the user permissions will help. You should
probably revert to more restrictive user permissions if you want to avoid
unnecessary risk.

--
Regards,

Diego F.

"Diego F." <di*******@terra.es> escribió en el mensaje
news:OA**************@TK2MSFTNGP12.phx.gbl...
I can't run that tool in the server. I have installed framewrok 2.0 beta2
and don't know why but there is no .net tools.

Anyway, and don't ask me why, it's working again. It happened a few
weeks ago; suddenly it started working. I put the strong-name, that's
the only change. Since the last time it was working, I just moved the
code to other class and the error reappeared. Now it's working, don't
know how much time.

--
Regards,

Diego F.

"Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> escribió en el
mensaje news:eG**************@TK2MSFTNGP10.phx.gbl...
Strong naming it won't help. The problem is that it is partially
trusted, not that it doesn't have a strong name. Have you tried
verifying its permission grant using the instructions from
http://msdn.microsoft.com/library/en...corcfgmsc.asp?

"Diego F." <di*******@terra.es> wrote in message
news:OF**************@TK2MSFTNGP14.phx.gbl...
>I have the source of gios.dll. Should I strong name it? I tried it but
>I found no difference.
>
> --
> Regards,
>
> Diego F.
>
>
>
> "Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> escribió en
> el mensaje news:uB*************@TK2MSFTNGP12.phx.gbl...
>> The Gios.Pdf.Utility.Deflate method shown in the call stack is
>> calling into the ICSharpCode.SharpZipLib.dll library assembly, which
>> is strongly named. Given that the exception is being thrown, it would
>> appear that the Gios Pdf.NET.dll assembly is not fully trusted. If
>> you verify the permissions for the Gios library as described in the
>> "To evaluate an assembly" section at
>> http://msdn.microsoft.com/library/en...scorcfgmsc.asp,
>> does it appear to be granted unrestricted permissions (full trust)?
>> If not, can you tell why not based on its code group membership?
>>
>>
>>
>> "Diego F." <di*******@terra.es> wrote in message
>> news:OQ**************@tk2msftngp13.phx.gbl...
>>> Here is the stack info:
>>>
>>> Stack Trace:
>>>
>>> [SecurityException: That assembly does not allow partially trusted
>>> callers.]
>>>
>>> System.Security.CodeAccessSecurityEngine.ThrowSecu rityException(Assembly
>>> asm, PermissionSet granted, PermissionSet refused,
>>> RuntimeMethodHandle rmh, SecurityAction action, Object demand,
>>> IPermission permThatFailed) +130
>>> Gios.Pdf.Utility.Deflate(Byte[] b) in C:\Documents and
>>> Settings\MS006\Escritorio\diego\Gios Pdf.NET\Utility.cs:81
>>> Gios.Pdf.PdfTablePage.StreamWrite(Stream stream) in C:\Documents
>>> and Settings\MS006\Escritorio\diego\Gios Pdf.NET\Table
>>> Objects\PdfTablePage.cs:114
>>> Gios.Pdf.PdfDocument.SaveToStream(Stream m) in C:\Documents and
>>> Settings\MS006\Escritorio\diego\Gios Pdf.NET\PdfDocument.cs:237
>>> GestorPDF.GenerarPDF(String titulo, DataTable Table, String
>>> fichero) in
>>> \\Mantelnorserv\Proyectos\Mantelnor\Bampimor\Code\ Aplicacion\Gestores\GestorPDF.vb:56
>>> ExportarDatos_aspx.ExportarPDF() in
>>> \\Mantelnorserv\Proyectos\Mantelnor\Bampimor\Expor tarDatos.aspx.vb:121
>>> ExportarDatos_aspx.Page_Load(Object sender, EventArgs e) in
>>> \\Mantelnorserv\Proyectos\Mantelnor\Bampimor\Expor tarDatos.aspx.vb:25
>>> System.Web.UI.Control.OnLoad(EventArgs e) +87
>>> System.Web.UI.Control.LoadRecursive() +55
>>> System.Web.UI.Page.ProcessRequestMain(Boolean
>>> includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
>>> +6828
>>> System.Web.UI.Page.ProcessRequest(Boolean
>>> includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
>>> +229
>>> System.Web.UI.Page.ProcessRequest(HttpContext context) +34
>>>
>>> System.Web.CallHandlerExecutionStep.System.Web.Htt pApplication.IExecutionStep.Execute()
>>> +305
>>> System.Web.HttpApplication.ExecuteStep(IExecutionS tep step,
>>> Boolean& completedSynchronously) +76
>>>
>>>
>>>
>>> --------------------------------------------------------------------------------
>>> Version Information: Microsoft .NET Framework Version:2.0.40607.16;
>>> ASP.NET Version:2.0.40607.16
>>>
>>> __
>>> Regards,
>>>
>>> Diego F.
>>>
>>>
>>> "Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> escribió en
>>> el mensaje news:uV**************@tk2msftngp13.phx.gbl...
>>>> This exception is thrown by the version 2.0 .NET Framework when an
>>>> assembly that is not fully trusted calls attempts to call into a
>>>> strongly named assembly that is not marked with
>>>> AllowPartiallyTrustedCallersAttribute. (A far more obscure
>>>> exception is thrown in the v. 1.x Framework.) This is meant to
>>>> prevent certain kinds of attacks in which fully trusted code might
>>>> be tricked into running potentially dangerous operations on behalf
>>>> of code with more restricted permissions.
>>>>
>>>> Based on the error output you provided, it seems a little unlikely
>>>> that the partially trusted assembly that is causing the problem is
>>>> actually your web application. If this were the case, the
>>>> exception should have been thrown for the first line of code in
>>>> which any use of the assembly in which the type of your
>>>> myPdfDocument object is declared. However, given that this is
>>>> happening on a beta platform, there could very well be a problem in
>>>> the exception details output. To rule out this possibility, might
>>>> you be able to trap the exception so that its full details
>>>> (including the call stack listing) could be captured via its
>>>> ToString method?
>>>>
>>>>
>>>>
>>>> "Diego F." <di*******@terra.es> wrote in message
>>>> news:OB**************@TK2MSFTNGP10.phx.gbl...
>>>>> The complete error message:
>>>>>
>>>>> Security Exception
>>>>> Description: The application attempted to perform an operation not
>>>>> allowed by the security policy. To grant this application the
>>>>> required permission please contact your system administrator or
>>>>> change the application's trust level in the configuration file.
>>>>>
>>>>> Exception Details: System.Security.SecurityException: That
>>>>> assembly does not allow partially trusted callers.
>>>>>
>>>>> Source Error:
>>>>>
>>>>>
>>>>> Line 54: fichero))
>>>>> Line 55: HttpContext.Current.Response.ContentType =
>>>>> "application/pdf"
>>>>> Line 56:
>>>>> myPdfDocument.SaveToStream(HttpContext.Current.Res ponse.OutputStream)
>>>>> Line 57: HttpContext.Current.Response.End()
>>>>> Line 58:
>>>>>
>>>>>
>>>>> Source File:
>>>>> \\Mantelnorserv\Proyectos\Mantelnor\Bampimor\Code\ Aplicacion\Gestores\GestorPDF.vb
>>>>> Line: 56
>>>>>
>>>>> --
>>>>> Regards,
>>>>>
>>>>> Diego F.
>>>>>
>>>>>
>>>>>
>>>>> "Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> escribió
>>>>> en el mensaje news:%2****************@TK2MSFTNGP10.phx.gbl...
>>>>>> What is the exact exception you are seeing? (If possible, could
>>>>>> you please provide the full output from the exception's ToString
>>>>>> method?)
>>>>>>
>>>>>>
>>>>>> "Diego F." <di*******@terra.es> wrote in message
>>>>>> news:uM**************@TK2MSFTNGP12.phx.gbl...
>>>>>>>I think I'll never come across that error. It happens when
>>>>>>>running code from a DLL that tries to write to disk. I added
>>>>>>>permissions in the project folder, the wwwroot and in IIS to
>>>>>>>NETWORK_SERVICE and Everyone, with Full Control to see if it's a
>>>>>>>permissions problem.
>>>>>>>
>>>>>>> The project is hosted in a Windows 2003 Server and developed
>>>>>>> from PCs in a domain, developing with Visual Studio 2005 Beta 1.
>>>>>>>
>>>>>>> --
>>>>>>> Regards,
>>>>>>>
>>>>>>> Diego F.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>



Nov 19 '05 #19
"Diego F." <di*******@terra.es> wrote in message
news:uQ**************@TK2MSFTNGP14.phx.gbl...
And now how can I change the CAS settings without the .NET Configuration
tools?
IIRC, beta 1 was one of the releases where the tools were installed even
though the start menu shortcut wasn't added. Have you tried running mmc.exe
from the command line then attempting to add the snap-in from within MMC?
If this doesn't work, you should still be able to use caspol.

Anyway I did that before and put full permissions to the intranet zone.
That might explain why it was working. <g>

--
Regards,

Diego F.

"Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> escribió en el
mensaje news:ec**************@TK2MSFTNGP10.phx.gbl...
"Diego F." <di*******@terra.es> wrote in message
news:uY**************@TK2MSFTNGP12.phx.gbl...
Wanna hear something funny? I use the library in two methods: one sends
a pdf file via http and the other saves it to disk. Now is the second
that doesn't work. I gave permissions to Everyone but it gives me the
error.


What is the exact exception? If it's a SecurityException, then chances
are excellent that the problem is due to CAS permissions, not user
permissions, so no changs to the user permissions will help. You should
probably revert to more restrictive user permissions if you want to avoid
unnecessary risk.

--
Regards,

Diego F.

"Diego F." <di*******@terra.es> escribió en el mensaje
news:OA**************@TK2MSFTNGP12.phx.gbl...
I can't run that tool in the server. I have installed framewrok 2.0
beta2 and don't know why but there is no .net tools.

Anyway, and don't ask me why, it's working again. It happened a few
weeks ago; suddenly it started working. I put the strong-name, that's
the only change. Since the last time it was working, I just moved the
code to other class and the error reappeared. Now it's working, don't
know how much time.

--
Regards,

Diego F.

"Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> escribió en el
mensaje news:eG**************@TK2MSFTNGP10.phx.gbl...
> Strong naming it won't help. The problem is that it is partially
> trusted, not that it doesn't have a strong name. Have you tried
> verifying its permission grant using the instructions from
> http://msdn.microsoft.com/library/en...corcfgmsc.asp?
>
>
>
> "Diego F." <di*******@terra.es> wrote in message
> news:OF**************@TK2MSFTNGP14.phx.gbl...
>>I have the source of gios.dll. Should I strong name it? I tried it but
>>I found no difference.
>>
>> --
>> Regards,
>>
>> Diego F.
>>
>>
>>
>> "Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> escribió en
>> el mensaje news:uB*************@TK2MSFTNGP12.phx.gbl...
>>> The Gios.Pdf.Utility.Deflate method shown in the call stack is
>>> calling into the ICSharpCode.SharpZipLib.dll library assembly, which
>>> is strongly named. Given that the exception is being thrown, it
>>> would appear that the Gios Pdf.NET.dll assembly is not fully
>>> trusted. If you verify the permissions for the Gios library as
>>> described in the "To evaluate an assembly" section at
>>> http://msdn.microsoft.com/library/en...scorcfgmsc.asp,
>>> does it appear to be granted unrestricted permissions (full trust)?
>>> If not, can you tell why not based on its code group membership?
>>>
>>>
>>>
>>> "Diego F." <di*******@terra.es> wrote in message
>>> news:OQ**************@tk2msftngp13.phx.gbl...
>>>> Here is the stack info:
>>>>
>>>> Stack Trace:
>>>>
>>>> [SecurityException: That assembly does not allow partially trusted
>>>> callers.]
>>>>
>>>> System.Security.CodeAccessSecurityEngine.ThrowSecu rityException(Assembly
>>>> asm, PermissionSet granted, PermissionSet refused,
>>>> RuntimeMethodHandle rmh, SecurityAction action, Object demand,
>>>> IPermission permThatFailed) +130
>>>> Gios.Pdf.Utility.Deflate(Byte[] b) in C:\Documents and
>>>> Settings\MS006\Escritorio\diego\Gios Pdf.NET\Utility.cs:81
>>>> Gios.Pdf.PdfTablePage.StreamWrite(Stream stream) in C:\Documents
>>>> and Settings\MS006\Escritorio\diego\Gios Pdf.NET\Table
>>>> Objects\PdfTablePage.cs:114
>>>> Gios.Pdf.PdfDocument.SaveToStream(Stream m) in C:\Documents and
>>>> Settings\MS006\Escritorio\diego\Gios Pdf.NET\PdfDocument.cs:237
>>>> GestorPDF.GenerarPDF(String titulo, DataTable Table, String
>>>> fichero) in
>>>> \\Mantelnorserv\Proyectos\Mantelnor\Bampimor\Code\ Aplicacion\Gestores\GestorPDF.vb:56
>>>> ExportarDatos_aspx.ExportarPDF() in
>>>> \\Mantelnorserv\Proyectos\Mantelnor\Bampimor\Expor tarDatos.aspx.vb:121
>>>> ExportarDatos_aspx.Page_Load(Object sender, EventArgs e) in
>>>> \\Mantelnorserv\Proyectos\Mantelnor\Bampimor\Expor tarDatos.aspx.vb:25
>>>> System.Web.UI.Control.OnLoad(EventArgs e) +87
>>>> System.Web.UI.Control.LoadRecursive() +55
>>>> System.Web.UI.Page.ProcessRequestMain(Boolean
>>>> includeStagesBeforeAsyncPoint, Boolean
>>>> includeStagesAfterAsyncPoint) +6828
>>>> System.Web.UI.Page.ProcessRequest(Boolean
>>>> includeStagesBeforeAsyncPoint, Boolean
>>>> includeStagesAfterAsyncPoint) +229
>>>> System.Web.UI.Page.ProcessRequest(HttpContext context) +34
>>>>
>>>> System.Web.CallHandlerExecutionStep.System.Web.Htt pApplication.IExecutionStep.Execute()
>>>> +305
>>>> System.Web.HttpApplication.ExecuteStep(IExecutionS tep step,
>>>> Boolean& completedSynchronously) +76
>>>>
>>>>
>>>>
>>>> --------------------------------------------------------------------------------
>>>> Version Information: Microsoft .NET Framework Version:2.0.40607.16;
>>>> ASP.NET Version:2.0.40607.16
>>>>
>>>> __
>>>> Regards,
>>>>
>>>> Diego F.
>>>>
>>>>
>>>> "Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> escribió
>>>> en el mensaje news:uV**************@tk2msftngp13.phx.gbl...
>>>>> This exception is thrown by the version 2.0 .NET Framework when an
>>>>> assembly that is not fully trusted calls attempts to call into a
>>>>> strongly named assembly that is not marked with
>>>>> AllowPartiallyTrustedCallersAttribute. (A far more obscure
>>>>> exception is thrown in the v. 1.x Framework.) This is meant to
>>>>> prevent certain kinds of attacks in which fully trusted code might
>>>>> be tricked into running potentially dangerous operations on behalf
>>>>> of code with more restricted permissions.
>>>>>
>>>>> Based on the error output you provided, it seems a little unlikely
>>>>> that the partially trusted assembly that is causing the problem is
>>>>> actually your web application. If this were the case, the
>>>>> exception should have been thrown for the first line of code in
>>>>> which any use of the assembly in which the type of your
>>>>> myPdfDocument object is declared. However, given that this is
>>>>> happening on a beta platform, there could very well be a problem
>>>>> in the exception details output. To rule out this possibility,
>>>>> might you be able to trap the exception so that its full details
>>>>> (including the call stack listing) could be captured via its
>>>>> ToString method?
>>>>>
>>>>>
>>>>>
>>>>> "Diego F." <di*******@terra.es> wrote in message
>>>>> news:OB**************@TK2MSFTNGP10.phx.gbl...
>>>>>> The complete error message:
>>>>>>
>>>>>> Security Exception
>>>>>> Description: The application attempted to perform an operation
>>>>>> not allowed by the security policy. To grant this application the
>>>>>> required permission please contact your system administrator or
>>>>>> change the application's trust level in the configuration file.
>>>>>>
>>>>>> Exception Details: System.Security.SecurityException: That
>>>>>> assembly does not allow partially trusted callers.
>>>>>>
>>>>>> Source Error:
>>>>>>
>>>>>>
>>>>>> Line 54: fichero))
>>>>>> Line 55: HttpContext.Current.Response.ContentType =
>>>>>> "application/pdf"
>>>>>> Line 56:
>>>>>> myPdfDocument.SaveToStream(HttpContext.Current.Res ponse.OutputStream)
>>>>>> Line 57: HttpContext.Current.Response.End()
>>>>>> Line 58:
>>>>>>
>>>>>>
>>>>>> Source File:
>>>>>> \\Mantelnorserv\Proyectos\Mantelnor\Bampimor\Code\ Aplicacion\Gestores\GestorPDF.vb
>>>>>> Line: 56
>>>>>>
>>>>>> --
>>>>>> Regards,
>>>>>>
>>>>>> Diego F.
>>>>>>
>>>>>>
>>>>>>
>>>>>> "Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> escribió
>>>>>> en el mensaje news:%2****************@TK2MSFTNGP10.phx.gbl...
>>>>>>> What is the exact exception you are seeing? (If possible, could
>>>>>>> you please provide the full output from the exception's ToString
>>>>>>> method?)
>>>>>>>
>>>>>>>
>>>>>>> "Diego F." <di*******@terra.es> wrote in message
>>>>>>> news:uM**************@TK2MSFTNGP12.phx.gbl...
>>>>>>>>I think I'll never come across that error. It happens when
>>>>>>>>running code from a DLL that tries to write to disk. I added
>>>>>>>>permissions in the project folder, the wwwroot and in IIS to
>>>>>>>>NETWORK_SERVICE and Everyone, with Full Control to see if it's a
>>>>>>>>permissions problem.
>>>>>>>>
>>>>>>>> The project is hosted in a Windows 2003 Server and developed
>>>>>>>> from PCs in a domain, developing with Visual Studio 2005 Beta
>>>>>>>> 1.
>>>>>>>>
>>>>>>>> --
>>>>>>>> Regards,
>>>>>>>>
>>>>>>>> Diego F.
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>



Nov 19 '05 #20

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: James B | last post by:
OMA (Outlook Mobile Access) under Exchange is giving me a System.Security.SecurityException error. From what I gather this is a problem with the security level under which the OMA application is...
0
by: James B | last post by:
OMA (Outlook Mobile Access) under Exchange is giving me a System.Security.SecurityException error. From what I gather this is a problem with the security level under which the OMA application is...
3
by: Chua Wen Ching | last post by:
Hi there, I had applied this security permissions in my class library based on fxcop standards. Before namespace: using System.Runtime.InteropServices; using System.Security.Permissions;
0
by: Carl Gilbert | last post by:
Hi I am trying to get an online gallery to work (www.ngallery.org). I have managed to get it all working on my local host but I can not get it to work on my web space. The site can be found...
5
by: CyberLotus | last post by:
Hi, I've created a web application and through this I want to import Excel data to database. Following is the code that I've written, ...
2
by: KaNos | last post by:
Hello world, I've made a webservice (c# v2) to install in a server IIS 6 on a Windows 2000 last SP. We can use the webservice in local, throw the pages wich present the methods, with a windows...
3
by: Mike | last post by:
Hi I have problem as folow: Caught Exception: System.Configuration.ConfigurationErrorsException: An error occurred loading a configuration file: Request for the permission of type...
8
by: =?Utf-8?B?TWFuanJlZSBHYXJn?= | last post by:
Hi, I created a web service and hosted it in Windows Services. It is working fine. Now I am trying to implement the X509 certificates for message layer security. But it is throwing the following...
5
by: Henry Stock | last post by:
I am trying to understand the following error: Any thing you can tell me about this is appreciated. Security Exception Description: The application attempted to perform an operation not allowed...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.