Lync 2010 Plugin - Silverlight WPF with elevated permissions

610 Views Asked by At

I'm developing a CWE (Conversation Extensibility Window) with WPF and Silverlight 4 on Visual Studio 2010, for Lync 2010.

My application reads a list of .xml from the root directory of the application and into a string array.

I've this code:

bool featureComplete = Application.Current.HasElevatedPermissions;
if (featureComplete)
{
    List<string> files = new List<string>(Directory.EnumerateFiles(textBox1.Text, "*.*"));
    mensajes.Content = files.Count;
}
else
{
    mensajes.Content = "no trust";
}

In the event handler of a button event. With any path (my documents, root, application, etc) the application says "no trust".

I change the properties on the build to Out-of-browser settings and also check "require elevated trust" but nothing happens.

I tried and tried looking for an answer on google and msdn but I could not find a solution. So there's a checklist or step list to make a trusted CWE on Lync2010 with silverlight? I forgot something?

Please remember: this is not a usual web application, its a lync 2010 app.

ALSO: I can do it with "debug mode" with special folders like this tutorial: http://www.silverlight.net/learn/graphics/file-and-local-data/local-file-access

and it works, but when I run it under lync 2010 it says "access denied" for that folder.

There is the code that works only on debug as an application, and not works like lync applet:

    List<string> picsinfolder = new List<string>();
    var pics = Directory.EnumerateFiles
        (Environment.GetFolderPath(Environment.SpecialFolder.MyPictures));
    foreach (var item in pics)
    {
        picsinfolder.Add(item);
    }
    listBox1.ItemsSource = picsinfolder;

Thanks a lot in advance.

PD: Work-arounds that fix the issue can be accepted as an answer PD2: No, signing the xap doesn't work.

1

There are 1 best solutions below

0
On BEST ANSWER

The work around I'm using and works is open an XML, reading, copy into Isolated Storage, read it again from there. Everytime I need to change the file, I read it and copy again on Isolated Storage