-
Notifications
You must be signed in to change notification settings - Fork 585
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
The type initializer for '<StartupCode$Fake-Core-Process>.$Process' threw an exception. #2136
Comments
Interesting 'NotSupportedException'... Can you give some way or a minimal script to reproduce this? |
Building Fake with |
@ditadi It doesn't either for me nor for the build-server so something needs to be different on your system. Are you using a special shell or something like that? |
@ditadi are you able to upload the entire build output rather than just the error. It looks like something being passed to msbuild is busted, fake logs the call to msbuild before it runs complete with all the args. |
@ditadi Ah and can you report in which directory the source are cloned? Maybe it has something to do with some special character in your directory (you can send that private via mail if you don't want to make that public for example Some other options are What's interesting is that there is no stack for the notsupportedexception, which makes this a bit nasty to find... One other option would be to start this in the debugger (via vscode for example). I can help if you have trouble building (as fake doesn't work you need to use |
I think the not supported exception is coming from msbuild... |
I've seen this sort of thing before when the generated path for the project being passed to msbuild is invalid...when I had it, it was all because of the current directory as a lot of things are relative to that. |
I cloned FAKE repo to C:\code directory. I added -v flag to This is noteworthy: |
@ditadi after looking through the code again. This is quite a shot into the dark but can you tell us the following environment variables:
Also can you try to run a script with fake containing the following code (or add it to the Fake.Core.Process.tryFindTool("MONO", "mono") And I still don't get why there is no stack for this exception, but I can figure that out once we can reproduce this. |
Here is my PATH and PATHEXT. I do not have MONO installed but I tried adding |
@ditadi Ah now we are slowly getting somewhere, so you are using cygwin as shell, does the same happen when using cmd/powershell or git bash? |
Additionally there is |
@ditadi I tried but I still cannot reproduce. I'm not sure what else to ask for, I guess we need to use the debugger on your machine or customized builds to debug this on your machine |
I ran these commands in cmd and powershell but Cygwin was installed. I removed Cygwin from my machine and I'm still getting the error. Here is a link to my updated PATH. How would I go about debugging with say Code? |
@ditadi I just pushed some debugger settings (so please Note that if you enable "break on all exception" you should eventually see the There is only one problem: As we use the NuGet package, breakpoints in places like The debugging process is documented a bit here: https://fake.build/fake-debugging.html Let me know if you need further help |
Sorry my code was wrong it should read |
Ah one more thing: Can you try other installation methods of fake besides using |
I did get a different output when adding updated |
That is basically jackpot, now all we need to to is copy (inline) the code for the function into your script and add some printf to see which variables are the problem. I'll send the code for this tommorow, just wanted to let you know that debugging might not be required after all |
I ended up attempting to re-create the issue on a fresh machine and couldn't do it. I decided to nuke my machine that had this problem and start with fresh install of Windows 10. I am no longer experiencing this issue with two new machines I've set up. |
Oh no, I'd have liked to figure out the root cause, but I'm glad it works for you I'd assume it had to do with some environment variable or something like that... I guess this means all I can do is add sone code to improve the error message in case this happens again, but we cannot fix the root cause |
Next time the error message will tell us what the problem is. Additionally I figured out why the stacktrace was missing and fixed that as well |
* Add message to the build state update * Update Fake.Tools.Pickles and added Unit tests * Fix Tests * Fix ArgumentHelper.checkIfMono * Made checkIfMono a bit more elegant * Correct publish artifact * Add `CreateProcess.disableTraceCommand` and use it to hide `appveyor.exe` calls. * print all stack traces in verbose mode, references #2136 * next time we can fix #2136 * add BlackFox.Fake.BuildTask to docs /cc @vbfox * Docs & cleanup * more docs * documentation
I just had this pop up on local and AppVeyor builds. It fails almost immediately after attempting to run the
Locally, I see the same error in the I can run successfully using the |
@panesofglass you can run with verbose flag |
@panesofglass if this isn't an error in the Powershell script please open a new issue which makes it easier to track & discuss |
I'll open a new issue as soon as I have time to get more info. |
I found that when I run FAKE 5 in PowerShell 5, I see the above error. In PowerShell 6, I do not. Workaround is to use PowerShell 6. |
I still think this is specific to how you call fake in you poweshell script. I guess you are using a powershell 6 only feature... |
Well, looks like this is happening again even in PowerShell 6:
|
@panesofglass please try to provide a minimal repro. I'm still convinced this is an issue in your powershell code... |
I switched to a build project rather than using the scripts. That approach continues to be the most consistently working approach and lets me use |
Same issue here. Relevant output from
The same repo works on my Windows 10 PC, my Windows Subsystem for Linux running Ubuntu, and my friend's Linux PC (unsure on distro/kernel etc). It's failing on my other Windows 10 PC as above. From what I can tell I have the correct dotnet core versions installed (3.0.100) and I'm completely stuck here - tried deleting I realise my message is far from helpful as it doesn't contain a minimal repro so apologies for that. The task of creating a minimal repro is a rather mammoth one because there is a huge mix of C# and F# projects in this solution so it'll take me a while to unpick! The relevant line (18) in |
@drk-mtr I think your problem is FSharp.Core update (ie using a newer one than bundled with fake). Just update your fake runner. If not please open a new issue with more details. |
Quite right! A I think it's down to my misunderstanding of paket. I had assumed that versions were pinned and would therefore be the same on each system due to the |
In my case I had an old version of
|
Description
Fake is failing to build a solution.
Expected behavior
Should build the solution successfully.
Actual behavior
Fails to build with this stack trace
Known workarounds
N/A
Related information
The text was updated successfully, but these errors were encountered: