Yes, the Windows Forms graph in the Measurement Studio 7.0 .NET beta is a native .NET control, but it does require certain code access security permissions to run, not all of which will be encompassed by the local intranet or internet code groups. I'm guessing that the problem you ran into when you tried this is either a.) your client did not have sufficient code access security permissions to run your user control, and/or b.) your virtual directory execution permissions were not configured correctly for proper control activation.
I tested creating a user control using the beta graph and here are the steps that I followed to get things working:
- Create the user control.
- Create a virtual directory on your web server to run your application from. Copy the assembly that contains your user control along with NationalInstruments.Common.dll, NationalInstruments.UI.dll, and NationalInstruments.UI.WindowsForms.dll to the virtual directory. Make sure that the execution permissions on the virtual directory are set to Scripts Only and not Scripts and Executables.
- Configure the code access security permissions on the client so that the client has the required permissions for the control to run. In this example, I did this by:
- Go to Microsoft .NET Framework 1.1 Configuration in Administrative Tools.
- In the .NET Configuration, go to Runtime Security Policy->Machine->Code Groups->All_Code->LocalIntranet_Zone. Right-click on LocalIntranet_Zone and click New...
- Enter a name for your new code group and click Next.
- Choose URL from the dropdown in the next dialog, then enter http://[servername]/* in the URL textbox where [servername] is your web server, then click Next.
- Accept the default FullTrust permission set in the next dialog, click Next, then click Finish.
- Add an object tag to an HTML page in the virtual directory to activate the user control on the web page. This is done like this:
<object classid="http:[assembly]#[control]" ...>
Where [assembly] is the name of the assembly that contains your user control and [control] is the fully-qualified name of the user control. Note that this syntax is slightly different than your original post.
- Test it out in Internet Explorer. Note that you'll need to use the same server name that you specified in the .NET Framework Configuration. For example, if you entered your machine name and you're testing from your local machine, you'll need to enter your machine name and not localhost.
A couple of side notes - first, depending on if you're running your application on an intranet or the internet, your clients may not be comfortable with configuring FullTrust permission from anything that runs from your server. There are other things that you can do, such as determine the exact permissions that are required and configure those, or limit the URL in the code group to just your virtual directory. Also, I realize that the requirement of setting up code access security permissions on the client can be inconvenient, but this can be made easier by creating an installer that clients run once to automate the process. For more information on this, please see the MSDN article
Increasing Permissions for Web-Deployed Windows Forms Applications.
Hopefully this helps. Please give this a shot and post a follow-up to tell us how things work out. Thanks.
- Elton