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

Azure CP is not working at site collection level #127

Closed
akkindus opened this issue Jun 19, 2021 · 30 comments
Closed

Azure CP is not working at site collection level #127

akkindus opened this issue Jun 19, 2021 · 30 comments
Assignees

Comments

@akkindus
Copy link

akkindus commented Jun 19, 2021

Azure CP is not working at site collection level for existing SharePoint web application, but same solution is working for newly created we application even with site collection.

Note : Existing site collection has public DNS pointed and SSL configured at load balancer level.
Azure authentication provider is configured as a SPTrustedIdentityTokenIssuer for both application.

Thanks in advance.

@Yvand
Copy link
Owner

Yvand commented Jun 21, 2021

Can you check SharePoint logs and filter on Product/Area "AzureCP" to see what happens when you search in the people picker?

@Yvand Yvand self-assigned this Jun 21, 2021
@Yvand Yvand added the Issue label Jun 21, 2021
@akkindus
Copy link
Author

akkindus commented Jun 22, 2021 via email

@akkindus
Copy link
Author

When I search into the people picker it does not pull the Azure cloud users, Only I can get Local AD users.

@Yvand
Copy link
Owner

Yvand commented Jun 22, 2021

On the SharePoint server which throws this error, can you check the version of this file:
"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll"

@akkindus
Copy link
Author

akkindus commented Jun 22, 2021 via email

@akkindus
Copy link
Author

akkindus commented Jun 22, 2021 via email

@Yvand Yvand reopened this Jun 22, 2021
@Yvand
Copy link
Owner

Yvand commented Jun 22, 2021

@akkindus I reopened it for you but you could do it yourself. Also, screenshot is not very convenient, please copy as text

@akkindus
Copy link
Author

Hi Here is the clr.dll version.!

File Version 4.7.3750.0
Product Version 4.7.3750.0

@akkindus
Copy link
Author

Hi @Yvand , Any update for me.

@Yvand
Copy link
Owner

Yvand commented Jun 28, 2021

@akkindus can you run this PowerShell cmdlet and let me know if it succeeds:

[System.Reflection.Assembly]::Load("System.Net.Http, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")

@akkindus
Copy link
Author

akkindus commented Jun 29, 2021 via email

@akkindus
Copy link
Author

akkindus commented Jul 1, 2021

Sorry to chess you but I have urgent need of solution.

Please update - If any...!

@Yvand
Copy link
Owner

Yvand commented Jul 2, 2021

To be honest, I cannot explain why AzureCP cannot load System.Net.Http 4.2.0.0, while it works perfectly fine in plain PowerShell.
But AzureCP uses Microsoft.IdentityModel.Clients.ActiveDirectory, which needs System.Net.Http (>= 4.3.4) (not version 4.2.0.0).
So I propose you test to manually install System.Net.Http 4.3.4 in the GAC of the SharePoint servers:

[System.Reflection.Assembly]::Load("System.EnterpriseServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a") | Out-Null
$publish = New-Object System.EnterpriseServices.Internal.Publish
$publish.GacInstall("C:\path-to-System.Net.Http 4.3.4\System.Net.Http.dll")
Write-Host "Assembly was successfully added to the GAC."
  • iisreset

Please let me know the result

@akkindus
Copy link
Author

akkindus commented Jul 5, 2021

I have a production environment, will this affect anything?

@Yvand
Copy link
Owner

Yvand commented Jul 7, 2021

This is a fairly safe action, as you are only adding a .NET assembly to the cache. And you can easily remove it if needed

@akkindus
Copy link
Author

akkindus commented Jul 8, 2021 via email

@Yvand
Copy link
Owner

Yvand commented Jul 8, 2021

You can install it on only 1 SharePoint server (and test AzureCP on that server only, after you ran iisreset).
If you need to uninstall the assembly, you can simply remove its folder using the file explorer. It will be located at "C:\Windows\Microsoft.NET\assembly\GAC_MSIL\System.Net.Http\v4.0_4.1.1.3__b03f5f7f11d50a3a"

@akkindus
Copy link
Author

akkindus commented Jul 10, 2021 via email

@akkindus
Copy link
Author

Is there any paid support available?

@Yvand
Copy link
Owner

Yvand commented Jul 12, 2021

@akkindus this is not a commercial product, it is a free, open source project and there is no paid support available.
About your error, you said that you checked the logs and did not find any related error. What do you mean exactly? Is the original System.IO.FileNotFoundException gone?

@akkindus
Copy link
Author

akkindus commented Jul 12, 2021 via email

@Yvand
Copy link
Owner

Yvand commented Jul 13, 2021

@akkindus I believe I found a fix for this netstandard issue. I did some research:
Based on dotnet/standard#542, .NET 4.7 projects should explicitely add a reference to netstandard if a reference needs its (which is true with AzureCP).
Based on dotnet/msbuild#2567, that explicit reference should no longer be necessary and setting DependsOnNETStandard should be enough, but it had no effect during my tests.
So I decided to add both (explicit reference to netstandard + setting DependsOnNETStandard) in commit 2f5cf30.
To be complete, I also added an explicit reference to System.Net.Http, but sadly it has no effect (System.Net.Http.dll is not added to the list of dependencies).

Regarding your netstandard issue: I suggest that you download asset "AzureCP-20.0.20210713.1293-dependencies.zip" from the beta release I just created and extract netstandard.dll (do not extract anything else).
Then you can install this netstandard.dll to the GAC of a SharePoint server using this script:

[System.Reflection.Assembly]::Load("System.EnterpriseServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a") | Out-Null
$publish = New-Object System.EnterpriseServices.Internal.Publish
$publish.GacInstall("C:\Users\yvand\Downloads\AzureCP-20.0.20210713.1293-dependencies\netstandard.dll")
Write-Host "Assembly was successfully added to the GAC."

Then, iisreset and check if the issue is resolved

@stale
Copy link

stale bot commented Aug 12, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Aug 12, 2021
@akkindus
Copy link
Author

akkindus commented Aug 13, 2021 via email

@stale stale bot removed the stale label Aug 13, 2021
@akkindus
Copy link
Author

akkindus commented Aug 19, 2021 via email

@Yvand
Copy link
Owner

Yvand commented Aug 23, 2021

@akkindus assuming you still get the same error System.IO.FileNotFoundException: Could not load file or assembly 'netstandard, Version=2.0.0.0, Culture=neutral, I'm out of ideas.
AzureCP targets .NET framework 4.7.2, not .NET standard. I assume that one of the dependencies need it, but I don't know why this would even be a problem because .NET Framework 4.7.2 supports .NET Standard 2.0.
It looks like the local installation of .NET Framework is missing assemblies, but I don't know how to exactly determine which are those ones.

@akkindus
Copy link
Author

akkindus commented Aug 24, 2021 via email

@akkindus
Copy link
Author

akkindus commented Aug 24, 2021 via email

@Yvand
Copy link
Owner

Yvand commented Aug 24, 2021

@akkindus so it seems that you did fix the original error System.IO.FileNotFoundException: Could not load file or assembly 'netstandard, Version=2.0.0.0, Culture=neutral ?
To find out what's wrong now, as usual you can check the SharePoint logs and filter on Product/Area "AzureCP"

@stale
Copy link

stale bot commented Sep 23, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Sep 23, 2021
@stale stale bot closed this as completed Oct 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants