Chris Sells did an article on this http://www.ondotnet.com/pub/a/dotnet/2003/01/27/ztd.html
> -----Original Message----- > From: Hoop Somuah [SMTP:[EMAIL PROTECTED] > Sent: Friday, March 07, 2003 11:24 AM > To: [EMAIL PROTECTED] > Subject: Re: [ADVANCED-DOTNET] App.config file not found when > remoting windows app deployed by IIS > > What if I intend to use a server activated object and thus no remoting > config file? > > --hoop > > -----Original Message----- > From: Moderated discussion of advanced .NET topics. > [mailto:[EMAIL PROTECTED] On Behalf Of Mike Woodring > (DevelopMentor) > Sent: Thursday, March 06, 2003 4:05 PM > To: [EMAIL PROTECTED] > > Are you trying to build a no-touch deployed Windows Forms app that is > run 'directly' off the web via an href link, and that then uses > remoting? If not, ignore this. If this is what you're trying to do... > > Otherwise, you're basically SOL unless you have the ability to fiddle > around with the end user's machine security policy configuration. > Remoting is just not very amenable to being used by smart client apps > out of the box. Pretty much every corner you turn, you run into a > security violation. For example... > > First off, you can't call RemotingConfiguration.Configure by default > from an href-exe because your app won't have been granted the "enable > remoting configuration" permission that's part of the generic > SecurityPermission. But assuming you can reconfigure security policy to > grant that, then... > > RemotingConfiguration.Configure only accepts local file paths. If > you're remoting configuration is in your app config file, then that file > will have been downloaded locally, but your app won't have sufficient > permissions to find out where "locally" is. Attempting to check > this.GetType().Assembly.Location will net you a security violation (not > allowed to discover the local path to your assembly). > > But since you can see this.GetType().Assembly.CodeBase (the original > server download URL), then you can at least access the original file on > the server. But RemotingConfiguration.Configure doesn't accept http:// > qualified paths. So you have to resort to creating a scratch file in > isolated storage (the only place an href-exe can create/write to files) > and then use HttpWebRequest to pull the contents of the config file off > the server and write it out into to isolated storage file. That works > great, however... > > Once you get the file into isolated storage, you have to get it into the > hands of RemotingConfiguration. Since RC.Configure doesn't allow you to > just pass in a stream as an alternative to passing in a filename (which, > if they'd done this, would have allowed you to just pass an already > initialized/open isolated storage file stream), you have to pass an > actual file name. But passing just the name of the config file to > RC.Configure results in yet another security exception because > RC.Configure isn't written in terms isolated storage functions. So it > fails yet another FileIoPermission demand. > > And on and on... > > That said, if you can configure the end user's machine security policy, > then you can work around all of this and just grab the file off the web > using HttpWebRequest and write it out to a local scratch file in the > file system (either in iso storage or using Path.GetTempPath + > Path.GetTempFilename to find a suitable spot to write the config file > out to). If you want that code, just ask. > > -Mike > DevelopMentor > http://staff.develop.com/woodring > > > > -----Original Message----- > > From: Moderated discussion of advanced .NET topics. > > [mailto:[EMAIL PROTECTED] On Behalf Of > > Todd Hickerson > > Sent: Thursday, March 06, 2003 12:58 PM > > To: [EMAIL PROTECTED] > > Subject: Re: [ADVANCED-DOTNET] App.config file not found when > > remoting windows app deployed by IIS > > > > > > Any takers on this question? I still haven't been able to read the > > remoting config file when the remoting app is deployed by > > IIS. Yes, I am > > trying to get the best of both worlds: IIS deployment, http > > protocol, Win > > 32 (.NET) app. > > > > Thanks, > > > > Todd > > > > =================================== > > This list is hosted by DevelopMentorR http://www.develop.com > > You may be interested in Guerrilla .NET, 24 March 2003, in London > > http://www.develop.com/courses/gdotnet > > > > View archives and manage your subscription(s) at > http://discuss.develop.com > > =================================== > This list is hosted by DevelopMentor. http://www.develop.com > You may be interested in Guerrilla .NET, 24 March 2003, in London > http://www.develop.com/courses/gdotnet > > View archives and manage your subscription(s) at > http://discuss.develop.com > > =================================== > This list is hosted by DevelopMentor� http://www.develop.com > You may be interested in Guerrilla .NET, 24 March 2003, in London > http://www.develop.com/courses/gdotnet > > View archives and manage your subscription(s) at > http://discuss.develop.com =================================== This list is hosted by DevelopMentor� http://www.develop.com You may be interested in Guerrilla .NET, 24 March 2003, in London http://www.develop.com/courses/gdotnet View archives and manage your subscription(s) at http://discuss.develop.com
