Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

common library errors

I am writing this for the third time since when i try to post it i get an error and the message is lost.
 
I tried to search option but i could not find any solution.
Problem i am working an a project that uses VS2005 and MS8.1 When I compile and run the project everything works great. Then i copy the whole "bin" folder to another computer that does not have MS nor VS2005. When i try to run it I get the messege NI.Common.dll version 8.1.20.235 not found. So i copied it manual into my working directory and i get other error NI.Windows.Form.Led not licensed.
Backk to VS2005 i clean the project and deleted all lniks to Common.dll. Then I linked all modules manualy to the version 8.1.20.237 from the folder "NI\dotNET\...\current" i compile the project everything works great untill i copy the compiled files to another computer. Still version 8.1.20.235 missing. Why again this version since i linked all modules with a newer one.
So i searched for the older version on my computer found some in the folder "Documents\All users\....something" I renamed them to make sure they do not exist. Then I did the same procedure again. When i run the app on another computer the same error.
 
Some modules in the project were developed by another user with the older version but i am making new links to the new one. IS the some file that is keeping the link to the older version of NI.Common.dll. Why does it still link with this library if the librar does not exist.
How to fix this problem. Please can someone help me?
0 Kudos
Message 1 of 4
(4,319 Views)
here are the errors. without NI.Common.dll
File or Assembly NI.Common version 8.1.20.235 Culture=neutral,Publikey.... is missing
 
after adding the right dll version to the Workingdirectory i get the following error
Exception.handle Type initializer NI.UI:Internal...
Details 
 
System.TypeInitializationException: Der Typeninitialisierer für NationalInstruments.UI.Internal.ay hat eine Ausnahme verursacht. ---> System.TypeInitializationException: Der Typeninitialisierer für NationalInstruments.PrecisionTimeSpan hat eine Ausnahme verursacht. ---> System.IO.FileLoadException: Die Datei oder Assembly NationalInstruments.Common.Native, Version=8.1.20.235, Culture=neutral, PublicKeyToken=4544464cdeaab541 oder eine Abhängigkeit davon wurde nicht gefunden. Die gefundene Manifestdefinition der Assembly stimmt nicht mit dem Assemblyverweis überein. (Ausnahme von HRESULT: 0x80131040)
Dateiname: NationalInstruments.Common.Native, Version=8.1.20.235, Culture=neutral, PublicKeyToken=4544464cdeaab541
   bei NationalInstruments.PrecisionTimeSpan..ctor(Int64 wholeSeconds, UInt64 fractionalSecondTicks)
   bei NationalInstruments.PrecisionTimeSpan..cctor()
 
 
upss  see NI.Common.Native wrong version
 
i swear i had the licensed error or i was just readin about it in this forum... well i will try to replace this version 237 with the 235 tomorrow. But still why ist the project not linked with the newer versions.
 
will post the result tomorrow
 
0 Kudos
Message 2 of 4
(4,317 Views)
Hi AdamBielecki,

Before I begin, I want to point out that the majority of what I'm about to state is found in the following help topics in the NI Measurement Studio Help:
  • Measurement Studio .NET Class Library Versioning for Development and Deployment - Very important to read through since versioning of Common is different than versioning of other NI assemblies. 
  • Measurement Studio .NET Merge Modules - Describes dependencies which is important when creating a VS installer to ensure that you installer encompasses all the required components. 
The first point I wanted to make is that I strongly recommend you creating a Visual Studio installer for your application which will help avoid the Common versioning errors you are seeing.  It also helps avoid forgetting to copy over necessary files as well.  I'll explain why that helps with versioning in a second.  But first, a brief description of how
NationalInstruments.Common versioning works. 

Versioning of the NationalInstruments.Common .NET class library works differently than versions of other Measurement Studio libraries because it includes types that all Measurement Studio .NET class libraries reference. Therefore, the NationalInstruments.Common.dll assembly must be compatible with all versions of Measurement Studio .NET assemblies.  If you install a later version of the NationalInstruments.Common.dll assembly over an earlier version, the later version replaces the earlier version in the GAC and installs a publisher policy file so that all applications that reference the earlier version can load the later version.

So how do we deal with this versioning from a deployment perspective? Well, the NationalInstruments.Common class library merge module default setting causes the NationalInstruments.Common class library  to install to the GAC along with a policy file that redirects all references to the latest version of NationalInstruments.Common installed on the system. This means that by default, applications that reference NationalInstruments.Common use the latest version of NationalInstruments.Common installed on the system. 

If you decide to create a Visual Studio installer for your application, you need to make sure that you have included the MStudioCommon.2005.msm merge module which houses the Common as well as the and Common.Native assemblies. Visual Studio should automatically add this merge module and its dependencies for you. 

Now if you decide to just copy the assemblies directly over to your target machine like you are doing now, please read the Measurement Studio .NET XCOPY Deployment Files help topic which describes all the files and caveats. This is very very important for you to read. 

Hopefully after reading this post and those help topics, everything should fall into place. If you are not clear on any topic I have mentioned, or you are still having issues after reading these documents, please let me know.

Best Regards,

Jonathan N.
National Instruments
0 Kudos
Message 3 of 4
(4,312 Views)

Thanks for your help. I am an not familliar with MS8  yet, i have been working with it only for  two weeks. Since the installer is in the development phase, i needed a working version of the project. For now i just copied the two files i had problems with in my working directory and everything worked fine. The application started on my notebook without any problem. but i know this is not the best solution for the future. Thanks again for your quick help and your hints to learn more about the technical background on this subject.

 

0 Kudos
Message 4 of 4
(4,291 Views)