I have installed PnP.Framework NuGet package to read files from the SharePoint portal in my Excel Addin project (.Net Framework 4.6.1). When I debug my project locally, my Addin related code is working fine. I have bundled the entire deployment files as an executable file by using Visual Studio Setup project (.msi file). After installing the Excel Addin, I am getting below error. I have tried various approaches to resolve this issue. There is no luck still now. Could you please help me to resolve this issue?
PnP.Framework Version: 1:13.0
System.Text.Json Version: 4.7.2
Also I have added binding redirect in app.config file like below.
Message: Could not load file or assembly 'System.Buffers, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) StackTrace: at System.Text.Json.JsonSerializer.Deserialize(String json, Type returnType, JsonSerializerOptions options) at System.Text.Json.JsonSerializer.Deserialize[TValue](String json, JsonSerializerOptions options) at PnP.Framework.Utilities.TokenHelper.GetMetadataDocument(String realm) at PnP.Framework.Utilities.TokenHelper.GetStsUrl(String realm) at PnP.Framework.Utilities.TokenHelper.GetAppOnlyAccessToken(String targetPrincipalName, String targetHost, String targetRealm) at PnP.Framework.Utilities.ACSTokenGenerator.GetToken(Uri siteUrl) at PnP.Framework.AuthenticationManager.b62_0(String site) at PnP.Framework.AuthenticationManager.<>c__DisplayClass78_0.b0(Object sender, WebRequestEventArgs args) at Microsoft.SharePoint.Client.ClientRuntimeContext.OnExecutingWebRequest(WebRequestEventArgs args) at Microsoft.SharePoint.Client.ClientContext.GetWebRequestExecutor()
at Microsoft.SharePoint.Client.ClientContext.d37.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.SharePoint.Client.ClientContext.d36.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.SharePoint.Client.ClientContext.d__28.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
at Source: System.Text.Json TargetSite: System.Object Deserialize(System.String, System.Type, System.Text.Json.JsonSerializerOptions)
Steps to Reproduce
N/A
Expected Behavior
Excel Addin should connect SharePoint portal via PnP Framewrok library after creating the installer file (.msi file).
Actual Behavior
Excel Addin is failing to connect SharePoint portal via PnP Framewrok library after creating the installer file (.msi file).
Issue Description
I have installed PnP.Framework NuGet package to read files from the SharePoint portal in my Excel Addin project (.Net Framework 4.6.1). When I debug my project locally, my Addin related code is working fine. I have bundled the entire deployment files as an executable file by using Visual Studio Setup project (.msi file). After installing the Excel Addin, I am getting below error. I have tried various approaches to resolve this issue. There is no luck still now. Could you please help me to resolve this issue?
PnP.Framework Version: 1:13.0
System.Text.Json Version: 4.7.2
Also I have added binding redirect in app.config file like below.
Stack Trace:
Message: Could not load file or assembly 'System.Buffers, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) StackTrace: at System.Text.Json.JsonSerializer.Deserialize(String json, Type returnType, JsonSerializerOptions options) at System.Text.Json.JsonSerializer.Deserialize[TValue](String json, JsonSerializerOptions options) at PnP.Framework.Utilities.TokenHelper.GetMetadataDocument(String realm) at PnP.Framework.Utilities.TokenHelper.GetStsUrl(String realm) at PnP.Framework.Utilities.TokenHelper.GetAppOnlyAccessToken(String targetPrincipalName, String targetHost, String targetRealm) at PnP.Framework.Utilities.ACSTokenGenerator.GetToken(Uri siteUrl) at PnP.Framework.AuthenticationManager.b62_0(String site) at PnP.Framework.AuthenticationManager.<>c__DisplayClass78_0.b0(Object sender, WebRequestEventArgs args) at Microsoft.SharePoint.Client.ClientRuntimeContext.OnExecutingWebRequest(WebRequestEventArgs args) at Microsoft.SharePoint.Client.ClientContext.GetWebRequestExecutor() at Microsoft.SharePoint.Client.ClientContext.d37.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.SharePoint.Client.ClientContext.d36.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.SharePoint.Client.ClientContext.d__28.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.GetResult() at Source: System.Text.Json TargetSite: System.Object Deserialize(System.String, System.Type, System.Text.Json.JsonSerializerOptions)
Steps to Reproduce
N/A
Expected Behavior
Excel Addin should connect SharePoint portal via PnP Framewrok library after creating the installer file (.msi file).
Actual Behavior
Excel Addin is failing to connect SharePoint portal via PnP Framewrok library after creating the installer file (.msi file).
Analysis
No response
Versions & Configurations
No response