I have a MSPL script that is "embedded" into a C# Application. running the MSPL Script directly on the Front End works fine but the deployment process is pretty complicated and lengthy. When I try the same with the C# App on the Front End I always get the following Exception
Application Not Authorized
Inner Exception: Queue could not be created.
This is my Code:
// Handler for MSPL Callbacks
LyncSIPHandler serverApplication = new LyncSIPHandler();
// Load the app manifest from a file.
ApplicationManifest manifest = ApplicationManifest.CreateFromFile("msplscript.am");
try {
manifest.Compile();
Util.Log(manifest.ApplicationUri);
}
catch (CompilerErrorException ex) {
Util.Log("#2 MSPL Compile: " + ex.Message);
}
ServerAgent agent = null;
try {
agent = new ServerAgent(serverApplication, manifest);
}
catch (Exception ex) {
Util.Log("#3 " + ex.Message);
}
The Exception is thrown when I try to create the ServerAgent
with the compiled Script.
The output of Log#1 (manifest.ApplicationUri) is [...URL...]/LyncToolApp
. When I run Get-CSServerApplication
on the Server (Lync 2013) I get the following output
Identity : Service:Registrar:[...server...]/LyncToolApp
Priority : 6
Uri : [...url...]/LyncToolApp
Name : LyncToolApp
Enabled : True
Critical : False
ScriptName :
Script :
What have I missed to make the App run?
Note: I was following this MSPL Tutorial.
The problem was that I had to run the Application as an Administrator even though I was logged in with an Admin Account that was added to the local "RTC Server Applications" group.
I have already tried that but then my next mistake was that the Windows Forms window did not open (why is another question...) so I thought it does not work.
This MSDN Article "Register a managed application on Lync Server 2013" also helped.
The message "Queue could not be created" usually means you need to add the account which runs your code to the "RTC Server Applications" group on the local machine.