开发者

VB.NET: error BC30037, followed by error BC30627 and error BC30465

I'm getting these errors:

AnonymousPath\Anonymized.vb : error BC30037: Character is not valid.
AnonymousPath\Anonymized.vb(2) : error BC30627: 'Option' statements must precede any declarations or 'Imports' statements.
AnonymousPath\Anonymized.vb(4) : error BC30465: 'Imports' statements must precede any declarations.

I get as many error BC30465's as Imports

Here's the (anonymized) code the errors point to:

Option Strict On
Option Explicit On

Imports System.Data.Common
'More Imports

I tried cleaning the solution an building again and closing VS2010 and opening it again, and I still get this. I should mention that o开发者_JAVA百科ur solution has VB.NET projects, C# projects and C++/CLI /clr projects that act as wrapper for unmanaged C++ projects. We are slooowly migrating the VB.NET code to C#, that might be related to this issue. Any clues? This might have to do with a cyclic import or something.


My bad, there REALLY was a bogus character (a space) before the first Option keyword. I saw it with Notepad++, activating the 'view whitespace' option. My sight is not what is used to be, damn the PS2. I deleted it using Notepad++, reloaded it in Visual Studio, and away they went those errors.

However, VS2010 never showed me that space, so he must have a bug. I hope it's just VB.NET related...


Perhaps help you. Review your Framework versions in your solution or projects. In my case, I changed the Framework versions and resolved. For example, I changed Framework 4.5.1 by the Framework version 4.5. I haven't trouble now. Of course, this work I maked for WinForm type projects. I hope you can resolved quickly.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜