Hello,
I’m stuck with an issue that i havn’t been able to solve, so i hope someone will be able to help me.
I set up a webservice on windows with IIS. It works great until i tried to use Unity. Let me explain what it does :
1 - The webservice call a batch file and wait for the process to end.
2 - The batch file call an .exe file that i have made. It open a 3d file format, draw it, take a picture and then save the picture on hard drive. I used OpenGL to do this.
3 - The process has end, so the webservice open the image and send it to the user.
This is my initial setup and it works great, no problem at all. Then i wanted to update the rendering process to get a better quality image. I created a new .exe file from Unity to do so, a windows standalone build.
Here is my issue, when i replace OpenGL exe file by Unity, the process launched by the batch file never end. For test purpose i created another standalone build with nothing inside, only one script attached to the camera that write a file on the hdd then quit. But same endless process. Both Unity build works fine when I launch them from batch file by double clicking on it. The probleme seem to be when the webservice launch the batch file.
The batch file is launch with administrator’s right by the webservice else even the opengl build cannot be launched.
The batch file launch Unity standalone build with argument “-batchmode”. Here is the line in batch file :
Hello.
The file was too large to be uploaded here, so i uploaded it here : Gofile - Your all-in-one storage solution
I didn’t see anything interesting inside, but it’s the first time i read a DMP file
Thanks for your help. I hope we’ll find where the problem come from.
Regards,
So I looked at the dump and it doesn’t look like the process is stuck or deadlocked. Did you try debugging your code to see perhaps an exception gets thrown somewhere and Application.Quit fails for some reason?
I tried yes. But nothing wrong happened. The standalone build works fine when i’m using it manually. But when launched by IIS, the application seems to start as it appear in process list. But the first line of code is to write a text file that is never created. Maybe an another parameter than -batchmode requiered ? Or some options to check in project settings to be able to use standalone as headless server process ?
I think it come from Unity since other program that i’m using like this works fine when called by IIS. Is it possible to use Unity Standalone build like this, or it has some restriction ?
Does your script get invoked at all? Do breakpoints hit in the C# debugger? Could be a weird permission issue as AFAIK IIS launches apps on as a different user.
I believe the script not invoked since there are no file created. C# debugger ? I’m not sure what you are referring at. Do you mean in editor ?
I gave an administrator user to IIS app pool with full right and set permission of folder where app is stored to global. I use the same folder for other app that are launch by IIS. I don’t know what other permission I could give.
Good news.
It’s finally working. It seems that a Unity standalone player require more right than an other executable, so no choice. I know it is a bad idea but i had to configure IIS with full right to be able to launch it. An user administrator was not enough so I had to upgrade it to system administrator. I didn’t know that there even was a difference.
In any event, it’s now working. so thank you