PC Review Forums Newsgroups Microsoft DotNet Microsoft Dot NET Framework Forms RE: no touch deployment with parameters

Reply

RE: no touch deployment with parameters

 
Thread Tools Rate Thread
Old 22-01-2004, 05:41 PM   #1
=?Utf-8?B?UGF1bA==?=
Guest
 
Posts: n/a
Default RE: no touch deployment with parameters


As it turns out, the exception doesn't occur until I try to read configuration info in my config file via ConfigurationSettings.AppSettings[key]. Something about the URL params have caused the runtime to mistaken params with config file name. I really want to read config data in my config file. The params have nothing to do with config file. How do I tell the runtime to point back to the config file I deployed with my app? I can parse the params.

----- Paul wrote: -----

Hi,

I'm trying to pass parameters to a NTD WinForm in an URL, e.g., http://server/app.exe?param1=x¶m2=y.

Unfortunately, I get either a ConfigurationException or Error loading XML file. I don't get these when I run the app directly (with default test params). Can someone shed some light on this?

Thanks,
Paul
  Reply With Quote
Old 22-01-2004, 06:54 PM   #2
Ben S. Stahlhood II
Guest
 
Posts: n/a
Default Re: no touch deployment with parameters

Paul,

You can add "System.Reflection" and then use
AppDomain.CurrentDomain.BaseDirectory
&
AppDomain.CurrentDomain.SetupInformation.ConfigurationFile

to debug what the configuration file and location are that it is looking
for. It should load the config file from your web server..
http://server/app.exe.config

As long as your config file is in the same spot as the executable and you
the above values are pointing to the right information, it should load fine.
If not then I am just as confused as you are

Hope this may help.

"Paul" <anonymous@discussions.microsoft.com> wrote in message
news:1D9D55E3-6EC8-40D4-B3B9-048F993CEAB7@microsoft.com...

> As it turns out, the exception doesn't occur until I try to read

configuration info in my config file via
ConfigurationSettings.AppSettings[key]. Something about the URL params have
caused the runtime to mistaken params with config file name. I really want
to read config data in my config file. The params have nothing to do with
config file. How do I tell the runtime to point back to the config file I
deployed with my app? I can parse the params.
>
> ----- Paul wrote: -----
>
> Hi,
>
> I'm trying to pass parameters to a NTD WinForm in an URL, e.g.,

http://server/app.exe?param1=x¶m2=y.
>
> Unfortunately, I get either a ConfigurationException or Error loading

XML file. I don't get these when I run the app directly (with default test
params). Can someone shed some light on this?
>
> Thanks,
> Paul



  Reply With Quote
Old 22-01-2004, 07:04 PM   #3
Jan Tielens
Guest
 
Posts: n/a
Default Re: no touch deployment with parameters

Take a look at the article I posted, these sections explain what you need to
do:
Mapping .EXE Files to the Handler
Once you've mapped .EXE files to ASP.NET and implemented a .NET handler to
serve up .exe and .exe?blah.config files, you still need to let ASP.NET know
which handler to use for .exe files. You do this in the web.config files for
your ASP.NET application:

<configuration>
<system.web>
<httpHandlers>
<!-- map .exe and .exe?blah.config files to our handler -->
<add verb="*" path="*.exe"
type="Genghis.Web.ConfigFileHandler, ConfigHandler" />
</httpHandlers>
</system.web>
</configuration>
When ASP.NET sees this <add> element in the <httpHandlers> section, it'll
map all HTTP for paths ending in .exe to the ConfigHandler assembly and the
Genghis.Web.ConfigFileHandler class (the IHttpHandler implementation shown
previously). ASP.NET will look for the web.config file in the root of the
Web application and for the assembly in the bin directory at the root of Web
application, so be sure to put the files in the correct place.

Letting IIS and ASP.NET Hand Out .config Files
After routing requests for .exe files from IIS to ASP.NET, writing the
handler to pass back .config files, routing ASP.NET requests for .exe files
to that handler, there remains two additional configuration steps. The first
is because IIS doesn't allow .config files to go out the door unless
anonymous access is enabled. You'll need to check the Anonymous access
option in the Authentication Methods dialog of your IIS Web application's
Directory Security, as shown in Figure 4.


--
Greetz,
Jan
__________________________________
Read my weblog: http://weblogs.asp.net/jan
"Paul" <anonymous@discussions.microsoft.com> schreef in bericht
news:1D9D55E3-6EC8-40D4-B3B9-048F993CEAB7@microsoft.com...
> As it turns out, the exception doesn't occur until I try to read

configuration info in my config file via
ConfigurationSettings.AppSettings[key]. Something about the URL params have
caused the runtime to mistaken params with config file name. I really want
to read config data in my config file. The params have nothing to do with
config file. How do I tell the runtime to point back to the config file I
deployed with my app? I can parse the params.
>
> ----- Paul wrote: -----
>
> Hi,
>
> I'm trying to pass parameters to a NTD WinForm in an URL, e.g.,

http://server/app.exe?param1=x¶m2=y.
>
> Unfortunately, I get either a ConfigurationException or Error loading

XML file. I don't get these when I run the app directly (with default test
params). Can someone shed some light on this?
>
> Thanks,
> Paul



  Reply With Quote
Old 16-02-2004, 03:36 PM   #4
=?Utf-8?B?TWFyaw==?=
Guest
 
Posts: n/a
Default Re: no touch deployment with parameters

Hi Jan,

Do you know why Anonymous has to be enabled in IIS in order to pass .config files? This doesn't make any sense to me and I can't seem to find an explanation anywhere.

Thanks,
Mark
  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off