Skip to content

Is there a way to mute NU1603? #5913

Closed
Closed

Description

@forki

On Windows (I haven't tested this on macOS or Linux)

  1. Install .NET Core 2.0.2

  2. Clone fable-suave-scaffold

  3. Instal Node LTS and Yarn latest

  4. Run build.cmd

Expected behaviour

No NU1603 since paket controls the dependencies

Actual behaviour

image

Activity

  1. emgarten commented on Sep 21, 2017

    @emgarten
    Member
  2. forki commented on Sep 21, 2017

    @forki
    Author

    is that something we can set in nuget.config? Or ar least when we add PackageReferences in memory?

  3. emgarten commented on Sep 21, 2017

    @emgarten
    Member
  4. forki commented on Sep 21, 2017

    @forki
    Author

    ok but setting it in Paket.Restore.targets should work as well, right?

  5. emgarten commented on Sep 21, 2017

    @emgarten
    Member

    Should work if you can set it before it is read. Let me know if it doesn't and we can find a different way.

  6. forki commented on Sep 21, 2017

    @forki
    Author

    image

    urgs. now other tools (in this case F# compiler) complain about that

    /cc @dsyme @KevinRansom @cartermp

  7. added a commit that references this issue on Sep 21, 2017
  8. emgarten commented on Sep 21, 2017

    @emgarten
    Member

    Gah! Seems like we should test these on all project types going forward.

    The design for this was to use the exact same fields as the compiler so that users could add these through the project properties window.

  9. forki commented on Sep 21, 2017

    @forki
    Author

    ok reverting that for now. We need another solution. If people are using warnaserror in F# then things will crash.

  10. added a commit that references this issue on Sep 21, 2017
  11. emgarten commented on Sep 21, 2017

    @emgarten
    Member

    Alternatively you could set HideWarningsAndErrors to true and then replay them after restore from project.assets.json with filtering. It would be much more work than just setting nowarn however.

  12. forki commented on Sep 21, 2017

    @forki
    Author

    O_o

  13. forki commented on Sep 21, 2017

    @forki
    Author

    sorry, what I meant is: NuGet's current approach is not working with F# and that has nothing to do with paket. If you set the NoWarn in the project then the compiler will scream at you.

  14. added a commit that references this issue on Sep 21, 2017
  15. mishra14 commented on Sep 22, 2017

    @mishra14
    Contributor

    Closing this issue in the favor of dotnet/fsharp#3626.

    Please feel free to reopen this if you feel otherwise.

  16. forki commented on Sep 22, 2017

    @forki
    Author
  17. rrelyea commented on Sep 22, 2017

    @rrelyea
    Contributor

    @forki - Hear ya. We should have communicated with more compilers than we did during 15.3. Sorry that we didn't.

  18. KevinRansom commented on Sep 22, 2017

    @KevinRansom

    @rrelyea
    I believe this design makes use of a bug in the C# compiler. It ignores anything it doesn't understand ... and it only understands numeric values. I doubt if the bug will ever get fixed though.

    You should consider changing the name of the msbuild property from NoWarn to NugetNoWarn or NoWarnNuget.

    Kevin

    The C# bug:

    namespace ConsoleApp10 {
        class Program {
            static void Main(string[] args) {
                int x = 7;
            }
        }
    }
    

    csc Program.cs

    Microsoft (R) Visual C# Compiler version 2.3.2.62019 (b7354608)
    Copyright (C) Microsoft Corporation. All rights reserved.
    
    Program.cs(13,17): warning CS0219: The variable 'x' is assigned but its value is never used
    

    csc Program.cs /nowarn:0219

    Microsoft (R) Visual C# Compiler version 2.3.2.62019 (b7354608)
    Copyright (C) Microsoft Corporation. All rights reserved.
    
    

    now this:
    csc Program.cs /nowarn:cs0219

    Microsoft (R) Visual C# Compiler version 2.3.2.62019 (b7354608)
    Copyright (C) Microsoft Corporation. All rights reserved.
    
    Program.cs(13,17): warning CS0219: The variable 'x' is assigned but its value is never used
    

    C# ignores any non numeric value including cs0219. It is a C# bug, and it is very likely it won't get fixed.

  19. mishra14 commented on Sep 22, 2017

    @mishra14
    Contributor

    @KevinRansom Thanks for the detailed response.

    I have one correction - /nowarn:CS0219 works as expected -

    F:\validation\test\addpkg>csc Program.cs  /nowarn:CS0219
    Microsoft (R) Visual C# Compiler version 2.4.0.62025 (a0507c1e)
    Copyright (C) Microsoft Corporation. All rights reserved.
    
    
    F:\validation\test\addpkg>csc Program.cs  /nowarn:cs0219
    Microsoft (R) Visual C# Compiler version 2.4.0.62025 (a0507c1e)
    Copyright (C) Microsoft Corporation. All rights reserved.
    
    Program.cs(9,17): warning CS0219: The variable 'x' is assigned but its value is never used
    
    F:\validation\test\addpkg>
    

    Note that it is case sensitive, so cs0219 is not the same as CS0219.

  20. KevinRansom commented on Sep 23, 2017

    @KevinRansom
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area:ErrorHandlingwarnings and errors/log messages & related error codes.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions