• 0

Error in COMMENTS?!


Question

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

post-47883-0-88516300-1409833934.png

Link to comment
Share on other sites

Recommended Posts

  • 0

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

 

'[space]various germanic

 

http://forums.asp.net/t/963248.aspx?Error+Too+many+characters+in+character+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

Link to comment
Share on other sites

  • 0

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

Link to comment
Share on other sites

  • 0

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" />
Link to comment
Share on other sites

  • 0

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

Link to comment
Share on other sites

  • 0

 

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...

Link to comment
Share on other sites

  • 0

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?

Link to comment
Share on other sites

  • 0

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

Link to comment
Share on other sites

  • 0

If the exact same project opens fine on another installation of Visual Studio then it's obviously a problem with your installation of Visual Studio, however it's not clear from your answer that you tried opening the project that gives you errors on your machine on another machine.

Link to comment
Share on other sites

  • 0

If the exact same project opens fine on another installation of Visual Studio then it's obviously a problem with your installation of Visual Studio, however it's not clear from your answer that you tried opening the project that gives you errors on your machine on another machine.

Like I said in the comment before yours, it only happens on one machine. I can make any number of projects on that machine and get compiler errors the second I add comments, open those same projects on another machine they are fine...

 

I've completely reinstalled .NET and still get the compiler errors... even if you try to do a manual MSBUILD via command line it errors out on that machine

Link to comment
Share on other sites

  • 0

Can you upload the class and project files? That might help, as would mentioning which AV you changed to.

If this is happening only on one machine with the exact same code there's obviously something going on with that machine. :)

Link to comment
Share on other sites

  • 0

Like I said in the comment before yours, it only happens on one machine. I can make any number of projects on that machine and get compiler errors the second I add comments, open those same projects on another machine they are fine...

 

I've completely reinstalled .NET and still get the compiler errors... even if you try to do a manual MSBUILD via command line it errors out on that machine

 

Perhaps try reinstalling or repairing Visual Studio itself instead

Link to comment
Share on other sites

  • 0

Perhaps try reinstalling or repairing Visual Studio itself instead

already did that as I've said... I repaired .NET and VS, also did a complete reinstall of VS on this system, no luck.

 

the AV client is "Viper"

Can you upload the class and project files? That might help, as would mentioning which AV you changed to.

If this is happening only on one machine with the exact same code there's obviously something going on with that machine. :)

I could, but it wouldn't be much help, I can make a solution from anywhere and copy it to that system and suddenly all the comments are errors... I made a solution and VB project on another system that is working fine, copied it over and opened it, and compile errors.... move it back to the other machine, works fine

 

attached is an example project, I just compiled it and got errors on all the comment lines

WindowsApplication1.zip

Link to comment
Share on other sites

  • 0

Couple of suggestions that may or may not be useful:

- Have you checked the quarantine for your AV. Maybe it has quarantined a Visual Studio file.

- Have you tried removing the Anti-virus and seeing if the problem goes away?

Link to comment
Share on other sites

  • 0

Couple of suggestions that may or may not be useful:

- Have you checked the quarantine for your AV. Maybe it has quarantined a Visual Studio file.

- Have you tried removing the Anti-virus and seeing if the problem goes away?

yes, there was "56 items quarantined" yet nothing was listed in the list, and our admins say they see nothing in the their lists either.

 

removing it the problem doesn't go away, it did something to VS and I can't figure out what... It worked perfectly fine until we did the switch over... we changed from Microsoft Forefront protection managed through SCCM to this new system... The uninstall of the forefront client and sccm client took FOREVER! it took over an hour to uninstall, which felt very odd... right after it was off it automatically deployed the new AV clients... which are sadly being maintained by a 3rd party not even us anymore, so it's made tracking anything that happened down a pain in the butt

Link to comment
Share on other sites

  • 0

yes, there was "56 items quarantined" yet nothing was listed in the list, and our admins say they see nothing in the their lists either.

 

removing it the problem doesn't go away, it did something to VS and I can't figure out what... It worked perfectly fine until we did the switch over... we changed from Microsoft Forefront protection managed through SCCM to this new system... The uninstall of the forefront client and sccm client took FOREVER! it took over an hour to uninstall, which felt very odd... right after it was off it automatically deployed the new AV clients... which are sadly being maintained by a 3rd party not even us anymore, so it's made tracking anything that happened down a pain in the butt

Time for a new machine :P

Link to comment
Share on other sites

  • 0

Are there any log files for the A/V?

 

I find it suspicious that a new A/V finds and removes 56 items and then doesn't tell you what they are. Out of interest, have you tried system restore?

Link to comment
Share on other sites

  • 0

I would say get rid of the AV solution if it's affecting your company's workflow. What is it? That might give a hint as to what's causing it as there are quite a few security solutions that interfere with VS without creating exceptions.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.