Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,49 @@
"frameworks": {
"type": "parameter",
"datatype": "string",
"description": "The target framework(s) for the project (e.g. netstandard2.0;net472).",
"defaultValue": "netstandard2.0",
"description": "The target framework(s) for the project (e.g. netstandard2.0;net472). Default \"net5.0\" if \"--console-app\" is true, \"netstandard2.0\" if \"--console-app\" is true",
"defaultValue": ""
},
"frameworksDefaults": {
"type": "generated",
"generator": "switch",
"description": "generate a default framework value based on consoleApp",
"parameters": {
"evaluator": "C++",
"datatype": "string",
"cases": [
{
"condition": "(frameworks == '' && consoleApp == true)",
"value": "net5.0"
},
{
"condition": "(frameworks == '' && consoleApp == false)",
"value": "netstandard2.0"
},
{
"condition": "(frameworks != '')",
"value": ""
}
]
},
"replaces": "$(Frameworks)"
},
"frameworksValue": {
"type": "generated",
"generator": "join",
"description": "join frameworks and frameworksDefaults",
"parameters": {
"symbols": [
{
"type": "ref",
"value": "frameworks"
},
{
"type": "ref",
"value": "frameworksDefaults"
}
]
},
"replaces": "$(Frameworks)"
},
"config": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup Condition="'$(consoleApp)' == 'true'">
<TargetFramework>netcoreapp3.0</TargetFramework>
<OutputType>Exe</OutputType>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without OutputType, we get the following error when consoleApp was selected during the project creation:

Unable to run your project.
Ensure you have a runnable project type and ensure 'dotnet run' supports this project.
A runnable project should target a runnable TFM (for instance, net5.0) and have OutputType 'Exe'.
The current OutputType is 'Library'.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without OutputType

@am11 great catch, thank you! @ExceptionCaught could you please address that in a separate PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi @am11 , what was the dotnet version that you run new on? I did a few dry run on my local. with or without the consoleapp, could not see the error you mentioned.
image
image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The command which gives the error is 'dotnet run'.

</PropertyGroup>
<PropertyGroup Condition="'$(consoleApp)' == 'false'">
<PropertyGroup>
<TargetFrameworks>$(Frameworks)</TargetFrameworks>
</PropertyGroup>
<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,49 @@
"frameworks": {
"type": "parameter",
"datatype": "string",
"description": "The target framework(s) for the project (e.g. netstandard2.0;net472).",
"defaultValue": "netstandard2.0",
"description": "The target framework(s) for the project (e.g. netstandard2.0;net472). Default \"net5.0\" if \"--console-app\" is true, \"netstandard2.0\" if \"--console-app\" is true",
"defaultValue": ""
},
"frameworksDefaults": {
"type": "generated",
"generator": "switch",
"description": "generate a default framework value based on consoleApp",
"parameters": {
"evaluator": "C++",
"datatype": "string",
"cases": [
{
"condition": "(frameworks == '' && consoleApp == true)",
"value": "net5.0"
},
{
"condition": "(frameworks == '' && consoleApp == false)",
"value": "netstandard2.0"
},
{
"condition": "(frameworks != '')",
"value": ""
}
]
},
"replaces": "$(Frameworks)"
},
"frameworksValue": {
"type": "generated",
"generator": "join",
"description": "join frameworks and frameworksDefaults",
"parameters": {
"symbols": [
{
"type": "ref",
"value": "frameworks"
},
{
"type": "ref",
"value": "frameworksDefaults"
}
]
},
"replaces": "$(Frameworks)"
},
"config": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup Condition="'$(consoleApp)' == 'true'">
<TargetFramework>netcoreapp3.0</TargetFramework>
<OutputType>Exe</OutputType>
</PropertyGroup>
<PropertyGroup Condition="'$(consoleApp)' == 'false'">
<PropertyGroup>
<TargetFrameworks>$(Frameworks)</TargetFrameworks>
</PropertyGroup>
<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,49 @@
"frameworks": {
"type": "parameter",
"datatype": "string",
"description": "The target framework(s) for the project (e.g. netstandard2.0;net472).",
"defaultValue": "netstandard2.0",
"description": "The target framework(s) for the project (e.g. netstandard2.0;net472). Default \"net5.0\" if \"--console-app\" is true, \"netstandard2.0\" if \"--console-app\" is true",
"defaultValue": ""
},
"frameworksDefaults": {
"type": "generated",
"generator": "switch",
"description": "generate a default framework value based on consoleApp",
"parameters": {
"evaluator": "C++",
"datatype": "string",
"cases": [
{
"condition": "(frameworks == '' && consoleApp == true)",
"value": "net5.0"
},
{
"condition": "(frameworks == '' && consoleApp == false)",
"value": "netstandard2.0"
},
{
"condition": "(frameworks != '')",
"value": ""
}
]
},
"replaces": "$(Frameworks)"
},
"frameworksValue": {
"type": "generated",
"generator": "join",
"description": "join frameworks and frameworksDefaults",
"parameters": {
"symbols": [
{
"type": "ref",
"value": "frameworks"
},
{
"type": "ref",
"value": "frameworksDefaults"
}
]
},
"replaces": "$(Frameworks)"
},
"config": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup Condition="'$(consoleApp)' == 'true'">
<TargetFramework>netcoreapp3.0</TargetFramework>
<OutputType>Exe</OutputType>
</PropertyGroup>
<PropertyGroup Condition="'$(consoleApp)' == 'false'">
<PropertyGroup>
<TargetFrameworks>$(Frameworks)</TargetFrameworks>
</PropertyGroup>
<PropertyGroup>
Expand Down