1

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:

http://social.technet.microsoft.com/Forums/en-US/w7itproappcompat/thread/dde69147-a01a-4eb1-8ea9-31adbf874bed/

Doing this:

  1. In DCOMCNFG, right click on the My Computer and select properties.
  2. Choose the COM Securities tab
  3. In Access Permissions, click "Edit Defaults" and add Network Service to it and give it "Allow local access" permission. Do the same for \Users.
  4. 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!!!

Community
  • 1
  • 1
David
  • 11
  • 2
  • Definetively, it is a permissions issue, I changed the network service user to be an administrator in the machine, and all work perfectly, therefore, something is used by the AddPicture method of the Powerpoint Interop libraries which a normal user/or an administrator user can execute without problems and the network service user does not have the needed permissions somewhere. The question is, where and what shall I change? Thanks – David May 20 '13 at 14:30
  • Before giving administrator permissions, I tried to add the whole C: unit and all local units to have full control for netwrok service user, without success. Also I tried to give full control to the root folders of the windows registry, but also without success. I read about giving Network Service interact with the Desktop, now I'm working in this way but I don't know how to configure that in windows 7. – David May 20 '13 at 14:32

0 Answers0