Sign in to follow this  
Followers 0
neufuse

Error in COMMENTS?!

27 posts in this topic

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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" />
1 person likes this

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

 

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

Share this post


Link to post
Share on other sites

Does it happen with a brand new project?

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

What happens if you use a C# style comment?

Share this post


Link to post
Share on other sites

syntax error on the comment

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

/* */
//

Share this post


Link to post
Share on other sites

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

/* */
//

 

no, because this is visual basic not C#

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.