.net Library - StarDust.CasparCG.net


Hi didikunz,

Thanks for your suggestions.

In fact I do need the Disconnected-Event to alter the GUI and to send a warning message via network to a remote operator / controller. Perhaps this is - as you mentioned - a “timing”-problem. My server is not running on the localhost but is another machine in a (very small) network. Maybe the answer to the disconnect command doesn’t return in time while the socket is still open. This could be an explanation.

Regarding the error with the package I have absolutely no idea where this comes from. I tried using another .net version beside my usual 4.7.2. Nothing changed. Complete mystery to me…



Hi again,

here an interesting new fact.
I tried to use the packages with .net 4.8 and get another error message when I try to connect. Obviously a file is missing (and my system doesn’t have a drive f:)
Maybe this could be a hint what goes wrong:

Quelle für "f:\dd\ndp\clr\src\BCL\system\runtimehandles.cs" wird gesucht. (No checksum.)
Die Datei "f:\dd\ndp\clr\src\BCL\system\runtimehandles.cs" ist nicht vorhanden.
"f:\dd\ndp\clr\src\BCL\system\runtimehandles.cs" wird in Skriptdokumenten gesucht...
"f:\dd\ndp\clr\src\BCL\system\runtimehandles.cs" wird in Projekten gesucht.
Die Datei wurde nicht in einem Projekt gefunden.
Debugger fordert den Benutzer zum Suchen der Datei auf: f:\dd\ndp\clr\src\BCL\system\runtimehandles.cs.
Der Benutzer hat im Dialogfeld "Quellcode suchen" auf "Abbrechen" geklickt. Die Einstellungen zum Debuggen von Quelldateien für die aktive Projektmappe wurden so geändert, dass der Benutzer nicht zum Suchen der Datei aufgefordert wird: f:\dd\ndp\clr\src\BCL\system\runtimehandles.cs.
Die Quelldatei "f:\dd\ndp\clr\src\BCL\system\runtimehandles.cs" wurde nicht gefunden.


What version of Visual Studio do you use? Is dotNetFX 4.8 supported with it? And what dotNew version does the StarDust lib support? Normally it’s best to use the same version in all project, if possible.


I’m using Visaul Studio 2019.
StarDust packages seem to be net461;netstandard2.0
Do you think that could be a problem?

By the way: I downloaded runtimehandles.cs from the MS site and bind it to my project, As result I am back to the previous error System.ComponentModel.Annotations



I am now able to run the packages as well.
In fact there was another NuGet-Packet required to run the whole thing.
Installing NuGet-Package “System.ComponentModel.Annotations” helped to compile everything correctly.
However the Disconnect-Event won’t fire.




I just fix this problem for the disconnected event. It was a bug on the code. Thanks to report this issue. For the problem of data annotation I add the nuget reference for .net framework. Normally it is fix too.


Hi rom1,

Thanks very much. This works fine.

However there is a minor issue when I connect, disconnect and then connect again.
The “version”-poperty as well as the GetVersion-command show wrong information on the second or more reconnection (as you could see in my application status bar enclosed):

First connect:

Disconnect and second connect (GetVersion):

Disconnect and third connect (CasparDevice.Version):

Maybe you are able to find the reason for that as well.



Hi rom1,

I encountered another problem.
When connecting to the server the first time, the ChannelUpdated event isn’t raised however the server received the INFO command.
But when I disconnect and then connect again the event is thrown twice.

[Event thrown] Channel Updated : 8
[Event thrown] Channel Updated : 8

It also happens when I manually call CasparDevice.GetInfo() after the first connect.
Maybe there is something wrong with the network cue or the network timing?

Sorry that I cause so many problems…



Hi rom1,

I don’t want to bother but I fear I found another issue.
I tried to use AMCP and OSC in one application. Unfortunately I can’t get the connection established. I get the message

Ausnahme ausgelöst: "System.Net.Sockets.SocketException" in System.dll

whenever I try to connect the OSC Listener.

At first I thought it was my fault, so I downloaded your demo file.
To my surprise it didn’t work either. Same message and no information back from the server (version 2.3).

Maybe the reason for all the behaviour is the same. I suppose it’s somehow tcp socket related but I’m not smart enough to fix it myself. :neutral_face:

Maybe you could have a look at it if you found time.

Thanks beforehand.



Hi Ingo,

Do you configure the server to allow OSC, is it the good port where you tried to connect.




Thanks for your remarks. I found the issue. I had a mistake with my async event awaiter. The problem is fixed.
I just publish an alpha nuget version. Please test with this version, to install check the option: Include prerelease in the nuget manager.



Hi Romaine,

Thanks for your work on that problem.
Unfortunately I have the same behaviour as before.

But I found out that it has to do with the way I communicate with my caspar server.
When I run server on localhost ( I can get a clean connection (except for the GetVersion-command that leads to an error).

My application communicates with a the caspar server in a (small) network. When I try to connect to this server (in my case server IP: / client IP the AMPC-connection works (with GetVersion command) but the OSC-connection fails - again with Ausnahme ausgelöst: "System.Net.Sockets.SocketException" in System.dll

Same behaviour with your demo project.
I also tried to connect with both firewalls disabled (client and server). That makes no difference either.

Maybe there is still a problem with the tcp socket via network.

Ping from client to server:


Ping wird ausgeführt für mit 32 Bytes Daten:
Antwort von Bytes=32 Zeit<1ms TTL=128
Antwort von Bytes=32 Zeit<1ms TTL=128
Antwort von Bytes=32 Zeit<1ms TTL=128
Antwort von Bytes=32 Zeit<1ms TTL=128

Ping-Statistik für
    Pakete: Gesendet = 4, Empfangen = 4, Verloren = 0
    (0% Verlust),
Ca. Zeitangaben in Millisek.:
    Minimum = 0ms, Maximum = 0ms, Mittelwert = 0ms



Just to get all information complete:

casparconfig contains:


And I try to setup communication on port 6250.



You need to add a predefined client with your client IP



that doesn’t make any difference.
I tried:


with different ports.
The behaviour doesn’t change. Neither in your demo project. :neutral_face:



And I get a new message every now and again when I try to connect AMPC to the remote server:

  Nachricht = Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
  Quelle = StarDust.CasparCg.net.Device
   bei StarDust.CasparCG.net.Device.CasparDevice.OnUpdatedChannelInfo(InfoEventArgs e)
   bei StarDust.CasparCG.net.Device.CasparDevice.<GetInfoAsync>d__77.MoveNext()
   bei System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) in f:\dd\ndp\clr\src\BCL\system\runtime\compilerservices\TaskAwaiter.cs: Zeile184

  Diese Ausnahme wurde ursprünglich von dieser Aufrufliste ausgelöst:
    System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task) in TaskAwaiter.cs

This behaviour seems to have come with the alpha version of stardust library.



In fact you need to instanciated a AMCP connection first And after you can connect on the default port.
If you don’t need the amcp connection you need to add your client ip adress on predefined client.

Do you try with the demo osc project ?

Other question do you have a firewall on your server that can block the port of OSC ? What is your actual Caspar CG Server version ?


Hi Romaine,

Thanks for your answer.
My application connects to the server via AMPC first. When the “ConnectionChanged” event is thrown with the parameter “Connected” I establish the OSC Listener.
I’m using server 2.3.0.
I also tried with your demo project. It behaves the same (localhost works / remote host doesn’t).


P.S.: Would it be helpful to send you a lean version of my project?


Add firewall exception


Hi rrebuffo,

I disabled firewall on both server and client for testing.