简体   繁体   中英

.NET 4.5 namespace 'Standard'

In PresentationFramework from .NET 4.5 there is a namespace called Standard . Look here for more info: What is the namespace 'Standard'?

The problem is that in my C++/CLI project I am using an unmanaged library, which also defines a class called Standard . So I get the following compiler error:

error C2869: 'Standard' : has already been defined to be a namespace

I cannot remove the reference to PresentationFramework , and I cannot stop using the said library. Is there anything I can do? Like un-importing the namespace?

PS I am using VisualStudio 2012. I think that an upgrade to 2013 might help, but that will require the whole team to move to it.

That namespace was added to PresentationFramework by .NET 4.5, I believe, and I don't think changing to Visual Studio 2013 will help you. Everything in that namespace is defined as internal, and it mostly consists of Enums and Structs used with Windows SDK functions called by PresentationFramework.

Unfortunately, I have no idea what to do about your problem. Perhaps you can convince whoever supplies the third-party library to change their namespace. The fact that Microsoft is now using it would be a good reason for them to do so. Whoever these people are that are creating namespaces with a simple, generic name such as "Standard" need to have their heads examined.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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