Skip to content

Update framework symbol on dotnet new template #1512#1630

Merged
adamsitnik merged 3 commits intodotnet:masterfrom
ExceptionCaught:target_framework
Jan 7, 2021
Merged

Update framework symbol on dotnet new template #1512#1630
adamsitnik merged 3 commits intodotnet:masterfrom
ExceptionCaught:target_framework

Conversation

@ExceptionCaught
Copy link
Copy Markdown
Contributor

This is to address the issue #1512.
.template.json file as follow.

  • Additional generated switch symbol frameworksDefaults to calculate the default values when --console-app is true or false
  • Generated join with the original frameworks to take its value if its not empty.

@dnfadmin
Copy link
Copy Markdown

dnfadmin commented Jan 7, 2021

CLA assistant check
All CLA requirements met.

@adamsitnik adamsitnik added this to the v0.13.0 milestone Jan 7, 2021
Copy link
Copy Markdown
Member

@adamsitnik adamsitnik left a comment

Choose a reason for hiding this comment

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

LGTM, thank you very much @ExceptionCaught !

<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup Condition="'$(consoleApp)' == 'true'">
<TargetFramework>netcoreapp3.0</TargetFramework>
<OutputType>Exe</OutputType>
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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'.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants