-
Notifications
You must be signed in to change notification settings - Fork 174
Ignore global.json in script folder #573
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
Conversation
@@ -470,7 +479,7 @@ private static string CreateTestScript(string scriptFolder) | |||
|
|||
private static void CreateTestPackage(string packageLibraryFolder) | |||
{ | |||
ProcessHelper.RunAndCaptureOutput("dotnet", "new classlib -n NuGetConfigTestLibrary", packageLibraryFolder); | |||
ProcessHelper.RunAndCaptureOutput("dotnet", "new classlib -n NuGetConfigTestLibrary -f netstandard2.0", packageLibraryFolder); |
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.
This is needed if you have the .Net 5 SDK installed since that version no longer defaults to netstandard2.0
global.json
Outdated
@@ -0,0 +1,5 @@ | |||
{ | |||
"sdk": { | |||
"version": "3.1.102" |
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 can add here "rollForward":"latestFeature" to avoid explicit install
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.
yes that makes sense to me -thanks
…dotnet-script into bugfix-working-directory
Great. Added |
This PR fixes a bug that comes into play if the user has a
global.json
file located in the script folder that is incompatible withdotnet-script
. We are pretty much tied to the 3.1 sdk sincedotnet-script
is anetcoreapp3.1
. I have seen this bug in the past also when trying to execute a script in a folder that resolves the "wrong" sdk through aglobal.json
file.The solution to this is to execute
dotnet restore
with the temp folder as the working directory. By temp folder I mean the folder where the generatedcsproj
file is located.Also added a
global.json
file to this repo as it made local testing a little bit difficult now having the .Net 5 prerelease SDK's installed. The pinned version is the same 3.1 sdk we install on the build servers.Finally also added a test that verifies that a script can run even if we have an "invalid"
global.json
fileThis should fix #571 👍