Wednesday, August 29, 2007

Web service with its own identity

I created a webservice that needed a user with more rights than the network authority account which is the standard. It is rather easy to set up:
1. Open IIS
2. Go to Application Pool. Right click and choose 'new --> Application pool.
3. Right click the pool you created and choose properties
4. Click on the Identity Tab
5. Choose 'configurable user'
6. Choose the user (its important that the username includes the domain (domainName\username)
7. Enter and confirm the password
8. In Web sites right click on the directory of the application and choose properties
9. In the general tab click Create application button
10. In the application pool combo box, pick the application pool in step 2.

Sometimes it is enough to place the user in the IIS_WWG group and there should be no problem accessing the service.
IF there is a problem see that the user which is the identity of the application pool has the following user rights assignments in group policy: log on as service, log on as batch,
Replace a process level token, adjust memory quotas for a process, generate security audits (you may not need all of them).

The user will also need read/write access to Windows\Temp directory in the file system.

If you have not succeeded, you will most likely receive a "Service not available" error when trying to browse to the site.

Wednesday, August 08, 2007

Crystal reports won't open report in designer or runtime

In my inhouse application, that has been working since beta 2 of .net 1, I was having some problems with my setup application for the app. I decided to create a new setup application. I uninstalled the old application and installed the application from the new setup msi. Apparently the unistall of the first app, removed components needed for crystal reports (CR) to run. I got the following errors.
In run time: "the type initializer for crystaldecisions.crystalreports.engine.reportdocument threw an exception"
In design time when I tried to open a new report the error was: "crystal reports activex designer failed to open document"

The solution seemed to be to uninstall CR from the VS2007 setup and then reinstall. After doing this for 2 days (more later on my problems there), it still didn't work. What finally worked was the following:
1. Uninstall the runtime app (the one I installed with the new setup).
2. Unistall CR runtime for .net
3. Uninstall CR from VS2007 setup
4. Reinstall CR from VS2007 setup
5. open VS with a new app, create a new crystal report. You will be prompted for a liscense agreement, say yes and you've one.

About the VS2007 installation.

To remove/install CR from the VS2007 one needs to go to add/remove programs in the control panel, select cange VS2007. Click on change/remove components.
I had originally installed VS2007 from a DVD which I had misplaced. I downloaded the CD's from MSDN and the install would not accept the files on the CD (even though it was the same VS version as my install). I copied all the files to a directory on our network and mapped them to my computer. (You need to copy the cd's in reverse order, and agree to write over any duplicate files). I was able to do the reinstall from the mapped network drive but towards the end of the process it asked for some files which it would not accept from the mapped network drive, only from the 3rd CD I had downloaded.

Anyway after two days I finally got it to work.