Visual Studio for Mac ignores parameter values provided by the user
See original GitHub issueWhen a template is used with Visual Studio 2022 for Mac, the parameter values provided by the user are ignored and the default values are used instead. The same template works correctly with .NET CLI and Visual Studio 2022 for Windows.
I used Visual Studio 2022 for Mac ver 17.4 (build 2406)
Here is a sample template to use for reproduce the issue.
The template defines two parameters:
param
, used in an assignment inProgram.cs
value
, used inappsettings.json
They are replaced with the respective default values, MyParameter
and MyValue
, instead of the values provided by the user
Issue Analytics
- State:
- Created 10 months ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
CA1026: Default parameters should not be used
The compiler ignores the values of default parameters for Managed Extension for C++ when it accesses managed code. The Visual Basic compiler ...
Read more >User and Workspace Settings
The Settings editor is the UI that lets you review and modify setting values that are stored in a settings.json file. You can...
Read more >Suppress code analysis violations - Visual Studio (Windows)
Learn how to suppress code analysis violations in Visual Studio. Understand how to use the SuppressMessageAttribute attribute for in-source ...
Read more >Calculate code metrics - Visual Studio (Windows)
Developers can use Visual Studio to generate code metrics data that measure the complexity and maintainability of their managed code.
Read more >IntelliSense of C++/CLI ignores default value of argument ...
If you have a C# class that uses a default value in a constructor: public class MyClass { public MyClass(ISomeArgument argument = null)...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It will be in Visual Studio for Mac 17.5 preview 2. I do not have an exact date but I expect it will be available sometime in December.
Closing:
if the issue is still reproduced in the Visual Studio for Mac 17.5 preview 2, please comment on this option or preferably open VS feedback issue. Thank you.