I have added some Custom Code in Reporting Service.
Reports - Report Properties - Code Tab - Custom Code
Here is my code.
public Function Please(d as DateTime, CultureFormat as String) as
String
dim returnvalue as String
Try
System.Threading.Thread.CurrentThread.CurrentCulture = new
System.Globalization.CultureInfo(CultureFormat)
dim ci as System.Globalization.CultureInfo
ci = new System.Globalization.CultureInfo(CultureFormat)
returnvalue = d.ToString("D",ci)
Catch ex As Exception
returnvalue = ex.ToString()
End Try
Return returnvalue
End Function
If I preview this report it works fine, but when I deploy this report,
I get this error message.
System.Security.SecurityException: Request for the permission of type
System.Security.Permissions.SecurityPermission, mscorlib,
Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089 failed.
at
System.Security.CodeAccessSecurityEngine.CheckTokenBasedSetHelper(Boolean
ignoreGrants,
TokenBasedSet grants, TokenBasedSet denied, TokenBasedSet demands)
at
System.Security.CodeAccessSecurityEngine.CheckSetHelper(PermissionSet
grants, PermissionSet
denied, PermissionSet demands)
at System.Threading.Thread.set_CurrentCulture(CultureInfo value)
at CustomCodeProxy.Please(DateTime d, String CultureFormat)
Has anyone run into this before?
Thanks, JonThe code security permission do not allow you to set the current threads
culture. Since you are passing the culture info into the ToString method
you should not need to do this so I would just remove this line of code:
System.Threading.Thread.CurrentThread.CurrentCulture = new
System.Globalization.CultureInfo(CultureFormat)
--
-Daniel
This posting is provided "AS IS" with no warranties, and confers no rights.
<jonknutsonhome@.yahoo.com> wrote in message
news:1126125095.372193.270750@.g14g2000cwa.googlegroups.com...
>I have added some Custom Code in Reporting Service.
> Reports - Report Properties - Code Tab - Custom Code
> Here is my code.
> public Function Please(d as DateTime, CultureFormat as String) as
> String
> dim returnvalue as String
> Try
> System.Threading.Thread.CurrentThread.CurrentCulture = new
> System.Globalization.CultureInfo(CultureFormat)
> dim ci as System.Globalization.CultureInfo
> ci = new System.Globalization.CultureInfo(CultureFormat)
> returnvalue = d.ToString("D",ci)
> Catch ex As Exception
> returnvalue = ex.ToString()
> End Try
> Return returnvalue
> End Function
>
> If I preview this report it works fine, but when I deploy this report,
> I get this error message.
>
> System.Security.SecurityException: Request for the permission of type
> System.Security.Permissions.SecurityPermission, mscorlib,
> Version=1.0.5000.0, Culture=neutral,
> PublicKeyToken=b77a5c561934e089 failed.
> at
> System.Security.CodeAccessSecurityEngine.CheckTokenBasedSetHelper(Boolean
> ignoreGrants,
> TokenBasedSet grants, TokenBasedSet denied, TokenBasedSet demands)
> at
> System.Security.CodeAccessSecurityEngine.CheckSetHelper(PermissionSet
> grants, PermissionSet
> denied, PermissionSet demands)
> at System.Threading.Thread.set_CurrentCulture(CultureInfo value)
> at CustomCodeProxy.Please(DateTime d, String CultureFormat)
> Has anyone run into this before?
> Thanks, Jon
>
Showing posts with label request. Show all posts
Showing posts with label request. Show all posts
Friday, March 9, 2012
Wednesday, March 7, 2012
Reporting service 400 bad request error
I have my reporting services installed on a Windows 2003 server. I have my Http://localhost/RepsortServer file directory opens fine.
However, I get this error when I try to access http://localhost/Reports.
Error
HELP
Any red X shows up when you open the configuration tool? Do you reportserver and reports vdirs live in the same application pool?
Try to recreate the report manager virtual directory using the configuration tool.
Subscribe to:
Posts (Atom)