2003-02-21

Smart Client Config

You can use application configuration files with smart clients over the web. Say you want to store a setting in an XML config file:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="WebServiceUrl" value="http://mypublicserver/smartclientservice.asmx?wsdl" />
</appSettings>
</configuration>


Just save this as a file named after you EXE with ".config" appended to it: smartclient.exe.config
To access the setting from within your app use the ConfigurationSettings class:

_service.Url = ConfigurationSettings.AppSettings["WebServiceUrl"].ToString();

The last thing you must do before this works is modify the web.config file for your web app. You'll need to allow the app to serve up .config files:


<configuration>
<system.web>
<httpHandlers>
<!-- Except for web.config allow any config to be served up -->
<remove verb="*" path="*.config" />
<add verb="*" path="web.config" type="System.Web.HttpForbiddenHandler"/>
</httpHandlers>
</system.web>
</configuration>


With my last post I described a problem with bogus web requests. On the positive side it yielded a solution to another problem I was having, loading config files over the web.


Bogus requests

So I'm digging in more with .NET smart client deployment. I'm using HREF EXE's. So a boot link looks like this: <a href="myclient.exe">. After viewing the web logs I found the following:


23:29:16 127.0.0.1 GET /smartclient/myclient.exe 304
23:29:18 127.0.0.1 GET /smartclient/myclient.exe.config 403
23:29:18 127.0.0.1 GET /smartclient/myclient.exe 304
23:29:18 127.0.0.1 GET /smartclient/myclient.DLL 404
23:29:18 127.0.0.1 GET /smartclient/smartclient/myclient.DLL 404
23:29:18 127.0.0.1 GET /smartclient/bin/myclient.DLL 404
23:29:18 127.0.0.1 GET /smartclient/bin/smartclient/myclient.DLL 404
23:29:18 127.0.0.1 GET /smartclient/myclient.exe 304
23:29:18 127.0.0.1 GET /smartclient/myclient.exe.config 403
23:29:20 127.0.0.1 GET /smartclient/en-US/myclient.resources.DLL 404
23:29:20 127.0.0.1 GET /smartclient/en-US/myclient.resources 403
23:29:20 127.0.0.1 GET /smartclient/bin/en-US/myclient.resources.DLL 404
23:29:20 127.0.0.1 GET /smartclient/bin/en-US/myclient.resources 403
23:29:20 127.0.0.1 GET /smartclient/en-US/myclient.resources.EXE 404
23:29:20 127.0.0.1 GET /smartclient/en-US/myclient.resources 403
23:29:20 127.0.0.1 GET /smartclient/bin/en-US/myclient.resources.EXE 404
23:29:20 127.0.0.1 GET /smartclient/bin/en-US/myclient.resources 403
23:29:20 127.0.0.1 GET /smartclient/en/myclient.resources.DLL 404
23:29:20 127.0.0.1 GET /smartclient/en/myclient.resources 403
23:29:20 127.0.0.1 GET /smartclient/bin/en/myclient.resources.DLL 404
23:29:20 127.0.0.1 GET /smartclient/bin/en/myclient.resources 403
23:29:20 127.0.0.1 GET /smartclient/en/myclient.resources.EXE 404
23:29:20 127.0.0.1 GET /smartclient/en/myclient.resources 403
23:29:20 127.0.0.1 GET /smartclient/bin/en/myclient.resources.EXE 404
23:29:20 127.0.0.1 GET /smartclient/bin/en/myclient.resources 403


Looks like the resolver is going wild with my HTTP connection. I'm researching this behavior. Any feedback would be much appreciated.

2003-02-17

VBTV

VB.NET is okay, but VBTV is just too funny. Check out the latest episode.

At VSLive's midnight madness Ari was asked to pull out his AmEx and buy everybody a round of drinks (they were selling them for 7 bucks a bottle). Afterwards I saw Ari in the hallway signing the sales slip. I commented "they really made you do it, huh?". He turned around and said, "I hope I don't loose my job =)". He sat down with me and talked shop with me a bit. Ari is pretty cool along with thier show. Check it out.

Pyra + Google = Goodness

Wow! From this to this.

Google's buying Pyra labs, the company that created Blogger.com. This is interesting news. What could google do with all that content? What would they want to do? Google's search engine produced better searches because of the millions of blog posts. What could they do with a considerable portion of them now? I guess we'll see.

Congrats to Ev and Company!