Click here to Skip to main content
15,888,116 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
Hello guys,

There is a problem that I added a few AspxGauges to my project. I set the customize Gauge control and save them out as XML. The page load is below:

C#
protected void Page_Load(object sender, EventArgs e)
{
                this.gauges_yil.RestoreLayoutFromXml(MapPath("~/aspx/gauges_yil.xml"));
                this.gauges_m2.RestoreLayoutFromXml(MapPath("~/aspx/gauges_m2.xml"));
                this.gauges_kasa.RestoreLayoutFromXml(MapPath("~/aspx/gauges_kasa.xml"));
                this.ASPxGaugeControl4.RestoreLayoutFromXml(MapPath("~/aspx/ASPxGaugeControl4.xml"));
                this.ASPxGaugeControl5.RestoreLayoutFromXml(MapPath("~/aspx/ASPxGaugeControl5.xml"));
                this.ASPxGaugeControl6.RestoreLayoutFromXml(MapPath("~/aspx/ASPxGaugeControl6.xml"));
                
}


However, I got this error after I sent it to the server:


C#
Server Error in '/' Application.
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: Request failed.
 
Source Error:
 
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
 
Stack Trace:
 
[SecurityException: Request failed.]
DevExpress.XtraGauges.Core.Resources.PointF2DConverter.ConvertTo(ITypeDescriptorContext context, CultureInfo culture, Object value, Type destinationType) +0
System.Web.Compilation.CodeDomUtility.GenerateExpressionForValue(PropertyInfo propertyInfo, Object value, Type valueType) +587
System.Web.UI.SimplePropertyEntry.GetCodeStatement(BaseTemplateCodeDomTreeGenerator generator, CodeExpression ctrlRefExpr) +136


If somebody can help me, pls let me know...

Regards

Haluk
Posted
Updated 30-May-12 21:32pm
v2
Comments
Ed Nutting 31-May-12 3:54am    
Looks like your Sys Admin is the one to help you. As the error says, it's a permissions issue. So talk (or email or communicate in some way) with your server admin and ask for the required permissions to use the ASPxGauge control. If you are the server admin, look up in Google how to give yourself the required permissions. I don't see that this is really an issue with your code.

Hope this helps,
Ed
haluk_78 31-May-12 4:50am    
Hello Ed,

We have already called the server admin to ask whether they could change the security level because it was the highest one. They said yes...but then if the security level is low and that would be problem for our project and we could be able to lose all of our codes of the project.

I just wanted to know whether there is any another way for that...

<dx:ASPxGaugeControl ID="gauges_yil" runat="server" Height="55px"
Width="150px" AutoLayout="False" BackColor="Maroon" Value="00,000">
<gauges>
<dx:digitalgauge appearanceoff-contentbrush="<BrushObject Type="Solid" Data="Color:#00FFFFFF"/>"
="" appearanceon-contentbrush="<BrushObject Type="Solid" Data="Color:WhiteSmoke"/>" bounds="0, 0, 144, 48" digitcount="5" name="gauges_yil" padding="20, 20, 20, 20" text="00,000">
<backgroundlayers>
<dx:digitalbackgroundlayercomponent bottomright="259.8125, 99.9625"
="" name="digitalBackgroundLayerComponent7" shapetype="Style7" topleft="20, 0" zorder="1000">



<layoutpadding all="0" left="0" top="0" right="0" bottom="0">

Error looks self explanatory: 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.

Looks like you don't have permission to save file on server.
See if this helps: FIX: How to resolve Security Exception (ASP.NET)?[^]


Additional few links on how to handle security at higher levels:
MSDN: ASP.NET Trust Levels and Policy Files[^]
MSDN: How To: Use Code Access Security Policy to Constrain an Assembly[^]
 
Share this answer
 
Thanks Sandeep Mewara... I'll try to figure out about it...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900