YetAnotherForum
Welcome Guest Search | Active Topics | Log In | Register

Failed to load 'PI Point' Plug-In Options · View
zedlik
#1 Posted : Tuesday, August 11, 2009 5:12:12 PM
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" string



Any help will be appreciated.

Thank you


Sponsor  
 

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.
RJK Solutions
#2 Posted : Tuesday, August 11, 2009 7:00:23 PM
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
zedlik
#3 Posted : Tuesday, August 11, 2009 9:10:21 PM
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.
RJK Solutions
#4 Posted : Wednesday, August 12, 2009 8:08:20 AM
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
zedlik
#5 Posted : Wednesday, August 12, 2009 4:04:32 PM
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.
RJK Solutions
#6 Posted : Wednesday, August 12, 2009 7:56:01 PM
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 Smile

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
zedlik
#7 Posted : Tuesday, September 01, 2009 9:20:15 PM
Rank: Newbie
Groups: Member

Joined: 8/11/2009
Posts: 5
Location: canada
The Code Access Security for OSISoft.PISDK.dll is Urestricted.
RJK Solutions
#8 Posted : Friday, September 04, 2009 3:49:40 PM
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
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.