简体   繁体   English

Visual Studio 2012通过ClickOnce缺少文件夹和文件来部署WPF

[英]Visual Studio 2012 Deploying WPF via ClickOnce missing Folder and Files

I have a WPF project that I am ready to deploy using Visual Studio 2012 but I'm running into a missing folder issue. 我有一个WPF项目,我准备使用Visual Studio 2012进行部署,但我遇到了丢失的文件夹问题。

If I Start the project in VS it runs fine and my test button works as expected. 如果我在VS中启动项目它运行正常,我的测试按钮按预期工作。

When I Publish the project, the publish succeeds, running setup.exe installs successfully and program starts to main window fine. 当我发布项目时,发布成功,运行setup.exe安装成功,程序启动到主窗口正常。

Clicking the test button crashes the application. 单击测试按钮会使应用程序崩溃。

Line that causes crash: 导致崩溃的行:
string[] reportFileNames = System.IO.Directory.GetFiles("Reports");

"Could not find a part of the path 'C:\\Users\\dirt\\AppData\\Local\\Apps\\2.0\\GEDD6PQW.N72\\8M9ONPGG.TVB\\prof..tion_40c30‌​d08e677b188_0001.0000_9a5540d4bfbe5aff\\ Reports'. " “找不到路径的一部分'C:\\ Users \\ dirt \\ AppData \\ Local \\ Apps \\ 2.0 \\ GEDD6PQW.N72 \\ 8M9ONPGG.TVB \\ prof..tion_40c30 d08e677b188_0001.0000_9a5540d4bfbe5aff \\ Reports'。

Confirmed Exists: 确认存在:
C:\\MyProject\\bin\\MyMode\\Reports\\
C:\\MyProject\\bin\\MyMode\\Reports\\MyReport.rdlc

Confirmed Does Not Exist: C:\\Users\\dirt\\AppData\\Local\\Apps\\2.0\\GEDD6PQW.N72\\8M9ONPGG.TVB\\prof..tion_40c30‌​d08e677b188_0001.0000_9a5540d4bfbe5aff\\Reports\\ 确认不存在: C:\\Users\\dirt\\AppData\\Local\\Apps\\2.0\\GEDD6PQW.N72\\8M9ONPGG.TVB\\prof..tion_40c30‌​d08e677b188_0001.0000_9a5540d4bfbe5aff\\Reports\\

The Reports\\MyReport.rdlc files have a Build Action of Resource and Copy to Output Directory of Copy always . Reports \\ MyReport.rdlc文件Copy always具有Resource的构建操作和复制到复制的输出目录。

What am I missing? 我错过了什么?

Ok, was able to figure this one out rather quickly after typing that last sentence in the question... 好的,在输入问题中的最后一句后,能够很快找出这个...

In my case the Reports\\MyReport.rdlc file had a build action of Resource and all I had to do was change it to Content (and make sure Copy always is set). 在我的例子中, Reports\\MyReport.rdlc文件具有Resource的构建操作,我所要做的就是将其更改为Content (并确保Copy always设置Copy always )。

Solution: 解:

Right click File in Solution Explorer -> Properties -> Build Action -> Content 右键单击解决方案资源管理器中的文件 - >属性 - >构建操作 - >内容

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Visual Studio 2012通过ClickOnce缺少文件部署WPF - Visual Studio 2012 Deploying WPF via ClickOnce missing Files 在Visual Studio 2012中设置ClickOnce安装文件夹URL - Settting the ClickOnce installation folder URL in Visual Studio 2012 通过提供Visual Studio Solution的release文件夹来部署wpf应用程序 - Deploying a wpf application by giving the release folder of Visual Studio Solution 在Visual Studio 2012上缺少数据源 - missing datasources on visual studio 2012 在没有发布选项的情况下使用Visual Studio 2012部署C#wpf - Deploying a C# wpf with Visual Studio 2012 without its publishing option WPF应用程序Sqlserver CE在后端。部署exe在Visual Studio 2012中存在问题 - WPF application Sqlserver CE in backend.Deploying exe is issue in visual studio 2012 使用Visual Studio 2012进行部署时删除ConnectionString - Removing ConnectionString when deploying with Visual Studio 2012 管理员和ClickOnce C#Visual Studio 2008/2012 - Admin and ClickOnce C# Visual Studio 2008/2012 Visual Studio中缺少文件夹和文件。 甚至不在项目中显示 - Missing folder and files from visual studio. not even showing in Project 在Visual Studio 2012中使用SqlServer 2012 Databse部署Windowsform应用程序 - Deploying Windowsform application with SqlServer 2012 Databse in Visual Studio 2012
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM