---
title: "Visual Studio扩展编程问题集"
author: "rothmada"
date: "2012-09-20T17:13:15Z"
tags: []
categories: ["编程语言"]
slug: "visual-studio"
draft: false
lastmod: "2012-09-20T17:13:15Z"
id: 1682484
url: "https://rothmada.iteye.com/blog/1682484"
---

最近因为项目需要，想写一个插件来提高效率。

因为之前没有做过类似的，开始的时候就遇到一个问题：

1&gt;Connect.cpp(75): error C2882: 'System' : illegal use of namespace identifier in expression

1&gt;Connect.cpp(75): error C2228: left of '.Windows' must have class/struct/union

1&gt;Connect.cpp(75): error C2228: left of '.Forms' must have class/struct/union

1&gt;Connect.cpp(75): error C2228: left of '.MessageBox' must have class/struct/union

1&gt;Connect.cpp(75): error C2228: left of '.Show' must have class/struct/

其实这是个很基础的问题，但是也会有些初学者会遇到，在此做个记录。

解决方法：

1.添加应用：

![](http://dl.iteye.com/upload/attachment/0074/1072/756baeb7-1c86-317d-b7cc-b4b068d67402.png)  
 

2\.

将System.Windows.Forms.MessageBox.Show修改为System::Windows::Forms::MessageBox::Show