Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Measurement Studio inserting unwanted assembly references in web.config

I am working on a web application project in VS2008 with Measurement Studio installed.  However, this particular application does not use the National Instruments components.  Yet the following assembly references are added to my web.config without my knowledge:

 

 

<add assembly="NationalInstruments.Common, Version=8.6.35.419, Culture=neutral, PublicKeyToken=18cbae0f9955702a" />
<add assembly="NationalInstruments.UI, Version=8.6.35.465, Culture=neutral, PublicKeyToken=18cbae0f9955702a" />
<add assembly="NationalInstruments.UI.WebForms, Version=8.6.35.465, Culture=neutral, PublicKeyToken=18cbae0f9955702a" />
<add assembly="NationalInstruments.NetworkVariable, Version=8.6.35.465, Culture=neutral, PublicKeyToken=18cbae0f9955702a" />

 

I haven't been able to determine exactly when they are inserted, but I have repeatedly removed these lines and they repeatedly reappear.   I don't want these entries in my web.config.  How do I disable this short of uninstalling Measurement Studio from my machine?

Thanks,

Greg

 

0 Kudos
Message 1 of 15
(5,788 Views)

Hey Greg,

These assembly references are usually added whenever you build your project. If you delete the files and recompile, do they automatically get added?

 

Another thing to check is to make sure you have removed these assemblies from your References in your project. I made an example web application project in VS2008 and found that it automatically added these assemblies to my list of references when I built the project. I then deleted the control and rebuilt it and it still kept the references. After manually deleting the references, and the code from the web.config file and rebuilding, though, I didn't find that it automatically added the reference again.

 

Could you give me some history on your current project file? Did this project ever have Measurement Studio control on it?

 

Lars
0 Kudos
Message 2 of 15
(5,753 Views)

This happens constantly to me as well. There are no NI assemblies referenced in my ASP.NET application and I end up having the app bomb in production due to it not finding assemblies I didn't put there. 

 

Are there no settings for this addin?  How can I remove it (all the usual places for the addin, it doesn't appear there).

0 Kudos
Message 3 of 15
(5,610 Views)

Do you have any: <ni: elements in your aspx page? If i Create a new project with Measurement Studio installed by default I have no references:

 

 

 

2010-03-08_104713.png

Richard S -- National Instruments -- (former) Applications Engineer -- Data Acquisition with TestStand
0 Kudos
Message 4 of 15
(5,573 Views)
That's just it, you can start a new ASP.NET application or open an old one -- and they contain NO NI controls -- never did -- and the add-in will randomly add references in web.config to NI.
0 Kudos
Message 5 of 15
(5,505 Views)

Can you generate a new project, add no references, or measurement studio controls play with it untill the references randomly get added. Then zip and post the project to this forum?

 

Even better if you could let me know what you had to do to get the references to be randomly added in the first place. If we can reproduce a problem, we can zero in on it.

Richard S -- National Instruments -- (former) Applications Engineer -- Data Acquisition with TestStand
0 Kudos
Message 6 of 15
(5,477 Views)

* Created new asp.net project, save all, archived (before dir)

* Added button control, hit save, a few seconds later, NI was added to web.config - automagically (after dir

 

Message Edited by Manlon on 03-16-2010 01:25 PM
0 Kudos
Message 7 of 15
(5,468 Views)
Since the addin wouldn't stop altering my web.config files, I started setting them to read only... someone wasn't happy:


---------------------------
Microsoft Visual Studio
---------------------------

National Instruments

The web.config file is read-only. Class libraries cannot be added to or removed from the web site.
---------------------------
OK
---------------------------

Not a good solution as the addin throws this pop several times during it's edit attempt.
Message Edited by Manlon on 03-19-2010 02:57 PM
0 Kudos
Message 8 of 15
(5,418 Views)

We need to figure out why this is happening. It is not acceptable for Measurement Studio to modify your web.config files if you are not using any Measurement Studio components in the project. 

 

Have you tried setting Tools>>Options>>Measurement Studio>>General>>.NET Tools>>Automatically Update ASP.NET Projects to False?

If not, please try this and let us know if this addresses the issue.

 

Even if it does, we'll see if we can figure out what is happening to cause the Measurement Studio package to modify your web.config when it shouldn't. Can you please let us know which version of MStudio you are using (I see Greg is using 8.6, I'm not sure what version you are using).

 

Aside: The reason you don't see any settings for Measurement Studio in the usual place for Add-In settings is that Measurement Studio is a Visual Studio "package" and not an add-in.

 

David Rohacek

National Instruments

Message Edited by drohacek on 03-22-2010 08:01 PM
0 Kudos
Message 9 of 15
(5,382 Views)

We've made some headway on this.

 

Workaround 1

You should be able to work around this issue by setting Tools>>Options>>Measurement Studio>>General>>.NET Tools>>Automatically Update ASP.NET Projects to False. However, there is a bug in Measurement Studio for Visual Studio 2008 (all versions) that makes this not work properly. The code that checks for this setting is incorrectly checking the registry hive for Measurement Studio for Visual Studio 2005.

 

However, you can manually add the Automatically Update ASP.NET Projects setting to the registry for Visual Studio 2005.

 

To do this, create a REG_SZ (string) registry key named "Automatically Update ASP.NET Projects", under HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\8.0\Measurement Studio\.NET Tools, and set its value to "False".

 

The attached .zip file includes a .reg file will do this for you.

 

If you are unfamiliar with manually editing the registry, please refer to Microsoft documentation on how to do this safely. Incorrectly editing the registry can put your system in a bad state.

 

We will fix the bug that reads the key from the wrong location in the next version of Measurement Studio.

 

Workaround 2

The code that updates the web.config is in the Measurement Studio WebForms user interface controls design-time functionality. So, another way to work around this issue is to remove the Measurement Studio WebForms controls from the Visual Studio toolbox.

 

 

The Problem

The web.config update code exists to add entries required to make the Measurement Studio WebForms controls work properly. The code is intended to execute only when a Measurement Studio WebForms control is dropped in the designer.

 

Visual Studio calls into an interface on our controls when the control is dropped. During this call, we update the web.config. In Visual Studio 2005, Visual Studio calls this interface ONLY when the control is dropped. In Visual Studio 2008, Visual Studio calls this interface ALSO at various other times. We didn't catch this in our testing, likely because we have found the behavior to be intermittent and we generally don't focus on testing cases where our controls are not used. 

 

We will fix this issue in the next version of Measurement Studio, by coding a little more defensively. We'll also add tests to try to catch this kind of thing in the future.

 

 

Thank you for your patience on this issue and let us know if you have any questions or if the workarounds don't work for you.

 

David Rohacek

National Instruments

 

Message 10 of 15
(5,326 Views)