Lync 2010 插件 - 具有提升权限的 Silverlight WPF
我正在 Visual Studio 2010 上使用 WPF 和 Silverlight 4 为 Lync 2010 开发 CWE(对话扩展性窗口)。
我的应用程序从应用程序的根目录读取 .xml 列表并将其放入字符串数组中。
我有这段代码:
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";
}
在按钮事件的事件处理程序中。对于任何路径(我的文档、根、应用程序等),应用程序都会说“不信任”。
我将构建上的属性更改为浏览器外设置,并检查“需要提升的信任”,但没有任何反应。
我尝试在 google 和 msdn 上寻找答案,但找不到解决方案。 那么有一个清单或步骤列表可以在 Lync2010 上使用 silverlight 创建可信的 CWE 吗?我忘记了什么?
请记住:这不是通常的 Web 应用程序,而是 lync 2010 应用程序。
ALSO:我可以使用特殊文件夹的“调试模式”来完成此操作,例如本教程:http://www.silverlight.net/learn/graphics/file-and-local-data/local-file-access
它可以工作,但是当我在 lync 下运行它时2010 它说该文件夹“访问被拒绝”。
有些代码只能作为应用程序进行调试,而不能像 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;
提前非常感谢。
PD:解决问题的解决方法可以被接受作为答案 PD2:不,签署 xap 不起作用。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我正在使用和工作的解决方法是打开 XML,读取,复制到独立存储中,然后从那里再次读取。每次我需要更改文件时,我都会读取它并在独立存储上再次复制
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