October 2003 - Posts - Jon Galloway

October 2003 - Posts

XAML Emulator?

Wouldn't an Avalon / XAML emulator be great? Kinda like the PocketPC emulator that's part of the MS Embeded Visual Toolkit. Then those of us who didn't get to PDC, don't have Longhorn, but would love to start working with XAML could at least start getting acquainted with it.

Of course Avalon is a huge project that supports some pretty complex capabilities, but I'd like to try just throwing some buttons on forms and getting my first Hello World going. Since it's XML based, it would seem like a rough emulator could be built with some XSL to build an ASPX HTML page with System.Web.UI or even .NET (I mean WinFX) UI components, right? I'm probably missing something that makes this more complex.

I guess there's another option - buy the PDC disks and find a spare computer to install Longhorn.

Update: Quoth DonXML “We (the SharpVectors team) are going to try to update our open source SVG .Net rendering engine to be able to handle XAML. If anyone would like to lend a hand please contact me.” Woo hoo!

Posted by Jon Galloway | with no comments
Filed under:

ASP.NET New Web Project System

As a full time ASP.NET developer, this is one of my favorite Whidbey features: ASP.NET offers support for File System and FTP projects, and much smoother Local IIS integration. That's going to save me tons of time and aggravation.

The DLL location process (probing) used for .NET Windows applications has always pretty durned sophisticated. The ASP.NET method, on the other hand, is pretty simple - go to the app root, look for a sub-folder called bin, and that's where the DLL's must be. I've always wondered why, every time I popped open the IIS MMC.

It's not because it's impossible to determine other likely locations - the web.config can be in any any subdirectory in the path hierarchy. More likely was that (1) there's some kind of security or permission issue I haven't considered, (2) that I'm the only person this bugs, or (3) this was lower priority than other features that have made it to the platform to date. I'd hoped it was the third...

Now, it's not like this is much of a problem when you're creating a new web app - VS.NET creates the a virtual for you. So, what's the problem?

1. Complicates deployments - Web Setup Projects can simplify the process, but the fact is that setting up a new web app means getting on the server - not the XCOPY deployment model .NET uses elsewhere. Desktop app setup got simpler with .NET, and Web app deployment acutally got harder - ASP deployment was just copying files, which were all self contained. This is more painful if you're working on a big team, on lots of ASP.NET apps.

2. Sample code / projects require installation - Desktop / Console apps are simple; ASP.NET apps require several steps: (1) copy to a folder (2) set up a Virtual Root with IIS Application (3) edit the webinfo and sln files to point at your virtual, if you plan to open the solution instead of the project.

ASP.NET projects use the IIS Application as a process boundary, a means of keeping Sessions and Applications separate between Apps, etc. - see Paul Wilson's excellent articles about IIS Applications and ASP.NET Specifics and IIS Applications and Virtual Directories. I wonder how the new Web Projects handle this?

The new Web Projects can run from a file system path (independant of IIS) or FTP location. The local IIS config looks like it ties in better with IIS on site creation - I really hope this integration also improves upon the current “sorry, we can't find the project url even though you just double clicked on it” dialog...

Posted by Jon Galloway | with no comments
Filed under: ,

Fix and Continue...

C-based language developers don't want Edit and Continue, right?

Unless they're coding on a Mac (OSX Panther release)...

Fix and continue
Waiting for single-fix turnarounds — stop app, fix bug, compile changes, link objects, run app — is unquestionably the biggest hit to your productivity. But Xcode’s fix and continue feature gives you near-instant turnaround while debugging by letting you make changes to apps while they are still running. You simply make the edits, save the code, compile it and instantly see the change take effect in your application running live in the debugger.

VS.NET product team: Fix VS and continue. ;-)

Flame Retardant Note: I'm not trying to start the whole EnC argument back up. I miss the hell out of it, though, and hope it gets in VS soon.

Posted by Jon Galloway | with no comments
Filed under:

Repeater ItemCommand Won't Fire without ViewState

There's something fishy going on between Repeater ItemCommands and ViewState. I had some asp:LinkButton controls in a HeaderTemplate that just wouldn't fire... until I enabled ViewState for the Repeater control. Once I knew that it had something to do with ViewState, I was able to see that others have run into this.

Odder still, others had experienced the opposite - ItemCommand only fires if ViewState is disabled.

It's easy to Google this up once you know to search on Repeater ItemCommand ViewState, but if you don't know that ViewState's the issue (and why would you?) it's a head scratcher.

Update: Clint Simon set me straight on this one:

“This is because on a postback the linkbutton that is inside your repeater doesn't exist unless you rebind the repeater. If viewstate is off the server can't fire the linkbutton.click event because the linkbutton doesn't exist in the control tree.

You can safely set enableviewstate to false on the repeater if you make sure to rebind the reapeater on each request weather there is a postback or not.”

Posted by Jon Galloway | 23 comment(s)
Filed under:

VS Macro won't run to EOF - RegEx Find / Replace to the rescue

I needed to generate insert scripts using values from an Excel file - one per row, hundreds of rows. I exported to CSV, opened in VS.NET, and got ready to run a macro to pop some SQL before and after each line in the CSV. I recorded my macro and went looking for the “Run to end of file” menu item... not there! The only ways to repeat a macro for each line in a file is to hit CTRL-SHIFT-P hundreds of times or to edit the Macro manually and make it loop (which for some reason runs more slowly than typing each letter in with one finger).

That was a surprise - UltraEdit has “play until end of file”, and I seem to remember a lot of other editors having it, too.

I was debating whipping up a snippet in SnippetCompiler or manually running my macro hundreds of times, when I remembered how Regex Find / Replace had helped before. Sure enough...

Find: ^
Replace: INSERT INTO table (column, column, column) SELECT value, '

and

Find: $
Replace: ', value;

The ^ matches the beginning of every line; the $ matches the end of every line. An added bonus is that the RegEx find / replace is lightning quick.

Posted by Jon Galloway | with no comments
Filed under:
More Posts