创建一个在提交 bug 报告时可以使用的文件。Creates a file that you can use when you file a bug report.




术语Term 定义Definition
file 必需。Required. 将包含 bug 报告的文件的名称。The name of the file that will contain your bug report. 如果文件名包含空格,则将它括在引号 (" ") 内。Enclose the file name in quotation marks (" ") if the name contains a space.


将以下信息添加到 fileThe following information is added to file:

  • 编译期间所有源代码文件的副本。A copy of all source-code files in the compilation.

  • 编译中使用的编译器选项列表。A list of the compiler options used in the compilation.

  • 有关编译器、公共语言运行时和操作系统的版本信息。Version information about your compiler, common language runtime, and operating system.

  • 编译器输出(如有)。Compiler output, if any.

  • 问题的说明(系统会提示你提供此信息)。A description of the problem, for which you are prompted.

  • 有关你认为应如何修复问题的说明(系统会提示你提供此信息)。A description of how you think the problem should be fixed, for which you are prompted.

所有源代码文件的副本将添加到 file 中,因此你可能需要在尽可能短小的程序中重现(可疑)代码缺陷。Because a copy of all source-code files is included in file, you may want to reproduce the (suspected) code defect in the shortest possible program.


-bugreport 选项将生成一个包含潜在敏感信息的文件。The -bugreport option produces a file that contains potentially sensitive information. 其中包括当前时间、编译器版本、.NET Framework 版本、OS 版本、用户名、运行编译器时所用的命令行参数、所有源代码和任何引用程序集的二进制文件形式。This includes current time, compiler version, .NET Framework version, OS version, user name, the command-line arguments with which the compiler was run, all source code, and the binary form of any referenced assembly. 通过在 Web.config 文件中为 ASP.NET 应用程序的服务器端编译指定命令行选项,可以访问此选项。This option can be accessed by specifying command-line options in the Web.config file for a server-side compilation of an ASP.NET application. 为了防止出现这种情况,请修改 Machine.config 文件,禁止用户在服务器上进行编译。To prevent this, modify the Machine.config file to disallow users from compiling on the server.

如果将此选项与 -errorreport:prompt-errorreport:queue-errorreport:send 一起使用,并且应用程序遇到内部编译器错误,则 file 中的信息将被发送到 Microsoft Corporation。If this option is used with -errorreport:prompt, -errorreport:queue, or -errorreport:send, and your application encounters an internal compiler error, the information in file is sent to Microsoft Corporation. 该信息将帮助 Microsoft 工程师确认出现错误的原因,并可能会帮助改进 Visual Basic 的下一个版本。That information will help Microsoft engineers identify the cause of the error and may help improve the next release of Visual Basic. 默认情况下,不会向 Microsoft 发送任何信息。By default, no information is sent to Microsoft. 但是,当你使用 -errorreport:queue(默认情况下已启用)编译应用程序时,应用程序将收集其错误报告。However, when you compile an application by using -errorreport:queue, which is enabled by default, the application collects its error reports. 然后,当计算机管理员登录时,错误报告系统会显示一个弹出窗口,使管理员能够将自登录后发生的任何错误报告转发给 Microsoft。Then, when the computer's administrator logs in, the error reporting system displays a pop-up window that enables the administrator to forward to Microsoft any error reports that occurred since the logon.


-bugreport 选项在 Visual Studio 开发环境内无法使用;仅当从命令行编译时才可用。The -bugreport option is not available from within the Visual Studio development environment; it is available only when you compile from the command line.


下面的示例将编译 T2.vb ,并将所有 bug 报告信息放在“Problem.txt”文件 中。The following example compiles T2.vb and puts all bug-reporting information in the file Problem.txt.

vbc -bugreport:problem.txt t2.vb

请参阅See also