Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

warning C4945: 'DotfuscatorAttribute' nationalinstruments.common.dll

Can anybody tell me why I am getting this warning (and how to get rid of it) when I compile with C++?
 

Compiling...

stdafx.cpp

c:\program files\national instruments\measurementstudiovs2005\dotnet\assemblies\current\nationalinstruments.common.dll : warning C4945: 'DotfuscatorAttribute' : cannot import symbol from 'c:\program files\national instruments\measurementstudiovs2005\dotnet\assemblies\current\nationalinstruments.common.dll': as 'DotfuscatorAttribute' has already been imported from another assembly 'NationalInstruments.Analysis.Enterprise'

c:\program files\national instruments\measurementstudiovs2005\dotnet\assemblies\current\nationalinstruments.analysis.enterprise.dll : see declaration of 'DotfuscatorAttribute'

first seen type is used; re-order imported assemblies to use the current type

This diagnostic occurred while importing type '.DotfuscatorAttribute' from assembly 'NationalInstruments.Common, Version=8.0.20.270, Culture=neutral, PublicKeyToken=4544464cdeaab541'.

0 Kudos
Message 1 of 10
(6,502 Views)
Hi,

To use the .NET controls in VC++, you need to create an unmanaged VC++ application.  After you create the application, right-click on the project and go to References.  Here you need to add the NationalInstruments.Common.dll and NationalInstruments.Analysis.Enterprise.dll. 

Let me know if you have any questions.
0 Kudos
Message 2 of 10
(6,489 Views)
I must be missing something in your explanation, how can I use Assemblies without the clr switch? VS did not even let me when I tried it, and I am not sure that it makes any sense. Could you please elaborate a bit further on the explanation?
0 Kudos
Message 3 of 10
(6,486 Views)
Hi,

When you create a new application in VisualStudio, you want to select VC++ >> CLR >> Windows Form Application.  Then go to Project >> Properties.  Here you can add the references that you need.  You will want to add the NationalInstruments.Common.dll, NationalInstruments.UI.dll, and NationalInstruments.UI.WindowsForms.dll.  Attached is a sample application that is a VC++ app with a switch and a gauge.

Let me know if you have any questions.
0 Kudos
Message 4 of 10
(6,479 Views)
All that is fine, the problem is when you add the Analysis library, that is when the warning appears.
0 Kudos
Message 5 of 10
(6,477 Views)
Hi,

Have you also added the namespaces to your .cpp file?  Here is what I included.

    using namespace NationalInstruments;
    using namespace NationalInstruments::Analysis;
    using namespace NationalInstruments::UI;
    using namespace NationalInstruments::UI::WindowsForms;

Let me know if you have any questions.
0 Kudos
Message 6 of 10
(6,474 Views)
Hi,

If you still receive the warning message after adding the namespaces, then you can just ignore warning messages.  They will not affect your application.  You will still be able to use our controls and analysis libraries.

Let me know if you have any questions.
0 Kudos
Message 7 of 10
(6,457 Views)
Adding the namespaces does not get rid of the warning, and I cant figure a way to pragma the warning away since it is generated when bringing in the assemblies.  Just "ingoring the warning" is not really how we do things at our company the policy is that a warning must be treated as an error ie dealt with.
0 Kudos
Message 8 of 10
(6,440 Views)
Hi,

I checked into this warning message some more and found out that this is a bug with MStudio.  I have submitted feedback to R&D, but I currently do not have a timeframe of when this will be fixed.  For now, to remove these warnings, go to Project >> Properties >> Configuration Properties >> C/C++ >> Advanced >> Disable Specific Warnings.  Enter 4945 into that field.  These warning messages should now not appear when compiling.

Let me know if you have any questions.
0 Kudos
Message 9 of 10
(6,426 Views)

I have read here  http://digital.ni.com/public.nsf/allkb/BD205BC6ECAE3FA4862571B7007A1841 (Document ID: 3ZPG7P9A) that the issue has been fixed in MeasurementStudio 8.1.1.

 

Is it possible to disclose how the problem was fixed? I am experiencing something similar and would greatly appreciate a hint.

 

Thank you

 

Peter

 

0 Kudos
Message 10 of 10
(4,555 Views)