Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Adding .NET NI-DMM and NI-SWITCH libraries to the same VS project causing circular reference

I need both NI-DMM and NI-SWITCH .NET libraries (NationalInstruments.ModularInstruments.NISwitch.Fx40 and NationalInstruments.ModularInstruments.NIDmm.Fx40)  for my project in VS 21015.  There is no problem under development environment but unable to run after deployment with the following messages:

=======================================================

...
IDENTITIES
Deployment Identity : WinFormApp.application, Version=1.0.0.23, Culture=neutral, PublicKeyToken=097a2721cb4640aa, processorArchitecture=amd64
Application Identity : WinFormApp.exe, Version=1.0.0.23, Culture=neutral, PublicKeyToken=097a2721cb4640aa, processorArchitecture=amd64, type=win32

APPLICATION SUMMARY
* Installable application.

ERROR SUMMARY
Below is a summary of the errors, details of these errors are listed later in the log.
* Activation of C:\public\WinFormApp.application resulted in exception. Following failure messages were detected:
+ Value does not fall within the expected range.

COMPONENT STORE TRANSACTION FAILURE SUMMARY
No transaction error was detected.

WARNINGS
There were no warnings during this operation.

OPERATION PROGRESS STATUS
* [9/2/2017 11:58:53 AM] : Activation of E:\Publish\WinFormApp.application has started.
* [9/2/2017 11:58:53 AM] : Processing of deployment manifest has successfully completed.
* [9/2/2017 11:58:53 AM] : Installation of the application has started.
* [9/2/2017 11:58:53 AM] : Processing of application manifest has successfully completed.
* [9/2/2017 11:58:56 AM] : Found compatible runtime version 4.0.30319.
* [9/2/2017 11:58:56 AM] : Detecting dependent assembly Ivi.Driver, Version=1.0.0.0, Culture=neutral, PublicKeyToken=A128C98F1D7717C1, processorArchitecture=msil using Ivi.Driver, Version=1.1.0.0, Culture=neutral, PublicKeyToken=a128c98f1d7717c1, processorArchitecture=msil.
* [9/2/2017 11:58:56 AM] : Detecting dependent assembly Ivi.ConfigServer.Interop, Version=1.6.0.0, Culture=neutral, PublicKeyToken=A128C98F1D7717C1, processorArchitecture=amd64 using Ivi.ConfigServer.Interop, Version=1.6.0.0, Culture=neutral, PublicKeyToken=a128c98f1d7717c1, processorArchitecture=amd64.
* [9/2/2017 11:58:56 AM] : Request of trust and detection of platform is complete.
* [9/2/2017 11:58:58 AM] : Downloading of subscription dependencies is complete.
* [9/2/2017 11:58:58 AM] : Commit of the downloaded application has started.
* [9/2/2017 11:59:00 AM] : Installation of application has successfully completed.

ERROR DETAILS
Following errors were detected during this operation.
* [9/2/2017 11:59:00 AM] System.ArgumentException
- Value does not fall within the expected range.
- Source: System.Deployment
- Stack trace:
at System.Deployment.Application.NativeMethods.CorLaunchApplication(UInt32 hostType, String applicationFullName, Int32 manifestPathsCount, String[] manifestPaths, Int32 activationDataCount, String[] activationData, PROCESS_INFORMATION processInformation)
at System.Deployment.Application.ComponentStore.ActivateApplication(DefinitionAppId appId, String activationParameter, Boolean useActivationParameter)
at System.Deployment.Application.SubscriptionStore.ActivateApplication(DefinitionAppId appId, String activationParameter, Boolean useActivationParameter)
at System.Deployment.Application.ApplicationActivator.Activate(DefinitionAppId appId, AssemblyManifest appManifest, String activationParameter, Boolean useActivationParameter)
at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl, Uri& deploymentUri)
at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivationWithRetry(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)

....
...

=======================================================

 

Using IL DASM disassembly tool I was able to see these two libraries referenced different versions of ivi.driver.

 

NationalInstruments.ModularInstruments.NIDmm.Fx40 ==> ivi.driver version 1.1.0.0

NationalInstruments.ModularInstruments.NISwitch.Fx40 ==> ivi.driver version 1.0.0.0

I also looked at NISwitch.Fx45 and it also referenced the same ivi.driver version 1.0.0.0

 

Is there anyway to work around this circular reference issue?  Or are there any NIDmm and NISwitch libraries with same ivi.driver reference?

 

Some more detail:

We're using VB.NET 4.5 with Visual Studio 2015

Running on Win 7 SP1

 

0 Kudos
Message 1 of 2
(2,405 Views)

I was able to resolve this problem by using Window Installer instead of ClickOnce App from VS15.

0 Kudos
Message 2 of 2
(2,347 Views)