Type 'System.Net.NetworkCredential' has been forwarded to assembly 'System.Net.Primitives

I’m encountering this error after migrating to Windows:

`

Plant_Address_Update/SAPLogin.xaml: BC31424: Type ‘System.Net.NetworkCredential’ in assembly ‘de9bec1a-bcb9-41a6-871f-6b9290197735, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null’ has been forwarded to assembly ‘System.Net.Primitives, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’. Either a reference to ‘System.Net.Primitives, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’ is missing from your project or the type ‘System.Net.NetworkCredential’ is missing from assembly ‘System.Net.Primitives, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’.

`

I imported the following namespaces:

System.Net
System.Data.Common
System.Runtime
System.Runtime.InteropServices
System.Data
System.Text

I also installed these packages:

System.Net.Primitives, v4.3.1
runtime.win.System.Net.Primitives, v4.3.1

Additionally, I tried adding the namespace System.Net.Primitives after installing these packages, but it didn’t seem to work. Any suggestions?

Here is the line im getting the error at

SAPPassword = new System.Net.NetworkCredential(string.Empty, Password).Password

@indiedev91

Please change the Package version and make it as “Lowest applicable version”

Hi @indiedev91

SAPPassword is the SecureString datatype variable. If I am not wrong, then you have to convert the above expression to below,

new System.Net.NetworkCredential(string.Empty, Password).SecurePassword

Hope it helps!!

The SAPPassword is of UiPath.Core.GenericValue, i dont think so it cause the error , and even if i change it to string or secure string there is nothing happening , the error was still there

1 Like

Okay @indiedev91

This error basically occurs due to version issues so try updating the UiPath.System.Activities packages to the latest version and keep the runtime rule as lowest applicable version in the Manage Packges then the issue will be resolved.

Hope it helps!!

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.