इस प्रोग्राम को चलाने पर मैं त्रुटि प्राप्त करता रहता हूं: प्रकार 'सिस्टम। सुरक्षा। सुरक्षितता अपवाद' का एक अनचाहे अपवाद अतिरिक्त जानकारी: ईसीएल विधियों को सिस्टम मॉड्यूल में पैक किया जाना चाहिए।सी # सुरक्षा अपवाद
class Program{
public static void Main()
{
Brekel_ProBody2_TCP_Streamer s = new Brekel_ProBody2_TCP_Streamer();
s.Start();
s.Update();
s.OnDisable();
}
}
मैं इसे कैसे ठीक कर सकता हूं?
Brekel पुस्तकालय का महत्वपूर्ण हिस्सा इस प्रकार है:
//======================================
// Connect to Brekel TCP network socket
//======================================
private bool Connect()
{
// try to connect to the Brekel Kinect Pro Body TCP network streaming port
try
{
// instantiate new TcpClient
client = new TcpClient(host, port);
// Start an asynchronous read invoking DoRead to avoid lagging the user interface.
client.GetStream().BeginRead(readBuffer, 0, READ_BUFFER_SIZE, new AsyncCallback(FetchFrame), null);
Debug.Log("Connected to Brekel Kinect Pro Body v2");
return true;
}
catch (Exception ex)
{
Debug.Log("Error, can't connect to Brekel Kinect Pro Body v2!" + ex.ToString());
return false;
}
}
//===========================================
// Disconnect from Brekel TCP network socket
//===========================================
private void Disconnect()
{
if (client != null)
client.Close();
Debug.Log("Disconnected from Brekel Kinect Pro Body v2");
}
public void Update()
{
// only update if connected and currently not updating the data
if (isConnected && !readingFromNetwork)
{
// find body closest to the sensor
closest_skeleton_ID = -1;
closest_skeleton_distance = 9999999f;
for (int bodyID = 0; bodyID < skeletons.GetLength(0); bodyID++)
{
if (!skeletons[bodyID].isTracked)
continue;
if (skeletons[bodyID].joints[(int)brekelJoint.waist].position_local.z < closest_skeleton_distance)
{
closest_skeleton_ID = bodyID;
closest_skeleton_distance = skeletons[bodyID].joints[(int)brekelJoint.waist].position_local.z;
}
}
// apply to transforms (cannot be done in FetchFrame, only in Update thread)
for (int bodyID = 0; bodyID < skeletons.GetLength(0); bodyID++)
{
for (int jointID = 0; jointID < skeletons[bodyID].joints.GetLength(0); jointID++)
{
// only apply if transform is defined
if (skeletons[bodyID].joints[jointID].transform != null)
{
// apply position only for waist joint
if (jointID == (int)brekelJoint.waist)
skeletons[bodyID].joints[jointID].transform.localPosition = skeletons[bodyID].joints[jointID].position_local;
// always apply rotation
skeletons[bodyID].joints[jointID].transform.localRotation = skeletons[bodyID].joints[jointID].rotation_local;
}
}
}
इस ब्रेकेल टीसीपी पुस्तकालय से परिचित नहीं है। एक लिंक है? यह क्या करता है? –
यह अपेक्षाकृत लंबा है, लेकिन विचार माइक्रोसॉफ्ट किनेक्ट से कंकाल डेटा को कैप्चर करना है, डेटा को तत्काल स्ट्रीम करें क्योंकि कोई व्यक्ति केनेक्ट्स क्षेत्र के दृश्य में आगे बढ़ रहा है, और फिर ब्रेकेल सॉफ्टवेयर और विजुअल स्टूडियो के बीच टीसीपीआईपी कनेक्शन बंद कर देता है। यदि आप इसे देखना चाहते हैं तो मैं लाइब्रेरी को नीचे दी गई टिप्पणी में पेस्ट कर दूंगा। –
http://stackoverflow.com/questions/11286004/securityexception-ecall-methods-must-be-packaged-into-a-system- मॉड्यूल –