0

I have a tricky question and hope that someone could help me out (really important for me).

My Site should make an automatic call via the Lync client if someone does a certain action on the website. For that reason a batch file gets called and that bat file calls my programm with parameters.

This sounds like a coding question for stackoverflow but everything works fine on my pc and even on the server when my program gets called manually. The problem occurs when my mvc website calls the program especially this function LyncClient.GetClient(); I get an exception "The host process is not running". On my notebook calling the tool over the Website works while debugging in VS2012. I know that the process is running because I can close it via task manager and it gets called via my program when I run it again. This function LyncClient.GetClient(); is built in.

Any ideas? I guess it must have something to do with the Website-User that might have not enough rights to access the lync client.

  • It sounds to me like it is expecting a session for that user on the server to be running with the Lync client. Does the batch file get called on the client side or the server side? – TheCleaner Jun 11 '13 at 13:24
  • bat file gets called server side. the bat file then calls my application like so: start /min /wait Lync.Call.exe logon@username.net test.password someoneElse@xy.net – CodingYourLife Jun 11 '13 at 14:00

2 Answers2

1

I'm not a programmer @yourmother, but it appears that if you are getting "the host process is not running" it would be that whatever is trying to call the Lync client isn't running in the same context as the calling application/program.

Looking around, it appears that is the case: http://social.msdn.microsoft.com/Forums/en-US/communicatorsdk/thread/582cab2e-d51a-4bfe-b4cc-1eed92411754/

The problem is that the Lync client is running on the user's desktop in that workstation context. Your ASP.NET app is running in a separate workstation context under the IIS process and does not have access to the Lync client running in the user context.

There is nothing you can do in IIS to fix this. If you can tell us what you are trying to accomplish, then perhaps we can suggest another approach.

And the fix that they suggest is to use the UCMA API found here: http://www.microsoft.com/download/en/details.aspx?id=10566 or possibly use the SDK found here: http://www.microsoft.com/en-us/download/details.aspx?id=18898

Does that help? I didn't want this to be a comment for formatting sake, but I'll delete this as an answer if it doesn't or you already know this...

TheCleaner
  • 32,627
  • 26
  • 132
  • 191
  • Thanks a lot! I think I have 2 options now. I could rewrite my app to use this API or I could set a flag in the db and keep my tool running and looking for this flag in the database every few seconds. Do you think this could work too? then the tool would be in the same context I guess but I don't know if an app could run only as system user and be in autostart. I might have a problem with my deadline... – CodingYourLife Jun 11 '13 at 14:31
  • I think those questions would be best asked over on StackOverflow.com, sorry, I just think we'd end up commenting over and over and they are better prepared to answer your API questions. – TheCleaner Jun 11 '13 at 14:32
  • I tried your solution but I had some major compability problems with the SDK and Visual Studio. Still you got the problem right (1+). I found a method that didn't take me too long to code and that works for now. BTW I think I would need the Lync SDK and not the UCMA stuff (both had compability problems). – CodingYourLife Jun 15 '13 at 13:49
0

For me the solution was to have my Tool running as "Administrator" Account. I had to change a registry setting for autologin. I simply create a file if the call should start and delete it when it should stop. The Tool checks every view seconds if that File exists and only does the Lync call if it exists.

I know that's not the best way, but it works for my deadline. MS has some compability problems with all the Lync SDKs with the different Lync Client / Lync Server Versions and Visual Studio Versions.