-
Notifications
You must be signed in to change notification settings - Fork 586
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
Reference assemblies are located in the wrong folder on Windows #2638
Comments
Workaround
|
Is code here seems to be the issue: FAKE/src/app/Fake.Runtime/SdkAssemblyResolver.fs Lines 126 to 161 in 9dac475
Instead of setting @nojaf, I just want to confirm but I think you mentioned in slack that |
I think the custom/user/system probing is slightly off there - the way to do that probing in a way that's consistent with the way other tooling expects is to
This is what we do in proj-info, and that's modeled off of the lookup logic in the .NET runtime/SDK itself |
@TheAngryByrd yes, |
I'm not sure if this is some legacy install thing, as the files I have in the AppData\Local\Microsoft\dotnet tree are all from SDK 2.1, more than two years old, even after having uninstalled everything before 3.1 to tidy up after the net6.0 release. Question -- is is safe just to delete the dotnet.exe from this (or even the whole tree)? |
if those directories aren't in your |
The Sdk resolver tries first to get user-installed locations before the default dotnet installation. So it seems that you have dotnet installed in a specific location and in default location. So things got mixed up. I think that net6 is installed in the default location but you have an installation that is in your can you please provide output for |
So yeah you have dotnet 3.1 in user specific location and net6 in default installation. And SDK resolver got mixed them. I think we should try both; user-specific and the default location for resolved reference assemblies version. First, user-installed and then default. So in your case it will be we try first if the path exists: |
I disagree, this logic is not aligned with how any other tooling works. it doesn't match how FSI typechecks the scripts, for example. the algorithm I linked above is the supported way to find the SDK directories and you really really should align with that. |
@baronfel Thanks! If that is the correct algorithm and covers all the cases then we should definitely use it in FAKE. Thanks |
@TheAngryByrd said I should extract and publish this, but you can essentially take the code from ionide/proj-info wholesale to help here: https://github.com/ionide/proj-info/blob/main/src/Ionide.ProjInfo/Utils.fs#L7-L87 You can use the |
I want to take a stab at this, feels like an easy steal of Chet's code, so I'm game 😅. |
I also see related issue. I have a custom dotnet version locally installed/copied by build pipeline and I start dotnet fake command with this version then I expect (and was legacy behavior) that DotNet.exec within fake script will execute this custom dotnet version. This was broken with those changes. |
I guess my problem is the same as this one (I'm following the install instructions from here
I'm just starting with dotnet so I have no idea what I should do to be able to install it |
I think you would need a slight variation of |
Release |
Unfortunately, I am still encountering this issue in Fake In my case, I am running Fake using the The error I am getting is this:
A workaround I've found, similar to what @nojaf initially recommended, is to set (please let me know if I should open a new issue) |
@nojaf My issue is that my dotnet version is 6.0.101 so the issue is that there is no /usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.0/ref/net6.0. I do have /usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.1/ref/net6.0/ but I don't know how to tell FAKE to look for it. I tried adding the proper path in |
@JohnTheGr8 & @mattiasdrp could you please open new issues with your case to keep track of it. Thanks |
@yazeedobaid Done in #2648 |
Description
After upgrading to
5.21.0
, I can no longer run my FAKE script on Windows.Repro steps
Expected behavior
FAKE script runs.
Actual behavior
The reference assemblies are being located from
C:\Users\<user>\AppData\Local\Microsoft\dotnet\packs\Microsoft.NETCore.App.Ref
, on my machine they are stored onC:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\6.0.0
.Known workarounds
Copying the
6.0.0
folder fromProgram Files
toAppData\Local
solves the problem.Related information
The text was updated successfully, but these errors were encountered: