I have a problem in a ASP web application using the Network service as IIS Identity, and using the Micorsoft Powerpoint Interop DLLs.
I have a windows 7 computer acting as server and developing machine.
I need to use this user for accesing LAN resources in the application.
The problem is that when we use the powerpoint interop dlls (We have read that Microsoft does not recommend them for Web applications but at this moment we have to reuse the code we have in other local applications) the method which creates the powerpoint file seems idle when debugging the application in the call to Slide Shapes.AddPicture method.
If I remove this statement, the interop works well and create the file, but I don't know why is not working.
I configured the DCOM service components as described in this forum:
Doing this:
- In DCOMCNFG, right click on the My Computer and select properties.
- Choose the COM Securities tab
- In Access Permissions, click "Edit Defaults" and add Network Service to it and give it "Allow local access" permission. Do the same for \Users.
- In launch and Activation Permissions, click "Edit Defaults" and add Network Service to it and give it "Local launch" and "Local Activation" permission. Do the same for \Users
Press OK and thats it.
Also, I followed the intructions below:
Automating Office via Windows Service on Server 2008
Summary of the 'Ogawa Hack': create a desktop folder for the system profile, as: C:\Windows\System32\config\systemprofile\Desktop and, if running on a 64-bit machine, create another one, as: C:\Windows\SysWOW64\config\systemprofile\Desktop Also, the folder(s) need write permission for whatever user is "driving" Office.
In summary, this should be a permissions problem with the following statement in my code:
Shape shape = slide.Shapes.AddPicture(fileName, MsoTriState.msoFalse, MsoTriState.msoTrue,
pptBoxOffsetX,
pptBoxOffsetY,
pptBoxShapeDimensionX,
pptBoxShapeDimensionY);
I also have full control (read and write permissions for network service user) in the folder used in the filename parameter, but with no sucessful results. I think this is a permissions issue because if I change the IIS identity to my local user name ( is an administrator account) instead of Network Service, this statement works and the web application does what I need. Therefore something more need to be configured in order to make a successful call to the AddPicture method using the network service account as IIS identity. It's strange that the interop method slide.Shapes.AddShape is working but AddPicture not. Any help would be appreciated. Thanks in advance!!!