Skip to content

[BUG] Error while compiling Dev branch of PnP.Powershell repository  #3296

@NishkalankBezawada

Description

@NishkalankBezawada

Notice

Many bugs reported are actually related to the PnP Framework which is used behind the scenes. Consider carefully where to report an issue:

Reporting an Issue or Missing Feature

I have recently forked the dev branch of PnP.PowerShell and was compiling the code in my machine. The code was compiling and I was able to debug the code as normal until Friday (21st July 2023). It works fine with Master branch

But since Yesterday, Whenever i try to run the code, I get a error as below,

WARNING: load.ps1: Import Modules -- Exception has been thrown by the target of an invocation.

(Screenshot as below)

image

I have tried to ignore this error and tried to connect to SPO and then i get this below error.

PS C:\Research\PnPPowershell\powershell> connect-PnPOnline -Url 'https://pm3q.sharepoint.com/sites/SampleTeamSite' -Interactive
connect-PnPOnline: The 'connect-PnPOnline' command was found in the module 'PnP.PowerShell', but the module could not be loaded due to the following error: [Assembly with same name is already loaded]
For more information, run 'Import-Module PnP.PowerShell'.
PS C:\Research\PnPPowershell\powershell>

(Screenshot as below)

image

I tried to connect to SPO outside of the repository, it doesnt give me this error.

(Screenshot as below)

image

Suggestion

If i try compiling Master branch, It works as a charm.

image

image

I guess this error is from src\Commands\_debug\debug.ps1 & src\Commands\Base\PnPPowerShellModuleInitializer.cs. (Just skeptical, Please correct me if i am wrong). Kindly suggest.

Expected behavior

Should be able to compile the code and debug

What is the version of the Cmdlet module you are running?

(you can retrieve this by executing Get-Module -Name "PnP.PowerShell" -ListAvailable)

image

image

Which operating system/environment are you running PnP PowerShell on?

  • Windows
  • Linux
  • MacOS
  • Azure Cloud Shell
  • Azure Functions
  • Other : please specify

Thanks,
Nishkalank Bezawada

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions