Hundreds of bogus error messages, all on line 1 of apsx file


  • In Visual Studio 14.0.24720.00 Update 1, I have a solution with a single ASP.NET C# project. When I try to compile, I get 281 errors, all on line 1.  This happens frequently, sometimes with close to 1,000 errors, but in the past there has always been at least one actual error somewhere in the list, identifiable by a line number other than 1, and when it was removed all the other messages would go away too.  (Sometimes I had to re-compile twice.)  In this case, all 281 error are supposedly on line 1, and none of them seem to be valid errors.

    Here are the first 4 lines of the .ASPX file:

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PrintRaces.aspx.cs" Inherits="" %>
    <!DOCTYPE html>
    <html xmlns="">
    <head runat="server">

    And here is a sample of the error messages, chosen because this section has more different messages than most:

    Error Messages

    The first few errors are all 'Newline in constant,' 'Too many characters in character literal,' or 'Empty character literal.'  I cannot find any character literals in my code.  From memory of other instances, I think there are the three most frequent messages and they usually head the list.

    In this case, the file is a newly created .ASPX file with C# code-behind.  There is no master page and I removed all scripts, CSS, and includes, with no change in the result.

    Can someone suggest a cause or way of diagnosing the problem?  Thanks so much.


    • Edited by Jim Sn Saturday, March 26, 2016 7:53 PM
    Saturday, March 26, 2016 7:51 PM


All replies

  • Seems that your C# project includes some VB.NET code, since ‘Get’, ‘Overloads’, ‘Function’, etc. are VB.NET keywords. Try finding these words using “Find in Files” dialog and clarify the situation. Or maybe the environment is altered, and repairing or reinstallation of Visual Studio is required.

    • Edited by Viorel_MVP Saturday, March 26, 2016 8:01 PM
    Saturday, March 26, 2016 7:59 PM
  • Thank you.  I think I'll try repairing the environment first, becasue it seems to me that VB.NET code in the project would either always cause the error or never.  I would not expect it to go away when I fix another error.  What do you think?


    Saturday, March 26, 2016 8:05 PM
  • Re-installation of VS is complete, but unfortunately it didn't help.


    Saturday, March 26, 2016 9:43 PM
  • There was a missing } at the end of the c# file.  When I fixed that, all the messages went away.



    Sunday, March 27, 2016 1:01 AM
  • There was a missing } at the end of the c# file.  When I fixed that, all the messages went away.



    Hi Jim,

    Since this issue has been resolved, would you please mark your reply as the answer? So it would be helpful for other members who get the same issue to research and find the answer quickly, and I could close this case for you.

    Thank you for your support and co-operation.

    Best Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, March 28, 2016 5:39 AM