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

Could not load type 'System.Runtime.InteropServices.OSPlatform #82

Closed
SCartier2018 opened this issue Sep 12, 2018 · 3 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@SCartier2018
Copy link

Running PowerShell 5.1 on Windows 7 running .Net received following error:

Connect-PowerBIServiceAccount : Could not load type 'System.Runtime.InteropServices.OSPlatform' from assembly 'netstandard, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=cc7b13ffcd2ddd51'.
At line:1 char:1

  • Connect-PowerBIServiceAccount
  •   + CategoryInfo          : WriteError: (Microsoft.Power...IServiceAccount:ConnectPowerBIServiceAccount) [Connect-PowerBIServiceAccount], TypeLoadException
      + FullyQualifiedErrorId : Could not load type 'System.Runtime.InteropServices.OSPlatform' from assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyTok 
     en=cc7b13ffcd2ddd51'.,Microsoft.PowerBI.Commands.Profile.ConnectPowerBIServiceAccount
    
@anilkumarjee
Copy link

I am facing with same issue, I do have necessary supported environments on my machine
Windows PowerShell v3.0 (I have a v5) and up with .NET 4.6.1.

@CodeCyclone
Copy link
Collaborator

Please update to .NET 4.7.1 or later. Sadly this can't be fixed as it's an issue in .NET Framework. We tried to workaround this by copying netstandard.dll into the Power BI PowerShell module which fixed some environments but for others they run into this issue. Next release of this module, documentation will state 4.7.1 as the minimal version supported.

@CodeCyclone CodeCyclone self-assigned this Nov 26, 2018
@CodeCyclone CodeCyclone added the bug Something isn't working label Nov 26, 2018
CodeCyclone added a commit that referenced this issue Nov 30, 2018
* Updates to doc for New-PowerBIReport

* UserName and Credential overload for Connect-PowerBIServiceAccount (windows only)

* Adding Out-String vswhere output, issue #76

* Fixing issue where cmdlets couldn't load when executing on file shares, issue #87

* Adding GCC High and GCC Military to environment list

* Updating recommended .NET version to 4.7.1 for issues #82, #60

* Fix for New-PowerBIReport to import reports when user only has read-access

* Final change to enable Connect-PowerBIServiceAccount -Credential (without -ServicePrincipal). Addresses issues #59, #49, #51 and possibly #85
@CodeCyclone CodeCyclone mentioned this issue Nov 30, 2018
Merged
CodeCyclone added a commit that referenced this issue Nov 30, 2018
* New-PowerBIReport cmdlet (Steffen Kampmann contributed)
* UserName and Credential overload for Connect-PowerBIServiceAccount (windows only), #59, #49, #51 and possibly #85
* Adding Out-String vswhere output, issue #76
* Fixing issue where cmdlets couldn't load when executing on file shares, issue #87
* Adding GCC High and GCC Military to environment list
* Updating recommended .NET version to 4.7.1 for issues #82, #60
* Examples folder created
@CodeCyclone
Copy link
Collaborator

README was updated with newer .NET version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants