wpurrer

Security Exception & Webapp

Discussion created by wpurrer on Mar 26, 2012
Latest reply on Mar 28, 2012 by wpurrer

Dear Vcampus - colleagues

 

I'm trying to develop a small web application which write event frames (attribute data)

 

Windows 2008 R2 Server, VS 2010, .net 4.0

 

In Visual Studio the application works fine, as soon as I copy it to the IIS I get the following 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: Cannot write data for Attribute 'Reason' in Event Frame 'Downtime Line3' because the current user does not have WriteData permission.

 

[SecurityException: Cannot write data for Attribute 'Reason' in Event Frame 'Bla Bla Bla' because the current user does not have WriteData permission.]
   OSIsoft.AF.AFObject.CheckWriteDataPermission() in c:\Builds\AF\AF 2.4\Sources\SDK\AFObject.cs:1939
   OSIsoft.AF.Asset.AFAttribute.SetValueInternal(AFCase caseContext, AFValue newValue, AFQueuedSetValues queuedValues, Boolean checkQueryDate) in c:\Builds\AF\AF 2.4\Sources\SDK\Asset\AFAttribute.Value.cs:890
   OSIsoft.AF.Asset.AFAttribute.SetValue(AFValue newValue) in c:\Builds\AF\AF 2.4\Sources\SDK\Asset\AFAttribute.Value.cs:883
   DowntimeDeliveryChannel.EventInterface.SetData(String NotGuid, Dictionary`2 vals) in C:\Users\lagpuw\Desktop\SVN_DTDC\DowntimeDeliveryChannel\EventInterface.cs:234
   _Default.Submit_Click(Object sender, EventArgs e) in c:\Users\lagpuw\Desktop\SVN_DTDC\Website\Default.aspx.cs:73
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +154
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +11439090
   System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +11438606
   System.Web.UI.Page.ProcessRequest() +269
   System.Web.UI.Page.ProcessRequest(HttpContext context) +167
   ASP.default_aspx.ProcessRequest(HttpContext context) in c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\downtime\a72c14d6\3a27ef04\App_Web_034tanrr.0.cs:0
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +625
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +270

 

=======================

 

I googled the error messages, their where a few suggestion about the .net Trust Levels.

 

But this Trust Level is already set to "Full (internal)" in the iis configuration. (or in the web.config => <trust level="Full" />)

 

 

Outcomes