April 2003 - Posts

First attempt to post using w.bloggar

I just wanted to see if this works.
Posted by cloudycity | with no comments

Adding categories

I've seen that several people are adding categories to their posts.  I have been thinking about what I'm interested in CURRENTLY (this seems to change fairly quickly - since I don't have a significant project in mind) as far as .net and beyond:

  • Smart clients - and all that
  • Security
  • Tools - Build, Testing, Performance
  • More more more ...

Actually I created a fairly complicated "mind map" http://www.mindjet.com to try to get a place to start.

I'm not sure that I'm going to use it, but I do have a 'rants' and 'whines' category.  I have ranted before but really don't wont to continue down that path. Not a very useful way to spend my time.

Just playing around here. 

Posted by cloudycity | with no comments

Smart clients and IE hosting

As part of my investigation of smart clients and security, I got a little side-tracked, not much really, into wondering about hosting winform usercontrols in IE.

The first thing that I learned was that this only works with IE.  I don't know if this is a big deal or not - depends on the application I suppose.  For my learning experiments and how I am applying this stuff to my work applications it doesn't matter.

A friend asked my about embedding .net into web applications similar to the way active-x is done.  I thought that it was possible - I had read that it was, but as usual until I try something it is really a black hole - doable, sure, but ...

I had a Chart recorder winform that I downloaded from somewhere.  I kinda wish the person that wrote it had put their name in the code - I would like to attirbute code that I've stolen. 

I converted the winform to a UserControl - stripping out some extra ui stuff to just get the chart recorder.  For testing I embedded it in a winform and all worked fine.

Then I created an html page and embedded it.  I created a vdir for this project and ran the user control with IE and my html page as the debugger.  Didn't run!  There is a timer that is normally started that runs the chart paper. What is going on?  My first thought was some kind of permissions thing.  I soon sent off an email to my favorite mail list "wintech off topic" and was asked about which timer I was using to cause the chart recorder to move.  I was using System.Timers.Timer.  I switched to System.Winforms.Forms.Timer and it still didn't work - except when IE is hidden under another window.  Interesting. 

Debugging using IE is interesting.  I received a link to this http://urbanasylum.dynu.com/JustTheFacts/archives/000092.html which has helped.

I uploaded my project to my web hosting site (brinkster) and tried it.  Nothing works even hiding ie. 

Anyway, that's where I am today.  This is fun.

Posted by cloudycity | 3 comment(s)

probing and bindingRedirect confusion

I am trying to understand both these subjects.  I am reading Don Box and re-reading portions of Richter. 

I created an exe CLRLoader with two class library projects Dll0, Dll1.  Both of these build MyAssembly.dll.  I created and added a strong name.

The main has this:

Assembly a = Assembly.Load("MyAssembly, Version=0.0.0.1, Culture=neutral, PublicKeyToken=a624f2519c903ae6");

a.CreateInstance("CodeAccessSecurity.CLRLoader.MyAssembly");

Of course this fails since the CLR doesn't know how to find MyAssembly.  So I created an app.config as follows:

<?xml version="1.0" encoding="utf-8" ?>

<configuration>

<runtime>

<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1" >

<probing privatePath="Dll0;Dll1" />

</assemblyBinding>

</runtime>

</configuration>

Now this works fine.  It is interesting to use the Fusion Log viewer and delete the dlls and run the program. Deleting one cause the CLR to find the other, and vice versa.  Works as advertised.

Now I want to play with bindingRedirect.  I modified Dll1 to have a version of 1.0.0.1 instead of 0.0.0.1 and updated my app.config by adding

<dependentAssembly>

<assemblyIdentity

name="MyAssembly"

publicKeyToken="a624f2519c903ae6" culture="neutral" />

<bindingRedirect oldVersion="0-0.0.0.1" newVersion="1.0.0.1"/>

</dependentAssembly>

My 1.0.0.1 dll is not found given the privatePath I was using.  Switching it to Dll1;Dll0.  The correct dll is now found.

For the original case: Dll0;Dll1 - I am trying to understand why it failed.  The fusion log finds the 1.0.0.1 dll in Dll0 first, loads it and quits with:

LOG: Attempting download of new URL file:///C:/tomr/projects/CodeAccessSecurity/CLRLoader1/Dll0/MyAssembly.DLL.
LOG: Assembly download was successful. Attempting setup of file: C:\tomr\projects\CodeAccessSecurity\CLRLoader1\Dll0\MyAssembly.DLL
LOG: Entering run-from-source setup phase.
WRN: Comparing the assembly name resulted in the mismatch: Major Version
ERR: The assembly reference did not match the assembly definition found.
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.

I guess I expected it to continue to Dll1 where it could find the correct dll.  Oh well, a lot more to learn!

Posted by cloudycity | with no comments

Smart Clients

I have an application used for deploying (push or pull) code bits to servers.  It has worked ok.  Unfortunately because of the way our QA dept. wants to work they want to push from the build server to their test servers.  They have to log into the build server using remote desktop or terminal services.  As I say this works ok, but, on qa deploy day it is difficult to get to "my" build machine.  For several reasons (mostly cheapness) we can only have two terminal services connections plus the console, of course.  We always have problems on qa deploy day.

So, I created an installer so that they could put the deploy tool on their servers and pull the build.  They have lots of servers and the number is growing.  If I find a bug they have to update all their machines.

My first thought was to create a Web app the would do a push deploy from the build server, but even easier smart clients.  Make my tool available on the lan. Users would still have to install a simple security policy but not my code.  Of course all the libraries now need strong names.

All this was pretty easy and works great.

Posted by cloudycity | with no comments
More Posts