Accepted Solution

NMSDK 4.1 and C# basics


i am new in the sdk world. with the "old" manageontap.dll i was able to connect to the filer, but with the new manage-ontap.dll i cant.

we are running ontap 7.3.4P3, but i can only find dll's for 7.3.1, 7.3, 7.3.1, 7.3.3, 7.3.5, 8.0 in the 4.1 SDK

old: (works)

            NaServer mycontroller;

            NaElement xin, xout; 

            mycontroller = new NaServer(storageController, 1, 0);
            mycontroller.Style = NaServer.AUTH_STYLE.LOGIN_PASSWORD;
            mycontroller.SetAdminUser(user, pass);


            NaFiler server = null;
            server = new NaFiler(txthost.Text);

            server.Credentials = new NetworkCredential(txtuser.Text, txtpw.Text);
            server.ForceUseUnsecure = true;

            VolumeListInfo input = new VolumeListInfo();

i get the error: The type initializer for 'NetApp.NaServer' threw an exception.

sorry but i searched a long time in the web but i cant find a answer...




Re: NMSDK 4.1 and C# basics

Hi Markus

I guess you have downloaded the.NET API bindings package from NOW. If you plan to use the same you can use 7.3.5 dll to work with 7.3.4

If you plan to use any other programming language download the NetApp Manageability SDK 4.1 package.

Re: NMSDK 4.1 and C# basics

hi kunalm,

thanks for your response! i downloaded the sdk 4.1 today and there i find all what i searched for...



Re: NMSDK 4.1 and C# basics

now all works great... i only get no Value from the system-id or other elements from system-get-info

xi = new NaElement("system-get-info");
                xo = s.InvokeElem(xi);
                volList = xo.GetChildByName("system-info").GetChildren();
                volIter = volList.GetEnumerator();
                while (volIter.MoveNext())
                    NaElement volInfo = (NaElement)volIter.Current;
                    sysid = volInfo.GetChildContent("system-id");
                    //listBox1.Items.Add("Volume Name\t\t: ");
                    listBox1.Items.Add("System-ID     " + sysid);

Re: NMSDK 4.1 and C# basics


There is a utility called ZExplore within the package. You can try using it to execute the system-get-info API


rle Former NetApp Employee

Re: NMSDK 4.1 and C# basics

Try this:

xi = new NaElement("system-get-info");

xo = s.InvokeElem(xi);

systemInfo = xo.GetChildByName("system-info");

systemID = systemInfo.GetChildContent("system-id");

GetChildren() is used for getting arrays within an element.


   - Rick -

Re: NMSDK 4.1 and C# basics

hi Rick, kunalm

thank you! rick's version works great. ZExplorer is a nice tool i searched for!