编译ARM和发布模式时,类型或命名空间不存在 - UWP Windows 10

时间:2016-05-26 10:55:09

标签: c# win-universal-app uwp

这是非常令人沮丧的,因为我花了最后几种方法来加密/解密某些数据而无需使用salt密钥,并找到了Windows.Security.Cryptography.DataProtection很好,但没有它的问题,所以现在我的所有问题都已整理好,我决定将其编译为ARMRelease模式,但现在我得到了这个错误:

The type or namespace name 'Security' does not exist in the
namespace 'Windows' are you missing an assembly reference?

NamespaceDebug模式,第二个Release被突出显示为有问题:

using Windows.Security.Cryptography;
using Windows.Security.Cryptography.DataProtection;
using Windows.Storage.Streams;

这显然是一个主要问题,因为现在我无法发布我的应用程序!

任何人都有任何想法?

感谢。

UPDATE-1:

实际上,它似乎与ARM无关,因为我只是尝试了x86x64,问题仍然存在!

UPDATE-2:

我不明白的是,我目前正在查看名为EnterpriseDataProtection的Microsoft示例,这在Release模式下编译得很好,我可以看到以下{{1} }:

Namespace

并且它们不会突出显示为有问题且应用编译得很好!

我刚发现奇怪的事情。当我从我的项目中检查2扩展名(Mobile& Desktop)的引用时,它们列出如下:

using Windows.Storage.Streams;
using Windows.Security.EnterpriseData;
using Windows.Security.Cryptography;

但在Windows Desktop Extensions for the UWP Windows Mobile Extensions for the UWP 解决方案中,它们列为:

EnterpriseDataProtection

为什么不同的名字?

Microsoft Desktop Extension SDK for Universal App Platform Microsoft Mobile Extension SDK for Universal App Platform 解决方案中获取Desktop一个,它提供以下信息:

EnterpriseDataProtection

当我检查项目中的(Name): Microsoft Desktop Extension SDK for Universal App Platform File Type: SDK Identity: WindowsDesktop, Version=10.0.10240.0 Path: C:\Program Files (x86)\Windows Kits\10\Extension SDKs\WindowsDesktop\10.0.10240.0\ Resolved: True Version: 10.0.10240.0 时,它有以下信息:

Desktop

位置看起来是相同的,所以你认为我应该没事,但为什么不同的名字?

不知道上述内容是否有用,但我想我已经提到了。

UPDATE-3:

这一刻变得越来越荒谬!我刚刚删除了这两个扩展程序(移动和桌面),我从我的解决方案中删除了一个测试(Name): Windows Mobile Extensions for the UWP File Type: SDK Identity: WindowsDesktop, Version=10.0.10240.0 Path: C:\Program Files (x86)\Windows Kits\10\Extension SDKs\WindowsDesktop\10.0.10240.0\ Resolved: True Version: 10.0.10240.0 应用程序,因为我注意到它也使用了这个并抛出相同的错误,因为我没有需要它,我把它删除了!

我尝试编译并且有效!所以我继续并重新添加了2个扩展,以检查它们是否是问题的原因,但现在我收到了一个全新的错误:

Console

我再次删除了扩展程序,现在应用程序再次正常编译!

发生什么事了?最重要的是它现在正在编译。

我刚刚将我的控制台应用程序重新添加到我的解决方案中,并且错误又回来了,现在我在注意它来自An assembly with the same simple name 'Windows.Graphics.Printing3D.Printing3DContract' has already been imported. Try removing one of the references (e.g. 'C:\Program Files (x86)\Windows Kits\10\References\Windows.Graphics.Printing3D.Printing3DContract\1.0.0.0 \Windows.Graphics.Printing3D.Printing3DContract.winmd') or sign them to enable side-by-side. 应用程序的Project列时才注意到而不是我的Console应用。不幸的是,我在两个应用程序中使用相同的类名,并没有注意实际的项目!

我只能道歉并希望我没有让你浪费太多时间在这上面!

另一方面,但对我来说并不重要,这就是为什么在UWP模式下Windows.Security应用程序Console失败的原因。

再次,抱歉,感谢您抽出宝贵时间提供帮助!

0 个答案:

没有答案