Error '42022 is not a valid warning number'

I received this error message while building my solution:

'42022' is not a valid warning number

But on the 'Suppress warnings:' of the project property - 42022 is listed

How do I fix or resolve this problem

Thanks,

dvinh



Answer this question

Error '42022 is not a valid warning number'

  • GAT2000

    Hi Gus:

    I never did have this problem (with C# by itself) until I added 'VB.Net' language support into VS 2005.

    Maybe the installation overlapped something in the configuration

    Thanks,

    Duy


  • stephenstarring

    I just realized 42022 is a warning that is sometimes disabled in Visual Basic projects. Not sure how it got to your C# project though. If you could provide any more details it would help.

  • Sudhaks

    Someone on our team will follow up with you directly soon. Thanks Duy.

  • mrrogers912

    Gus:

    Yes, that is exactly what happened. However, I've been trying to resolve this by:

    1. Remove VB.Net from VS - problem still persist
    2. Remove C# from VS, then add C# back - problem still persist
    3. Reinstall VS - problem still persist
    3. Uninstall VS, then reinstall VS - problem still persist

    I'm running out of ideas - please help!

    Thanks,

    Duy


  • dev_kh

    Duy, can you describe what you mean by "added VB.Net language support into VS " Did you originally install VS with only C# support and then later updated the install by clicking on the VB checkbox in the setup program The more details you provide about the steps that you took would really help us out. Thanks...

     



  • wayne_p

    Gus:

    Here is more info on the error.

    Thanks

    Duy

    --------------------------------------------------------------------------


    Target CoreCompile:
      Task "Csc"
        Command:
        Csc.exe /noconfig /nowarn:"42015,42016,41999,42017,42018,42019,42032,42036,42020,42021,42022" /errorreport:prompt /warn:0 /define:DEBUG;TRACE /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50215\System.Data.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50215\System.Deployment.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50215\System.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50215\System.Drawing.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50215\System.Windows.Forms.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50215\System.Xml.dll /debug+ /debug:full /optimize- /out:obj\Debug\WindowsApplication5.exe /resource:obj\Debug\WindowsApplication5.Properties.Resources.resources /target:winexe /warnaserror+ Form1.cs Form1.Designer.cs Program.cs Properties\AssemblyInfo.cs Properties\Resources.Designer.cs Properties\Settings.Designer.cs
        The "Csc" task is using "Csc.exe" from "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50215\Csc.exe".
        Microsoft (R) Visual C# 2005 Compiler version 8.00.50215.44
        for Microsoft (R) Windows (R) 2005 Framework version 2.0.50215
        Copyright (C) Microsoft Corporation 2001-2005. All rights reserved.
       
        CSC : error CS1904: '42022' is not a valid warning number
      Done executing task "Csc" -- FAILED.

  • renato sabo

    Hi Dvinh, did you enter 42022 yourself or was it there when you created the project/solution If it was there when the project was created please tell me what project type it was.

    42022 is for sure not a valid warning code as all our warning/error codes are a max of 4 digits long. If you just want to get rid of the error message you're seeing, go ahead and remove the '42022' code from the "Suppress warnings" field. But please let me know if you didn't add it yourself (or whoever created the project in the first place) on purpose or by mistake.

    Thanks Dvinh.



  • Error '42022 is not a valid warning number'