You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I run into a version conflict when trying to write my own CmdLet in c# (.NET Framework 4.7.2) using Microsoft.Data.SqlCLient - just these few lines of code are always resulting in some errors because SqlClient wants to load System.Memory version 4.0.1.1 - I need this dll for other nuget packages and have updated to latest version - I found no solution how to prevent SqlClient to use the old version of System.Memory
using Microsoft.Data.SqlClient;
using System;
using System.Management.Automation;
namespace CmdLetTest
{
public class CmdLetEnvironment
{
public static bool Connected = false;
[System.Management.Automation.Cmdlet(System.Management.Automation.VerbsCommunications.Connect, "RDTest")]
public class RDEnvironmentConnectCommand : System.Management.Automation.PSCmdlet
{
protected override void ProcessRecord()
{
try
{
SqlConnection conn = new SqlConnection("Data Source=localhost\\SQLEXPRESS;Initial Catalog=Test;Integrated Security=True;Encrypt=False");
conn.Open();
}
catch(Exception ex)
{
throw ex.InnerException;
}
}
}
}
}
Error is always Could not load file or assembly 'System.Memory, Version=4.0.1.1, Culture=neutral,
PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.
Any help on this issue??? Have tried so many different things (like app.config settings) but nothing seems to work
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I run into a version conflict when trying to write my own CmdLet in c# (.NET Framework 4.7.2) using Microsoft.Data.SqlCLient - just these few lines of code are always resulting in some errors because SqlClient wants to load System.Memory version 4.0.1.1 - I need this dll for other nuget packages and have updated to latest version - I found no solution how to prevent SqlClient to use the old version of System.Memory
Error is always
Could not load file or assembly 'System.Memory, Version=4.0.1.1, Culture=neutral,
PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.
Any help on this issue??? Have tried so many different things (like app.config settings) but nothing seems to work
Beta Was this translation helpful? Give feedback.
All reactions