推送至网站成功;网页未加载:不允许文件操作.拒绝访问路径“". [英] Pulish to Web site successful; web page does not load: File operation not permitted. Access to path '' is denied.

查看:93
本文介绍了推送至网站成功;网页未加载:不允许文件操作.拒绝访问路径“".的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图弄清楚该怎么做,就是创建一个文件并用Adobe PDF打开它.我有这个工作,但是我无法使分发页面正常工作.

What I am attempting to figure out how to do, is to create a file and have Adobe PDF open it.  I have this working, but I an unable to get the distribution page to function.

我已经通过Visual Studio成功地将签名和未签名的LightSwitch(LS)应用程序发布到我们的iis服务器.可以反复返回到分发网页(http://{server}/{app}/desktopclient)并进行更新/重新安装.全部 LS项目使用相同的MS SQL Server.

I have successfully publish signed and unsigned LightSwitch (LS) applications to our iis server via Visual Studio.  One can repeatedly return to the distribution web page (http://{server}/{app}/desktopclient) and update/reinstall.  All of the LS projects use the same MS SQL Server.

我可以将LS应用程序成功发布到iis服务器.但是,当我转到分发页面时,出现以下错误框:

I am able to publish my LS application to the iis server successfully.  But when I go to the distribution page I get the following error boxes:

  • 不允许进行文件操作. 
  • 对象引用未设置为对象的实例.
  • 值不属于预期范围. <-在关闭窗口后显示两次

我注意到,当我注释掉代码中的以下行,重新编译并发布后,就会出现分发网页.

I have noticed that when I comment out the following line in the code, recompile and publish, the distribution web page comes up.

tempFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "MyTempDocuments");

我尝试使用隔离存储,但是问题是应用程序无权访问在那里创建的任何文件.

I have tried using Isolated Storage, but the problem there is that an application does not have access to any file created there. 

除了购买插件来访问PDF之外,假设插件可以访问隔离存储,我还必须做些什么才能能够读取/写入/删除Adobe或MS Word可以的文件

Aside from purchasing a plug-in to access the PDF, assuming the plug-in can access Isolated Storage, what do I have to do to be able to read/write/delete a file that Adobe or MS Word can open and have the distribution web page work?

推荐答案

我不确定我是否理解问题是在创建pdf文件还是返回它发送给客户端,但这是我用来呈现供客户端下载的pdf文件的一种简单但不太优雅的方法.

I'm not sure I understand if the problem is creating the pdf file or returning it to the client, but here's what I've used as a simple, not very elegant, approach to presenting pdf files for client download.

在屏幕上添加命令按钮,并设置其代码以打开html页面. html页面具有指向pdf的链接,现在可以从服务器下载它.如果您要在服务器上创建pdf,则可以将必要的文件位置信息传递给 下载页面作为查询参数.

Add a command button to the screen and set it's code to open an html page. The html page has a link to the pdf, and now it can be downloaded from the server. If you're creating the pdf on the server, you could pass the necessary file location info to the download page as a query parameter.

这是命令按钮代码:

partial void OpenGeneralHelp_Execute()
{
  Dispatchers.Main.Invoke(() =>
  {
    Uri baseAddress = LightSwitchCommandProxy.GetBaseAddress();
    string url = string.Format("{0}{1}", baseAddress.AbsoluteUri, @"Help/GeneralHelp.html");
    LightSwitchCommandProxy.InvokeUrl(url);
  });
}


这篇关于推送至网站成功;网页未加载:不允许文件操作.拒绝访问路径“".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆