|
|
Rank: Newbie Groups: Member
Joined: 8/11/2009 Posts: 5 Location: canada
|
Hello, I use the RawPIPoint property, of the AFAttribute class, to get the pipoint name associated to an attribute. Here is a piece of code : /******************* in c#********************/ Code:AFAttribList = /**/
foreach (AFAttribute CurAttribute in AFAttribList) { if (CurAttribute.DataReference != null) { if (CurAttribute.RawPIPoint!=null) listPoints.Add(((PISDK.PIPoint)CurAttribute.RawPIPoint).Name); }
} When I use this code in a web application, I can retrieve all the pipoint names and my application works fine. But when I use the same code in a webpart, I get a null value for the RawPIPoint. I debuged the webpart and I have found this exception: {"Failed to load 'PI Point' Plug-In: Could not load file or assembly 'OSIsoft.AF.Asset.DataReference.PIPoint, Version=2.0.4.2025, Culture=neutral, PublicKeyToken=6238be57836698e6' or one of its dependencies. Failed to grant permission to execute. (Exception from HRESULT: 0x80131418)\n>> Execution permission cannot be acquired."} System.Exception {System.InvalidProgramException}
StackTrace " at OSIsoft.AF.AFPlugIn.CreateInstance() in d:\\Dev\\PIAF\\Foundation20\\SDK\\AFPlugIn.cs:line 764\r\n at OSIsoft.AF.AFPlugIn.CreateDataReferenceInstance(AFObject context, String configString) in d:\\Dev\\PIAF\\Foundation20\\SDK\\AFPlugIn.cs:line 338" stringAny help will be appreciated. Thank you
|
|
|
|
|
OSIsoft vCampus is a subscription-based, online offering that consists of providing everything people need to develop applications on the PI System. We invite you to take a "tour" of the OSIsoft Virtual Campus - also feel free to consult the FAQ or contact OSIsoft vCampus for more details.
|
|
|
Rank: Administration
 Groups: Administration
Joined: 6/20/2008 Posts: 612 Location: Cheshire, United Kingdom.
|
Hi Zedlik, Welcome to the forum. Is your web part strongly name? If not, give it a strong name and try again. Cheers, Rhys. Principal Consultant Real-Time Data Management @ Wipro Technologies
|
|
|
Rank: Newbie Groups: Member
Joined: 8/11/2009 Posts: 5 Location: canada
|
Hi Rhys,
Thank you for your response.
Yes my web part is strongly name.
Have you any other idea?
Thank you in advance.
|
|
|
Rank: Administration
 Groups: Administration
Joined: 6/20/2008 Posts: 612 Location: Cheshire, United Kingdom.
|
Where are you running your web part dll from? Bin folder or the GAC? If from Bin folder then you need a safe entry in web.config. If in the GAC your web part is implicitly trusted and should be fine. Something else to try for now. Principal Consultant Real-Time Data Management @ Wipro Technologies
|
|
|
Rank: Newbie Groups: Member
Joined: 8/11/2009 Posts: 5 Location: canada
|
I run my web in the GAC.
I verified the value of the DataReference object associated to an attribute and i get a no null value. BUT the RawPIPoint property has a NULL value!!
Have you any other idea?
Thank you in advance for your help.
|
|
|
Rank: Administration
 Groups: Administration
Joined: 6/20/2008 Posts: 612 Location: Cheshire, United Kingdom.
|
It is hard to debug without access to a machine where you get the same errors  The PI Point data reference uses the PISDK for access a PI Server and subsequently the PIPoints collection. So it sounds as though there is a CAS (Code Access Security) issue with PISDK and your webpart. Hmmmm...you may have to log a ticket with OSI tech support on this one, although it does seem like security issues rather than OSI dll specific. I bet if you try and create a new instance of the PISDKClass in your webpart you will get the same error. Principal Consultant Real-Time Data Management @ Wipro Technologies
|
|
|
Rank: Newbie Groups: Member
Joined: 8/11/2009 Posts: 5 Location: canada
|
The Code Access Security for OSISoft.PISDK.dll is Urestricted.
|
|
|
Rank: Administration
 Groups: Administration
Joined: 6/20/2008 Posts: 612 Location: Cheshire, United Kingdom.
|
In case anyone else has a similar problem, this was resolved by ensuring the "OSIsoft.AF.Asset.DataReference.PIPoint.dll" was in the GAC. Principal Consultant Real-Time Data Management @ Wipro Technologies
|
|
|
|
Guest
|