今天总算逮着一个时间,把VS 2005 Express装上了。急匆匆上马,写个最简单的hello。
被C#2005 Express 撞了一下腰using System;
被C#2005 Express 撞了一下腰
using System.Collections.Generic;
被C#2005 Express 撞了一下腰
using System.Text;
被C#2005 Express 撞了一下腰
被C#2005 Express 撞了一下腰
namespace Console
}
懒得手动编译了,直接F5运行,出错!!!被C#2005 Express 撞了一下腰
编译看看出了什么问题:
 Error 1  The type or namespace name 'WriteLine' does not exist in the namespace 'Console' (are you missing an assembly reference?) C:\Documents and Settings\Administrator\Local Settings\Application Data\Temporary Projects\Console\Program.cs 15 20   
晕,怎么回事?被C#2005 Express 撞了一下腰改成
System.Console.WriteLine("Hello");
才勉强通过。

是bug还是C#2.0做了什么改动?或则我这出了什么问题?被C#2005 Express 撞了一下腰

modify:

将namespace修正,namespace HelloWorld还是不能通过编译。后来发现是因为我的工程的根namespace是Console的原因,不过这个现象我认为不应该出现,因为我的所有代码都没有使用Console着个namespace,也就是说最后生成的Assemble里边不会有Console这个namespace,这种情况下报错有点不应该。
明天到2003下看看。

补充:
2003中设置default namespace为Console不会影响编译
在CS2005Express中设置Root namespace为Console会影响到编译

相关文章:

  • 2021-12-16
  • 2022-12-23
  • 2021-12-27
  • 2022-12-23
  • 2021-09-09
  • 2021-05-18
  • 2021-08-26
  • 2022-01-07
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-30
  • 2021-11-09
  • 2021-10-08
相关资源
相似解决方案