I´m having a problem when I´m deploying a solution to our customer server. When I run this application on my testing machine it works just fine. I suspect that there is a library issue on my customer pc but I not finding why. I copied all the libraries to ‘C:/Windows/System32/’ to make sure that they are on the system, but I keep getting this exception. Below is the code that generates the exception:
public static Image getJPEGImage(DateTime fecha, Item \_camara)
{
JPEGVideoSource jp = new JPEGVideoSource(\_camara);
jp.Init(); //THIS IS THE LINE WHERE EXCEPTION IS THROWN
JPEGData s = (JPEGData)jp.Get(fecha);
MemoryStream ms = new MemoryStream(s.Bytes);
Image I = Image.FromStream(ms);
jp.Close();
return I;
}
This is the excepcion:
11/24/2015 11:04:50 AM: VideoOS.Platform.ImplementationMIPException: Your need to initialize Item property before calling Init()
at VideoOS.Platform.Data.JPEGVideoSource.Init(Int32 width, Int32 height)
at VideoOS.Platform.Data.JPEGVideoSource.Init()
at Manager.Milestone.getJPEGImage(DateTime fecha, Item _camara)
at Manager.Milestone.GetImagen(DateTime fecha, String camara)
at Manager.Listener.RealizarTarea(Evento evento)
at Manager.Listener.Parsear(String trama)
11/24/2015 11:04:50 AM: System.ObjectDisposedException: Cannot access a disposed object.
Object name: ‘System.Net.Sockets.NetworkStream’.
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at Manager.Listener.HandleInfo(TcpClient tcpClient)
I think you should use the documented method when including the dependency files. See the MIP SDK Documentation - .NET Library Initialization
We recommend that you copy the files using the .bat files to the folder of you executable..
See also - https://force.milestonesys.com/support/MccRedir?art=000002098&lang=en_US
Hi Bo, Thanks you for your answer. I’ve already done this things you told me and did not work. I keep getting the same error. Can I do something more?.
What initializations do you do?
These? -
VideoOS.Platform.SDK.Environment.Initialize(); // Initialize the standalone Environment
VideoOS.Platform.SDK.UI.Environment.Initialize();
VideoOS.Platform.SDK.Media.Environment.Initialize(); // Initialize the Media
VideoOS.Platform.SDK.Export.Environment.Initialize(); // Initialize the Export
If any of these are missing try to add it.
I am curious; does a sample like the MediaPlaybackViewer sample work for you or do you see issues?
Hi Bo, I do these initializations:
VideoOS.Platform.SDK.Environment.Initialize();
VideoOS.Platform.SDK.UI.Environment.Initialize();
VideoOS.Platform.SDK.Media.Environment.Initialize();
VideoOS.Platform.SDK.Export.Environment.Initialize();
VideoOS.Platform.SDK.MultiUserEnvironment.InitializeUsingUserContext(new Uri(“localhost:84”), “datafeed”, “datafeed”, true);
The application works fine on my QA environment but it fails on the customer environment.
Thanks.
MultiUserEnvironment is so seldomly used, it is seldom we see systems where more than one user needs to be logged in simultaneously in the application.
If this is not what you need you might be able to simplify everything not using MultiUserEnvironment methods.
At any rate it should work. What versions are the MIP SDK and the XProtect server? Does the same user work in the Smart Client? Is the user defined in the server or in domain/AD? Have you the same issue with other Windows/AD users?