简体   繁体   English

UWP 应用发行版不包含资产

[英]Release version of UWP app does not contain assets

the application i am working on runs absolutely fine in Debug mode in Visual Studio.我正在处理的应用程序在 Visual Studio 的调试模式下运行得非常好。 But as soon as i tried to open the Release version it crashes at the point where it needs resources (the icon pictures that are generated in VS are fine but everything else).但是,一旦我尝试打开 Release 版本,它就会在需要资源的地方崩溃(在 VS 中生成的图标图片很好,但其他一切都很好)。 For example: At one point i need to read in from an .csv document.例如:有一次我需要从 .csv 文档中读入。 Through painstakingly commenting out the parts where i do this i have found out that it crashes because it does not find the assets.通过煞费苦心地注释掉我这样做的部分,我发现它崩溃了,因为它没有找到资产。

I have my Assets in the \\APPNAME\\APPNAME\\Assets, \\APPNAME\\APPNAME\\bin\\x86\\Debug\\AppX\\Assets, \\APPNAME\\APPNAME\\bin\\x86\\Release\\AppX\\Assets我在 \\APPNAME\\APPNAME\\Assets、\\APPNAME\\APPNAME\\bin\\x86\\Debug\\AppX\\Assets、\\APPNAME\\APPNAME\\bin\\x86\\Release\\AppX\\Assets 中有我的资产

And when i say Release version i mean the proper release thingy.当我说发布版本时,我的意思是正确的发布版本。 Because it runs just fine in release mode when it is run via Visual Studio.因为当它通过 Visual Studio 运行时,它在发布模式下运行得很好。

I get my assets always with this code :我总是用这个代码获得我的资产:

string path = "\\Assets\\DOCUMENTNAME.FILETYPE";

string localPath = Directory.GetCurrentDirectory() + path;

string[] lines = File.ReadAllLines(localPath);

is that wrong?错了吗? Or is ther something within Visual Studio that i need to configure so that it gets the assets into the release version?或者我需要配置 Visual Studio 中的某些内容,以便将资产放入发布版本?

Thank you for your answers in advance.提前感谢您的回答。

事实证明,我没有将资产复制到所有需要的位置。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM