views:

178

answers:

1

The issue we're running across is that we use a screen scraper to generate non copy-and-pasteable images of web pages for users who don't have access to raw data to hamper copy-and-paste activity. We have a class that's set up to instantiate a web browser object in memory, and then it accesses the page and we render it to a bitmap that we save as a jpeg.

While we can access the page okay from the server manually, when the class attempts to access it we get an error that says we can't use allowDefinition='MachineToApplication' beyond application level. We don't have any virtual directories, we don't have multiple web.configs, and the lack of reproducibility except through this one process is intensely frustrating. Any ideas what else we can do?

A: 

What you need to do is change the "allowDefinition" setting in your applicationHost.config file. That setting determines the level where it can be set, the options are as follows:

[MachineOnly|MachineToApplication|AppHostOnly|Everywhere]

If you open it up to everywhere you should be good to go. If you need to do this via command line on server 2008 you should be able to do it with the appcmd utility.

tb
we appreciate it, but this only exists in IIS 7 and the server's running IIS6 so no go for that solution.