You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
It's still problematic to reuse compiler features. But that's maybe just my
personal opinion.
Am 22.09.2017 20:28 schrieb "Ankit Mishra" <notifications@github.com>:
@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.
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.
Really capital CS works? That’s interesting … I guess I should add it to the compiler in that case.
@rrelyea apparently it is case sensitive ... so I will update the compiler to accept FS and ignore other stuff.
Activity
emgarten commentedon Sep 21, 2017
<NoWarn>$(NoWarn);NU1603</NoWarn>will turn off the warninghttps://blog.nuget.org/20170815/Whats-nu-in-NuGet-with-VS2017-15-3.html
https://github.com/NuGet/Home/wiki/Improved-NuGet-warnings
forki commentedon Sep 21, 2017
is that something we can set in nuget.config? Or ar least when we add PackageReferences in memory?
emgarten commentedon Sep 21, 2017
NoWarn is only read from the project file currently.
https://github.com/NuGet/NuGet.Client/blob/012941024a48a22bdcaf9fa3171276e7c075630e/src/NuGet.Core/NuGet.Build.Tasks/NuGet.targets#L599
forki commentedon Sep 21, 2017
ok but setting it in Paket.Restore.targets should work as well, right?
emgarten commentedon Sep 21, 2017
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.
forki commentedon Sep 21, 2017
urgs. now other tools (in this case F# compiler) complain about that
/cc @dsyme @KevinRansom @cartermp
Disable NU1603 - NuGet/Home#5913
emgarten commentedon Sep 21, 2017
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.
forki commentedon Sep 21, 2017
ok reverting that for now. We need another solution. If people are using warnaserror in F# then things will crash.
Revert "Disable NU1603 - NuGet/Home#5913"
emgarten commentedon Sep 21, 2017
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.
forki commentedon Sep 21, 2017
O_o
forki commentedon Sep 21, 2017
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.
Disable NU1603 - NuGet/Home#5913
mishra14 commentedon Sep 22, 2017
Closing this issue in the favor of dotnet/fsharp#3626.
Please feel free to reopen this if you feel otherwise.
forki commentedon Sep 22, 2017
rrelyea commentedon Sep 22, 2017
@forki - Hear ya. We should have communicated with more compilers than we did during 15.3. Sorry that we didn't.
KevinRansom commentedon Sep 22, 2017
@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:
csc Program.cs
csc Program.cs /nowarn:0219
now this:
csc Program.cs /nowarn:cs0219
C# ignores any non numeric value including cs0219. It is a C# bug, and it is very likely it won't get fixed.
mishra14 commentedon Sep 22, 2017
@KevinRansom Thanks for the detailed response.
I have one correction -
/nowarn:CS0219works as expected -Note that it is case sensitive, so
cs0219is not the same asCS0219.KevinRansom commentedon Sep 23, 2017