Jump to content



Photo

Error in COMMENTS?!


  • Please log in to reply
26 replies to this topic

#1 vetneufuse

neufuse

    Neowinian Senior

  • Tech Issues Solved: 1
  • Joined: 16-February 04

Posted 04 September 2014 - 12:32

What in the world is going on here... all the sudden my one VB.NET project has "newline in constant" and "Too many characters in character literal" errors on EVERY single one of my comment lines... just look at the attached screen snippet.... anyone ever see this before or know how to fix it? I'm pretty sure this is the compiler going nuts but not sure how to fix it... I already "repaired" .NET and Visual Studio and hasn't gone away yet

 

and this isn't an error with existing text... I can make a completely new code file, new class and the first comment line I type same error immediately shows up

Attached Images

  • error.png



#2 Hum

Hum

    totally wAcKed

  • Tech Issues Solved: 11
  • Joined: 05-October 03
  • Location: Odder Space
  • OS: Windows XP, 7

Posted 04 September 2014 - 12:35

Is that a space after apostrophe ' various germanic ... ?

 

'[space]various germanic

 

http://forums.asp.ne...aracter literal

 

"This is a common programming mistake. Special considerations must be taken to split a constant string over several lines."

 

http://support.microsoft.com/kb/40160



#3 duoi

duoi

    Resident Superhero

  • Joined: 17-February 14
  • OS: Elementary OS, Windows 8.1.1

Posted 04 September 2014 - 12:43

Hello, 

 

Please ensure you have closed any quotes and have escaped any backslashes. Also note correct use of quotation marks: single quotes for single characters, and double quotes for strings.

 

Regards,

Steven Johns



#4 ZakO

ZakO

    Neowinian

  • Tech Issues Solved: 2
  • Joined: 21-September 07
  • Location: Finland

Posted 04 September 2014 - 12:43

Assuming you don't have any unclosed quotes, it looks like your project might be importing C# targets instead of the VB ones. Open up the .vbproj file, check if it has:

 
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
 
rather than
 
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />


#5 OP vetneufuse

neufuse

    Neowinian Senior

  • Tech Issues Solved: 1
  • Joined: 16-February 04

Posted 04 September 2014 - 12:47

Hello, 

 

Please ensure you have closed any quotes and have escaped any backslashes. Also note correct use of quotation marks: single quotes for single characters, and double quotes for strings.

 

Regards,

Steven Johns

there are none, like I said I can make a completely new file and this happens the second I start a comment line, which never happened before until we switch anti-virus clients at work, after that its error city



#6 OP vetneufuse

neufuse

    Neowinian Senior

  • Tech Issues Solved: 1
  • Joined: 16-February 04

Posted 04 September 2014 - 12:53

 

Assuming you don't have any unclosed quotes, it looks like your project might be importing C# targets instead of the VB ones. Open up the .vbproj file, check if it has:

 
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
 
rather than
 
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

nope, the targets are correctly set in the project file...



#7 +Majesticmerc

Majesticmerc

    Resident Idealist

  • Tech Issues Solved: 8
  • Joined: 24-August 05
  • Location: United Kingdom
  • OS: Arch Linux / Win 7
  • Phone: HTC One X

Posted 04 September 2014 - 12:57

Does it happen with a brand new project?



#8 OP vetneufuse

neufuse

    Neowinian Senior

  • Tech Issues Solved: 1
  • Joined: 16-February 04

Posted 04 September 2014 - 13:11

Does it happen with a brand new project?

yes, anything, and it only started after we switch AV clients and it's only comments... everything else is fine



#9 FloatingFatMan

FloatingFatMan

    Resident Fat Dude

  • Tech Issues Solved: 1
  • Joined: 23-August 04
  • Location: UK

Posted 04 September 2014 - 14:08

What happens if you use a C# style comment?



#10 OP vetneufuse

neufuse

    Neowinian Senior

  • Tech Issues Solved: 1
  • Joined: 16-February 04

Posted 04 September 2014 - 14:10

syntax error on the comment



#11 OP vetneufuse

neufuse

    Neowinian Senior

  • Tech Issues Solved: 1
  • Joined: 16-February 04

Posted 04 September 2014 - 16:02

This error has gotten odder, it only occurs if I change the solution configuration to be a release build



#12 simplezz

simplezz

    Neowinian Senior

  • Tech Issues Solved: 8
  • Joined: 01-February 12

Posted 04 September 2014 - 16:08

Can't you just replace them with a C/C++ style comment?
/* */
//


#13 OP vetneufuse

neufuse

    Neowinian Senior

  • Tech Issues Solved: 1
  • Joined: 16-February 04

Posted 04 September 2014 - 16:49

Can't you just replace them with a C/C++ style comment?


/* */
//

 

no, because this is visual basic not C#



#14 Andre S.

Andre S.

    Asik

  • Tech Issues Solved: 14
  • Joined: 26-October 05

Posted 04 September 2014 - 16:59

If you remove the comments does the code compile or are there other errors?

If you open the project on another machine with Visual Studio do you get the same error?

Which version of Visual Studio is this?



#15 OP vetneufuse

neufuse

    Neowinian Senior

  • Tech Issues Solved: 1
  • Joined: 16-February 04

Posted 04 September 2014 - 17:10

If you remove the comments does the code compile or are there other errors?

If you open the project on another machine with Visual Studio do you get the same error?

Which version of Visual Studio is this?

yes it compiles if comments are all removed

 

this only happens on this one machine, but it's my main machine and a repair of .NET and VS didn't help at all... reinstall didn't help either... don't have the time to rebuild from the OS ground up

 

Visual Studio 2013 Premium