Compiler errors VS2012中错误的错误C2039,带有C++/CLI
我有一个使用C++/CLI的项目。然后我有一个事件处理程序,如下所示:Compiler errors VS2012中错误的错误C2039,带有C++/CLI,compiler-errors,visual-studio-2012,c++-cli,Compiler Errors,Visual Studio 2012,C++ Cli,我有一个使用C++/CLI的项目。然后我有一个事件处理程序,如下所示: void NotificationSystemEventHandler::NotificationServiceDetailViewRequested(System::Object^ sender, Notifications::NotificationViewer::DetailViewOpenRequestedEventArgs^ e) { try { switch (e->Type
void NotificationSystemEventHandler::NotificationServiceDetailViewRequested(System::Object^ sender, Notifications::NotificationViewer::DetailViewOpenRequestedEventArgs^ e)
{
try
{
switch (e->Type->ID)
{
(...)
类DetailViewOpenRequestedEventArgs
有一个名为Type
的属性,其类型为DomainModel::CMN::NotificationType^
然后,NotificationType
类有一个名为int类型ID的属性。当我访问该属性时,我会得到一个C2039,表示ID不是NotificationType
的成员,而我可以在对象浏览器上看到该属性
唯一奇怪的是,Intellisense在尝试查找类型时出错,并表示该类型没有成员,但编译器似乎仍然可以正确解析该类型,但不能解析其成员
我在其他几个地方使用这个课程。如有需要,我可以提供更多信息/图片,以帮助澄清问题
以下是该问题的图像:
错误消息:
对象浏览器:
错误的弹出窗口:
删除所有引用并将其再次添加到项目中解决了问题 属性ID只是一个int。项目上的引用似乎有问题。“引用”对话框显示添加的一些引用(选中复选框),但它们不显示在解决方案资源管理器上项目的“引用”项中。。。。奇怪的