-2

我添加using Microsoft.VisualBasic到我的代码中,但编译器报告错误 CS0234:

命名空间“Microsoft.VisualBasic”中不存在类型或命名空间名称“FileSystem”(您是否缺少程序集引用?)

这个“程序集参考”是什么以及如何添加一个?

图片中也显示了错误 http://img16.imageshack.us/img16/6517/errorcup.jpg

4

1 回答 1

11

You've got a using directive for the Microsoft.VisualBasic namespace, but the fact that you're fully-qualifying the name Microsoft.VisualBasic.FileSystem makes that irrelevant.

I suspect you just haven't added a reference to the Microsoft.VisualBasic.dll assembly. (Assemblies and namespaces are very different things.)

Personally I would attempt to avoid VB-specific assemblies in the first place, to be honest.

于 2012-12-24T21:44:59.550 回答