Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Deployment of Web Application Reference Problem

Solved!
Go to solution

Hello,

 

I am updating a web application, referencing several NI libraries, and have experienced a problem regarding the version numbers of references.  Using WebDeploy within Visual Studio, I can quickly publish this particular web application to our server.  I have had no problems until I recently updated the NI drivers on my development system.  When I attempt to load the webpage, I receive the following error:

 

Parser Error

Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: Could not load file or assembly 'NationalInstruments.Common, Version=13.0.40.188, Culture=neutral, PublicKeyToken=dc6ad606294fc298' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Source File: /Pages/Summary.aspx    Line: 39

Assembly Load Trace: The following information can be helpful to determine why the assembly 'NationalInstruments.Common, Version=13.0.40.188, Culture=neutral, PublicKeyToken=dc6ad606294fc298' could not be loaded.

 

This error occurs when the LED element is attempting to load.

 

I think the problem is that the version number for the "NationalInstruments.Common" reference does not match the one installed on my development machine, and the one referenced in the Web.config file.  

 

Here are the references in my Web.config:

 

<assemblies>
        <add assembly="NationalInstruments.Common, Version=13.0.40.190, Culture=neutral, PublicKeyToken=dc6ad606294fc298" />
        <add assembly="NationalInstruments.UI, Version=13.0.40.242, Culture=neutral, PublicKeyToken=dc6ad606294fc298" />
        <add assembly="NationalInstruments.UI.WebForms, Version=13.0.40.242, Culture=neutral, PublicKeyToken=dc6ad606294fc298" />
      </assemblies>

 I tried simply changing the version number within Web.config to match the 13.0.40.188 that the web app is looking for, but that did not work.  Could this be a bug in MStudio, or the NationalInstruments.Common library?  Is there a known workaround for this problem?


Thank you very much for any assistance you can provide!

 

-Eric

 

0 Kudos
Message 1 of 46
(9,024 Views)

Hi EricJay,

 

What version of Measuremetn Studio you upgraded to?

What version of Visual Studio you have?

 

Yes your guess is correct. Can you please try to go to references in the solution explorere, delete these assemblies, and add them again?

To add them, right click on the references>>go to .NET tab. Look for it there and make sure you choose the correct version.

 

Also make sure these assemblies with these version exist in  your computer. Also did you uninstall the earlier version of MStudio?

 

Let me know how it goes.

National Instruments
Applications Engineer
0 Kudos
Message 2 of 46
(9,005 Views)

I am using Visual Studio 10.0.40219.1 (2010 SP1), with Measurement Studio 13.0.0.242 (2013).

 

I have also confirmed that the reference in solution explorer matches the version of the reference installed in the global assembly cache (C:\Windows\Microsoft.NET\assembly\GAC_MSIL\NationalInstruments.Common\v4.0_13.0.40.190__dc6ad606294fc298).

 

This is a relatively fresh installation of Visual Studio and Measurement Studio, so an earlier version of MS was not updated on this machine.  I have, however, updated the drivers as they became available through the NI Update Service.

 

I did notice an additional warning when attempting to publish the web site:

 

(0,0): warning CS1702: Assuming assembly reference 'NationalInstruments.Common, Version=13.0.40.188, Culture=neutral, PublicKeyToken=dc6ad606294fc298' matches 'NationalInstruments.Common, Version=13.0.40.190, Culture=neutral, PublicKeyToken=dc6ad606294fc298', you may need to supply runtime policy

 

0 Kudos
Message 3 of 46
(8,996 Views)

Some additional information...after reinstalling MS2013 and all .NET references, I notice that there are two NationalInstruments.Common.dll libraries in the GAC.  Maybe there is a conflict when Visual Studio attempts to package the web application?

 

Capture.PNG

0 Kudos
Message 4 of 46
(8,992 Views)

Hi, I have the same problem..

In the development computer I have references to 'NationalInstruments.Common, Version=13.0.40.190' common assembly. But when I install the software to other computer it is complaining that 'NationalInstruments.Common, Version=13.0.40.188' common assembly is missing. The deployment program install only the ver 13.0.40.190 to the target machine. I am using the NI WiX example as a base of the setup program.

BUT; when I make a full DaqMX upgrade to 9.7.5, the software is not anymore asking 13.0.40.188 and works fine just with 13.0.40.190..

BR, Ilkka

0 Kudos
Message 5 of 46
(8,977 Views)
Solution
Accepted by topic author EricJay

There should be one. Do you have two version of visual studio installed for two different versions of measurement studio. It would say Measurement Studio 20xx for Visual Studio 20xx, and the place to check is control panel>>add and remove software>>right click national instruments software.

 

Can you just also try moving one of them (.188 version) from GAC to another folder and run again. Let me know how it goes.

National Instruments
Applications Engineer
0 Kudos
Message 6 of 46
(8,974 Views)

Hi,

 

I am not sure if your comment is for me or for the original writer.

 

But in my case have had two version of visual studio installed for two different versions of measurement studio. But have removed the older Measurement Sudio already some time ago.

 

I just removed the (.188 version) from GAC in the development machine. Everything works as before.. But I cannot do more tests because the target installation computer is not here.. I will make a new installation in the next week to a new computer by using the setup program.. Let's see..

 

BR,
Ilkka

0 Kudos
Message 7 of 46
(8,970 Views)

Removing the .188 version from the GAC worked.  It appears that some of the other packages are referencing the older library.  I also tried manually referencing the older version (.188) in the solution and adjusting the Web.config accordingly.  This method also solved the problem.  Thanks for your help!

 

-Eric

0 Kudos
Message 8 of 46
(8,964 Views)

Hi,

 

The 188 problem still exists here. I can compile the libraries in the development machine. But when I remove the 'NationalInstruments.Common' from the reference list, I have the following error message:

 

The type 'NationalInstruments.ComponentBase' is defined in an assembly that is not referenced. You must add a reference to assembly 'NationalInstruments.Common, Version=13.0.40.188, Culture=neutral, PublicKeyToken=dc6ad606294fc298'.

 

The error message is related to version 188 but my referenced library is 190.

 

I have also another problem. If I remove 188 from the GAC, I cannot use a dotfuscator program anymore. It is complaining too that 188 is missing. Please see the attached error message. But I can compile and run the library normally in the development machine without the dotfuscator.

 

There are references also to NationalInstruments.UI ver. 13.0.45.242 and NationalInstruments.UI.WindowsForms ver. 13.0.45.242 in the same project. Is it possible that those libraries want the 188 'NationalInstruments.Common?

 

Any ideas what I should try..?

 

BR,
Ilkka

 

0 Kudos
Message 9 of 46
(8,908 Views)

Did you remove the 188 from the GAC?  If you did, ensure that the 190 is in the GAC.  Also, make sure that the 190 is referenced in your project.  If not, you need to add the reference in the solution explorer.

 

This KB has some extra information as well.

Jesse S.
Applications Engineer
National Instruments
0 Kudos
Message 10 of 46
(8,883 Views)