Error while trying to use NatNetML.dll

NatNet, VRPN, TrackD, and Plugins
Post Reply
siddharth
Posts: 6
Joined: Tue Jun 02, 2009 5:10 pm

Error while trying to use NatNetML.dll

Post by siddharth » Sun Jan 10, 2010 4:04 pm

I am getting error mentioned below when trying to use NatNetML.dll. I am using Visual Studio 2005 and Framework 2.0.x on an XP machine. Your help will be really appreciated. Thanks.

Visual Studio Error Message:{"The system cannot find the file specified. (Exception from HRESULT: 0x80070002)":null}
InnerException - null.


Error message seen in Event Viewer
Generate Activation Context failed for C:\Documents and Settings\Sid\Local Settings\Application Data\Microsoft\VisualStudio\8.0\ProjectAssemblies\leui7k5r01\NatNetML.dll. Reference error message: The operation completed successfully.

Resolve Partial Assembly failed for Microsoft.VC80.CRT. Reference error message: The referenced assembly is not installed on your system.

Dependent Assembly Microsoft.VC80.CRT could not be found and Last Error was The referenced assembly is not installed on your system.

morgan
NaturalPoint Employee
NaturalPoint Employee
Posts: 200
Joined: Tue Jun 24, 2008 2:01 pm
Location: Corvallis, OR, USA
Contact:

Re: Error while trying to use NatNetML.dll

Post by morgan » Mon Mar 15, 2010 3:36 pm

A note on this:

The Visual C++ runtime libraries are required to run the samples. If you encounter an error message when attempting to run the samples, especially on machines without Visual C++ installed, please install the VC runtime redistributable package located in Samples\VCRedist or from your Visual Studio folder:

C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages\vcredist_x86

With Microsoft's WinSxs structure for deploying run-time libraries, it's not enough to have *any* version of the CRT present - you must have the same verson of the CRT as specified by the application's dependencies.

Please contact support if you are still unable to resolve.

Morgan

siddharth
Posts: 6
Joined: Tue Jun 02, 2009 5:10 pm

Re: Error while trying to use NatNetML.dll

Post by siddharth » Tue Mar 16, 2010 5:09 pm

Thank you for the reply Morgan. I was able to make the code at least run by doing this: dependancy walker showed that I was missing msvcm80.dll and some other dlls so I just copied these dlls from somewhere (on my machine) to the bin directory of the sample project...kind of brute force way of making it work. Nonetheless, I installed the package you mentioned above.

Now that I am able to start the Win Forms Sample code, I am running in to an issue where I am not able to connect. (Code below is straight from the sample provided.) I have made sure that tracking tools is on, it is capturing a trackable object and broadcasting while the sample winform is running. While debugging, the code 'initializes' successfully, but gives error upon connecting. Apparently "GetServerDescription" is returning an empty description object which seems to be causing the problem.I am asking this question here in this thread because I want to make sure this is not related to C++ CRT. ( And of course, idea is not to make you debug my code....I am just new to this stuff) Just for the sake of neatness, I have removed code not relevant to my question. Really appreciate your help. Also, if this is unrelated to C++ CRT issue, I will open a new thread.




if (checkBoxConnect.Checked)
{
// [NatNet] connect to a NatNet server
int returnCode = 0;
returnCode = m_NatNet.Initialize(textBoxLocal.Text, textBoxServer.Text);
if (returnCode == 0)
OutputMessage("Initialization Succeeded.");
else
{....
}

// [NatNet] validate the connection

NatNetML.ServerDescription desc = new NatNetML.ServerDescription();

returnCode = m_NatNet.GetServerDescription(desc);
if (returnCode == 0)
{............
}
else
{
OutputMessage("Error Connecting.");
checkBoxConnect.Checked = false;
checkBoxConnect.Text = "Connect";
}

morgan
NaturalPoint Employee
NaturalPoint Employee
Posts: 200
Joined: Tue Jun 24, 2008 2:01 pm
Location: Corvallis, OR, USA
Contact:

Re: Error while trying to use NatNetML.dll

Post by morgan » Wed Mar 17, 2010 11:16 am

Hey sid,

This sounds like more of a connection issue. Very unlikely CRT stuff.

m_NatNet.Initialize() creates sockets on the client on sends out a "here i am" ping to the server address. If this is succesful, Inititalize returns true. If there was an internal network error creating a socket or binding that socket to the spcified ip address, or sending the message to th server address failed, it returns false. *But* - It does not make sure the server actually got that message. So if there is no server out there, it will still return true.


m_NatNet.GetServerDescription(desc) sends a description request command to the server, then waits for a reponse. If the response times out, then it returns false, otherwise it returns true, and the client and server are talking.

So basically, GetServerDescription() is your confirmation of a good Client/Server connection.

There's tons of reasons why the client / server could fail. I usually check the following:

1. Does SampleServer / Sample Client work? You should be able to just run SampleServer, then SampleClient and see data flowing.

2. If SampleServer / SampleClient does not work there is a network issue. Try looking at firewalls, pinging each other, etc.

3. If SampleServer / SampleClient does work, and you are running your app on the same machine, its likely an IP address issue. TrackingTools will use the "preferred" IP address (from ipconfig /all). Your client needs to use this address as the server address. It cannot use local loopback (127.0.0.1) if TrackingTools is using 169.254.2.28. They must match.

Also important, are you running on the same machine or separate machines?

Let me know. If its still not working I can offer up some additional things to try.

Morgan

siddharth
Posts: 6
Joined: Tue Jun 02, 2009 5:10 pm

Re: Error while trying to use NatNetML.dll

Post by siddharth » Tue Mar 23, 2010 3:07 pm

I really appreciate your prompt follow up!
Here are few things I have noticed.
1) On ipconfig /all the IP address that I am getting is the same that is being used in WinFormsSample app. The reason I am sure is because (as you know) it shows up in the textboxes of the app and I made sure by debugging too. So, it's definitely not using 127.0.0.1.
2) Till this point, I was just trying out WinFormsSample with the idea that I'll just use Tracking Tools as my server. In any case, I tried running Sample Server by itself and it gives
"Socket Error: 10049: WSAEADDRNOTAVAIL" Although I don't have source code, it sounds like address is not available to the server?
3) Yes, I am/will be using the same machine as both client and the server. (Since I could not get my Sample Server run, could not try Sample Client and Sample Server together)
4) I could ping to the IP that I see in WinFormSample form. I also made sure Firewall was off for the time being when I was trying (it was originally on).

It sounds like I am missing something very basic here. I am sorry in advance if this turns out to be a silly thing!

Thanks a lot,
Sid

morgan
NaturalPoint Employee
NaturalPoint Employee
Posts: 200
Joined: Tue Jun 24, 2008 2:01 pm
Location: Corvallis, OR, USA
Contact:

Re: Error while trying to use NatNetML.dll

Post by morgan » Thu Mar 25, 2010 10:35 am

Hey Sid,

"Socket Error: 10049: WSAEADDRNOTAVAIL" typically ocurs when the port the NatNet server attempts to bind to is already in use.

Is it possible you have another application using this port?

Try running SimpleServer by itself, making sure no other NatNet Server apps are running (other instances of Simple Server, Tools, etc).

Once you get daata streaming between SimpleServer and SampleClient, the rest should be gravy.

siddharth
Posts: 6
Joined: Tue Jun 02, 2009 5:10 pm

Re: Error while trying to use NatNetML.dll

Post by siddharth » Fri Mar 26, 2010 9:38 am

One again, thanks a lot for your follow up. Really appreciate it. I am making sure that no other instance is running and yet I am getting the same error when I run sample server. Is it possiblt to call you and speak to you? Perhaps that'll save your time as well.. ? I can call you any time you want.

aluaces
Posts: 9
Joined: Mon Dec 21, 2009 10:14 am

Re: Error while trying to use NatNetML.dll

Post by aluaces » Tue Mar 30, 2010 1:35 am

The port could be in also use by any other program that could have nothing to do with any other OptiTrack product. You can try to change the port number in the examples to see if it makes the difference.

Post Reply