-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Push Framework argument for .net7.0 #3273
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this not a CLI bug? I feel like it should do this for us.
@@ -41,7 +41,12 @@ export class DotnetProjectCreateStep extends ProjectCreateStepBase { | |||
} | |||
const functionsVersion: string = 'v' + majorVersion; | |||
const projTemplateKey = nonNullProp(context, 'projectTemplateKey'); | |||
await executeDotnetTemplateCommand(context, version, projTemplateKey, context.projectPath, 'create', '--identity', identity, '--arg:name', cpUtils.wrapArgInQuotes(projectName), '--arg:AzureFunctionsVersion', functionsVersion); | |||
const args = ['--identity', identity, '--arg:name', cpUtils.wrapArgInQuotes(projectName), '--arg:AzureFunctionsVersion', functionsVersion]; | |||
if (/net7.[0-9]/.test(projTemplateKey)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might be able to just pass the projTemplateKey? I think it's designed to mimic the targetframework, although you might need to remove "isolated" maybe - checkout dotnetUtils
for relevant code. In any case, this logic needs to be more generic to also support net48 and other frameworks moving forward
@@ -41,7 +41,12 @@ export class DotnetProjectCreateStep extends ProjectCreateStepBase { | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ejizba Just wanted to check with you on this-- so I should only have to pass
--arg: Framework net7.0
on project creation since that is when the.csproj
is generated and that's whereFramework
is actually replacingTargetFrameworkValue
.On a
FunctionCreate
, assumedly the project is already created with the appropriate.csproj
file.
Yes that is correct
@@ -41,7 +41,12 @@ export class DotnetProjectCreateStep extends ProjectCreateStepBase { | |||
} | |||
const functionsVersion: string = 'v' + majorVersion; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @liliankasem
For Alex's context, this is a new change by Lilian to the .NET isolated templates. PR here: Azure/azure-functions-templates#1240. Basically, in the past the isolated worker only really supported one .NET version at a time (or at least only one we cared about for the sake of templates). Now, they support net48, net6.0, and net7.0 all at once which is why a new parameter was introduced. If the arg is not passed, it will currently default to net6.0.
Also - it's important to note that the version of the dotnet
cli being used to create the project does not necessarily match the version of the project. I can have all three versions installed on my machine but I should still be able to pick which one I use for my project.
For reference, our tests have been creating csproj files this way forever:
So I think adding the target framework for all versions shouldn't break anything. Also tried with v3 and it doesn't seem to find the new argument. |
@ejizba Just wanted to check with you on this-- so I should only have to pass
--arg: Framework net7.0
on project creation since that is when the.csproj
is generated and that's whereFramework
is actually replacingTargetFrameworkValue
.On a
FunctionCreate
, assumedly the project is already created with the appropriate.csproj
file.