Skip to content
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

Export fails with Newtonsoft error #62

Open
instinct-vfx opened this issue Sep 23, 2022 · 4 comments
Open

Export fails with Newtonsoft error #62

instinct-vfx opened this issue Sep 23, 2022 · 4 comments

Comments

@instinct-vfx
Copy link

instinct-vfx commented Sep 23, 2022

When adding the -ExportPath parameter i get the following error:

Exporting report into speedscope format.MethodInvocationException: C:\Users\*****\Documents\PowerShell\Modules\Profiler\4.0.0\Export-SpeedScope.ps1:37
Line |
  37 |          $destination = [Profiler.SpeedScope.SpeedScope]::Export($expo …
     |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Exception calling "Export" with "4" argument(s): "Could not load file or assembly 'Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'. Could not find or load a
     | specific file. (0x80131621)"
    
@nohwnd
Copy link
Owner

nohwnd commented Jan 18, 2023

Profiler brings the dependency together, can you confirm you see it in your profile?

image

Which version of powershell are you using?

Did you install the module via Install-Module or manually?

@instinct-vfx
Copy link
Author

Has been a while trying. Will try to replicate and check the dependency. I did use Install-Module. PowerShell version is 7.1.3

@nohwnd
Copy link
Owner

nohwnd commented Jan 19, 2023

Strange. I am looking at the contents of the shipped module Profiler 4.0.0. All the dlls come from the actual build, I am not doing anything special there. I let nuget restore them, and msbuild to build the solution and then I just copy a subset of the final build result. So there should be very little margin for error.

All the version numbers agree etc.

Maybe there are 2 things to try:

  • load older (12 or less) version of newtonsoft to powreshell before you try running it, maybe it simply cannot load a second version of the same assembly. I see the error code above referenced in few places, and they mention that the error happens only when they loaded some other module before the action.
  • try deleting the file in your module directory, maybe antivirus ate/blocked it.

@instinct-vfx
Copy link
Author

I am totally overwhelmed at work this week. Will try and look into it again and check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants