ASP.NET Hosting

Archives

Archives / 2005
  • PageMethods for VS 2005 updated to version 1.5.1

    PageMethods for VS 2005 has been updated with various fixes and improvements. Note that an FAQ is now available.

    Please update your version. Please uninstall the previous version first.

    Details about the updates since the official release:

    • version 1.5.1.0 (bug fixes and improvements)
      • It is now possible to activate and deactivate the PageMethods add-in directly from projects' properties, without having to proceed through the Web.config file.
      • PageMethod's strong-named assembly can now be called in shared web hosting environments (details).
    • version 1.5.0.2 (bug fixes)
      • PageMethods was not handling correctly projects under IIS.
    • version 1.5.0.1 (bug fixes)
      • Take into account the additional namespace added in Web.config when using the ASP.NET Configuration tool, as described here.
      • Added some code to keep Intellisense (code completion) more in sync with your modifications.
      • Added some code to avoid problems with some kinds of projects (like SQL Server Reporting Services projects).

  • New old web project model option for VS 2005

    A new -old- web project model option is coming for VS 2005
    The ASP.NET team takes a look back at VS 2003's model for web projects and adds an option to Visual Studio 2005 to use the same kind of model. This has been requested by several users when the new model (no project file, multiple assemblies, App_Code folder, etc.) was introduced.
    It looks like this new option can be the best of both worlds, as it still lets you take advantage of the new VS 2005 WYSIWYG designer changes (no more html reformatting, master page/theme designer support, etc), as well as all the improvements made in the html source editor, and it lets you use VS 2005's built-in web server and MSBuild.

    See also the new Visual Studio 2005 Web Deployment Projects

    Congratulations to the ASP.NET team for its newly gained agility!

    Update: this new model is available as a preview.

  • Next Action, todo-list tool and great single page application that runs locally

    Ajax? Why ajax? This guy at TrimPath has different applications: they run entirely in the browser. He calls them SPADE, single page applications that include a built-in development environment.
    Just take a look at Next Action for example, a Getting Things Done todo-list tracking tool.

    Over at TrimPath.com, you'll also find open-source components to build this type of applications. These crazy things include:

    • JavaScript Templates, which lets you have template-based programming (like PHP/ASP/JSP) while running in a web browser.
    • TrimQuery, a 100% JavaScript query engine that features an embeddable SQL syntax.

  • PageMethods for VS 2005 released - well-defined URLs for your ASP.NET sites and applications

    PageMethods for Visual Studio 2005 has just been released. This version offers the same support as the version for VS 2003, plus some additional features.
    PageMethods proposes a new code model that enables well-defined URLs and simplifies working with hyperlinks for your ASP.NET sites and applications.

    PageMethods enables reliable URLs.
    Linking to a web page is very easy, both in simple HTML and in ASP.NET. Linking to a page that really exists, passing the right parameters, and parsing these parameters, is a bit different.
    PageMethods takes care of your URLs. It proposes a solution to define structured URLs for each of your pages, as well as a clean and simple way to call them.
    The idea is based on strict page inputs and declarative parameter binding. With PageMethods, each page exposes a set of methods that represent the different ways to call the page. All you have to do to start benefiting from sharp, reliable URLs is to add methods to your pages, and mark these methods with attributes provided by PageMethods.

    Here is how you would declare a page method:

    [PageMethod]
    protected void DisplayCustomer(int customerID)
    {
      ...
    }

    Here is how you would refer to the page declaring this method:

    MyHyperLink.NavigateUrl = MyPageMethods.Customers.CustomerPage.DisplayCustomer(1234);


    Features include:

    • Object-oriented approach for hyperlinks
    • No concatenations of strings required anymore
    • Strongly typed parameters
    • Automated parameter handling
    • Parameter validation
    • Compile-time checks
    • Code completion
    • Integrated with Visual Studio
    • Support for HTTP GET and HTTP POST (new)
    • Support for arrays and custom objects (new)
    PageMethods is available for free.

    Learn more on the dedicated site, where you'll find:
    • an introduction
    • a walkthrough tutorial
    • details about the features and benefits
    • and of course a page to download the product.
    See http://metaSapiens.com/PageMethods

    Don't forget to let me know what you think about the product, and what your experience with it is!

  • Rialto, a cross-browser javascript widget library

    A new cross-browser Javascript widget library is born: Rialto (Rich Internet AppLication TOolkit).

    Here is the description of the project:

    Because it is technology agnostic Rialto can be encapsulated in JSP, JSF, .NET or PHP graphic components.
    Nowadays it supports pure javascript development and JSP/taglib development. A JSF integration is on the road. And we hope to start .NET and PHP integration soon.
    The purpose of Rialto is to ease the access to rich internet application development to corporate developers. Ideally a Rialto developer have neither need to write or understand DHTML, Ajax or DOM code.
    The target of Rialto is corporate web applications and not internet web sites.
    The widgets include: forms, drag & drop, tree, data list with fix header and resizable columns, pop up, splitter,
    Rialto enables single page interface application development. It is available as open source under the Apache License.

    But you'd better take a look at the demo to get and idea of what it can do.
    If you are interested to work on the .NET port, contact the project team.

  • Google Base is live

    Google Base is now live. You can go and play with it.
    I am currently working on a similar project. I had the idea first, but Google somewhat was faster than me. But it will be different and a good competitor to Google ;-) Just wait some more weeks before I unveil it...

  • Google Maps experiment: MapShares

    I've been playing with Google Maps, Ajax, and ASP.NET 2 lately. The result is a fun experiment: MapShares.

    MapShares lets you place advertisement on a Google Maps map of the world. Just click on the map to select a corner of the Earth where you'd like to place your own image, text and link.

    One day, if I have the time, I may try to explain how this site is built. If you need help using Google Maps or need a developer to implement Google Maps on your site, feel free to contact me.

    In the meantime, let's give a try to http://mapshares.madgeek.com

  • Sun is really funny

    Two months ago, I've been contacted by a lawyer who asked me, on behalf of his client - SUN Microsystems, to change the name of my site http://JavaToolbox.com.
    As you can tell from the name, this site references the development tools and libraries, like SharpToolbox does for .NET, but for the Java world.
    Now, tell me, is this site a blatant counterfeit of the Java trademark, as they say? Isn't my site about Java? Isn't it clear for everyone that this site is not related to Sun?

    Have they even looked at the site? I don't think so. You know what? I believe that they don't care. They don't want to support people helping them doing business.

    It's really funny to see how Sun behaves, compared to what Microsoft does to help us, the community, to promote and use their technologies. There are several links from Microsoft sites to mine, I've been named an MVP, I've had direct contacts with Microsoft employees, etc. The only contact I had with Sun: a lawyer!

    On more thing: they spend a lot of money attacking individuals who are not able to defend themselves. But wait, isn't it strange that they do not attack big sites like JavaWorld, Javalobby, JavaBoutique, OnJava, O'Reilly Java, who do not even mention the Java trademark?...

    Update: see also the discussion on TheServerSide.com et sur Application-Servers en français.

  • HTML reformatting and Visual Studio: it's a feature!

    This is a followup to my post on the automatic reformatting of HTML/ASPX that happens in VS 2005. You'll be happy to learn that although it looks like it, it's not a bug at all but a feature...
    At first, when you witness automatic reformatting like this, it feels like something bad happens (again). But thanks to Barry Tang and Scott Guthrie from the ASP.NET team, I'll be able to explain you why this happens. Let me try to summarize the rationale behind this...

    What was happening in my case was that <li> tags that I had on distinct lines were all of a sudden all on one line after me changing something in the Design view and switching back to the Source view.
    For example, when I had something like this:

    <ul>
      <li>aaa</li>
      <li>bbb</li>
    </ul>


    it could become something like this after adding a letter:

    <ul>
      <li>aaa z</li><li>bbb</li>
    </ul>


    The reason for this is that VS 2005 tries not to reformat your code, but it doesn’t want to change your page rendering as well. In this case, not reformatting the HTML source would change the rendering of the page in Internet Explorer (not in Firefox though). This is due to the importance of whitespaces in HTML.

    In most cases, whitespaces are very important. Let's take another example. Let's say you have the following markup in source view:

    <html>
      <body>
        <input />
        <input />
      </body>
    </html>


    If you go to Design view, you will see a whitespace between the two inputs. Now, try removing the whitespace between them and go back to Source view. In this case, if VS preserves the newline between the two inputs when we switch back to Source view, it will put the whitespace between the two inputs right back and that would just undo what you did in design view. That’s why whitespace rules take precedence over formatting.

    Something that may be confusing though is the opposite case. If you have this in source:

    <html>
      <body>
        <input /><input />
      </body>
    </html>


    Then switch to design, then add a space between the two inputs, then switch back to source, what do you get?

    <html>
      <body>
        <input />
        <input />
      </body>
    </html>


    Why is this happening? This is due to another rule: the default behavior for "empty" tags is to have a line-break before and a line-break after. You can see this or change it in "Tools | Text Editor | HTML | Format | Tag Specific Options".
    When you know why it happens, there is no problem. But when you don't, which is highly probable when you first work with VS 2005, you have to admit that it's funny to see that when you expect to have your tags on separate lines you end up having them on one single line, and when you expect to have them on one single line, then end up on several lines!

    I hope this explaination helps you to undertand why we can see some reformatting happen. I'm sure that for everyone who see this at work without this kind of explaination will think it a bug. But it's not, it's actually a useful feature. It's just that it's not an obvious one.
    The thing you have to keep in mind is that ASP.NET and Visual Studio teams think that it is more important to preserve rendering. And I agree with them.

  • Post-Whidbey work for Microsoft

    Microsoft's developer division is now engaging on MQ, a milestone that is post-Whidbey and pre-Orcas that will focus on quality.
    This sounds good. A focus on quality is always good.

    But Eric, are some of you working on the upcoming VS 2005 service pack? It's good to focus on quality at a high level, but a lot of small quick fixes are needed too, and much sooner than Orcas, please.
    It would be good news to see Microsoft really commit on delivering patches for Visual Studio... this time. It's not good to delay fixes to major releases of the products. In the meantime, people are working with your products, and there are known bugs that could be fixed with intermediate releases or patches.

  • Ever tried Google AdSense to get some money from your sites?

    Of course, everybody knows about Google AdSense, the program that allows to monetize your web sites...
    Well, now they have a referral program, hence the picture you can see on this weblog's menu.
    Until now, I've been very happy with AdSense on my own sites and on this weblog. If you plan to use AdSense yourself, feel free to click on my referral banners. That would be nice :-)

  • Microsoft is big. A big follower.

    I've just read an interesting post from Scoble (a Microsoft employee) where he writes that Google has disrupted the businesses of Yahoo and Microsoft.

    This got me thinking one thing about Microsoft. For Microsoft employees, everything should be Microsoft and Microsoft should be everywhere.
    The problem for them is that the world is moving so fast nowadays that they can't keep up and are lagging behind. Last time I saw Steve Balmer, he was all after Google and Yahoo. It's a real obsession, a blinding one I'd say. And we can now see the results and where Microsoft is heading.

    How come Google is so strong nowadays? Did they try to copy something? Well, now they are, on some projects, because they can't stay in there own corner and have no choice but to compete with some other market players. But at the beginning they came with something disruptive (like Scoble says). Something that turned out big.
    What is Microsoft doing lately? It is running after Google like crazy, trying to duplicate everything Google does (search, map, portal, etc.). The result: lower quality products, no innovation. Why can't Microsoft come up with something new, something original, instead of trying to be everywhere, and in the end going nowhere? Come on guys, you can do better.

    If we look at live.com for example, it does not look good. No Firefox support? You gotta be kidding? Crashing IE? Great!...
    Experiences like this will harm Microsoft's image. This company already looks like a follower. Now it will look like a bad one.

    I am not a Microsoft employee, so I don't really care. I just find it interesting. It's fascinating to see all this happen from an outside viewpoint.

    Update: Scoble has another post about the subject.

  • Windows everywhere, step 2

    Windows Live: Scott Hanselman doesn't get it.
    I don't need these products either, we have other products elsewhere.

    But my point is that I'm not so sure the new "Windows" branding everywhere will be good for adoption...
    This change is already happening for developers, as we noticed already, but I do not think that it's such a bright idea. I think it's even worst for web sites and general consumer products. How do you feel about search sites or webmail sites that are tied to the Windows name?

    Update: I've just tried live.com... With Firefox: "Firefox support is coming soon. Please be patient :-)". Silly. But wait. With Microsoft Internet Explorer: "IEXPLORE.EXE - Application Error - The instruction at "0x63644648" referenced memory at "0x0000001c". The memory could not be "read". - Click OK to terminate"!!! No comment.

  • HTML reformatting and Visual Studio: it's not over!

    I thought one of the high priorities for Visual Studio 2005 was to get rid of the reformatting of HTML or ASPX code... But I was wrong! I am currently working with the RTM version, and to my great dismay, I can see that Visual Studio still kills my tags' layout and reformats it without notice.
    This is really bad news. I thought we would be freed from this pain :-(

    Update: the explaination is available.

  • Virtual machines everywhere

    The Visual Studio Hosted Experience allows you to either evaluate Visual Studio, or learn how to build applications for Windows and the Web with the MSDN Virtual Labs. Multiple subjects are covered, but what is interesting is that it lets you use a virtual machine to test the products.

    This really looks like the future to me: no need to own a physical machine, but instead multiple virtual machine you can get access to from anywhere.
    Join and use your personal workstation from the airport, from an Internet café or from wherever you want! No need to reinstall or setup everything each time you arrive somewhere. Access your office machine right from your laptop through a wireless connection.
    Soon, you'll have a virtual machine for working, one for gaming, one with VS200X, one with SQL Server 200Y, and they can be active at the same time and see each other. Preconfigured virtual machines will be available and you'll just have to make a copy to start using them. Backups turn easy: just archive copies of the virtual machines.

    Not a lot is missing to get to this picture. Just a little bit of bandwidth maybe?

    How does this sound? Will we see a new business soon: virtual machine hoster?

    Update: As Eric suggests in a comment, we may indeed carry virtual machines around on USB keys or portable music players.

  • How long will the .NET moniker survive?

    Did you notice that the .NET name is slowly fading away? The new names have nothing to do with it but are attached to Windows instead: WinFX, WinFS, Windows Communication Foundation (Indigo), Windows Presentation Foundation (Avalon), Windows Workflow Foundation (Winoe), etc.
    Ok, this is marketing, but say bye bye to .NET everywhere and hello to Windows everywhere instead. This also means: forget about platform independance...

    BTW, now we have WCF, WPF, WWF... How long before we get WTF? Windows Transaction Framework maybe? or just What The F..

  • Still no tabbed MDI in Firefox?

    Something I miss everyday when using Firefox is Tabbed MDI (à la Visual Studio). I really hope this is something that will be implemented soon, because I often need to have two or more pages side-by-side. I do not want to open one more window - I already have enough windows on the desktop! - I just want to split the current one in two by dragging a tab to one side of the browser.
    I'm pretty sure this will be implemented in IE 7 (Could someone confirm this?). Please Firefox developers, include this.

  • Common ASP.NET 2.0 conversion issues and solutions

    In a timely manner (see the ongoing discussions here or here), Microsoft has released a list of conversion issues when upgrading from ASP.NET 1.1 to ASP.NET 2.0.

    If you are used to 1.1 and plan to move to 2.0, you'd better read this document to learn about the breaking changes and how to fix them!
    Even if a conversion wizard will be delivered with the final release of Visual Studio 2005 to better avoid some of the current known issues by automatically implementing the necessary changes, you still have to know about the changes because a conversion/migration is not a final step: you'll have to actually code with ASP.NET 2.0 and so will face the same issues.

    One more occasion to warn you: moving to ASP.NET 2.0 will not be a smooth process.

  • Microsoft needs to leave the cargo ship and jump aboard a speedboat

    Paschal complains that using Visual Studio 2005 Beta 2 in real world is not that easy.

    I think a lot of teeth grinding is to be expected next year in enterprises when managers wondering why there is a sudden productivity drop will have to hear that people who have been learning .NET for years now need to relearn how to work with .NET and Visual Studio!
    Microsoft is moving slowly lately, in the sense that they prefer big bad updates such as the "VS 2005 / .NET 2 / SQL Server 2005 / Biztalk 2006" pack instead of regular and agile improvements. Where are .NET 1.2, .NET 1.5 or Visual Studio 2004? C# 2.0 has been ready for years and we still cannot use it for production! This is just an example.
    I'm not even talking about LonghornWindows Vista (you know, the one that looks so small in a telescope).

    Apparently Microsoft is aware of the problem and I think we will see some changes next year with the Atlas project or and the .NET Language Integrated Query Framework, which will be delivered as interim releases or upgrade packs... Well, at least I hope so!

  • Free XSLT 2.0 and XQuery engine

    Start working with XSLT 2.0 and XQuery today!

    Still waiting for Microsoft to include XQuery & XSLT 2.0 support? Altova makes the same engines that drive its XMLSpy, MapForce, and StyleVision XML development tools available for use in custom applications – free of charge! Sold!

    AltovaXML is an entirely free download that includes the Altova:
    • XML validating parser
    • XSLT 1.0 engine
    • XSLT 2.0 engine (schema-aware)
    • XQuery 1.0 engine
    AltovaXML features include:
    • Well-formedness checking
    • Validation based on DTD or XML Schema
    • XML transformations via XSLT 1.0
    • Schema-aware XML transformations via XSLT 2.0
    • XML queries and transformations via XQuery
    • Command line operations
    • COM interface
    • Java interface
    • .NET interface
    [via Brian Ritchie]

  • Did I already tell you that I hate the new web project model?

    Let me say it one more time: I hate the new (and improved...) web project model in Visual Studio 2005.
    The more I work with it the more I hate it. Microsoft, please reinstate the previous model for the final release!

    Here are new complaints for the day.
    Because there are no more project files like a .csproj or a .vbproj, you cannot open a web project by double-clicking on the project file. It is also not possible to use drag&drop to open a web project. You have to start Visual Studio first and navigate to the folder you had before your eyes in the Windows Explorer.
    It also not possible to know whether a folder is a web project or not by looking at it, because nothing differentiates it from any other folder.

    The list of new problems goes on and on. Once again these are things we were able to do with the previous versions of Visual Studio, and things we can still do for other kinds of projects with Visual Studio 2005.

    Please let Microsoft know that we'd like the previous model back!

  • Tools for .NET 2.0

    I've just added a new attribute for the tools in the SharpToolbox to indicate whether they support .NET 2 or Visual Studio 2005.
    If you know of a tool that supports .NET 2 and that is not marked as such, please let me know.
    No doubt this attribute will be used a lot very soon!

  • [OT] Is hate commonplace in the USA???

    The host city for the 2012 Olympics was picked. New York was out early and that was a big relief to me, personally. I think New York needs a rest from big events. All that security wears on you.

  • OlympicBoard, site about the Olympic Games

    I would like to announce a new site about the Olympic Games: OlympicBoard.
    This site still needs some work, and we have a lot of improvements we would like to implement in a close future, but it currently already proposes news about the Olympic Games in English, French and Chinese, for 2006, 2008, 2010 and 2012.

    If you are interested in being part of this project and post about the Olympic Games in your own language, just drop us a note. We would be very happy to extend the support for various languages!

    Things are heating up a bit due the vote for the selection of the host city for the 2012 Olympic Games that will happen tomorrow in Singapore. I know a lot of people are eagerly waiting for the decision, especially here in Paris...
    But read all the latest news about the Olympic Games now!

  • Journées "Communautés Microsoft"

    Today, I took part to the Microsoft Open Days event in Paris for and by MVP, MVS/MSP (Microsoft Student Partner), and user group members.
    I gave a presentation about SharpToolbox and .NET tools, with a focus on some tools and tool categories like .NET Reflector, FxCop, software factories and CruiseControl.NET, code generation and Codesmith, object-relational mapping.
    You'll find a link to the Powerpoint document below, but of course it is in French.


    Aujourd'hui, j'ai participé à la journée des communautés Microsoft (OpenDays) à Paris pour et par les MVP, MVS, et groupes d'utilisateurs.
    C'était sympathique de rencontrer les autres membres de ces clubs très select ;-)
    J'ai trouvé les sessions intéressantes et l'ambiance conviviale. J'ai aussi apprécié l'esprit critique des intervenants. Non, ce ne sont pas de gentils petits soldats de Microsoft :-)

    J'ai présenté une session sur SharpToolbox et les outils .NET, en mettant l'accent sur quelques outils et catégories d'outils tels que .NET Reflector, FxCop, les usines de développement et CruiseControl.NET, la génération de code et Codesmith, le mapping objet-relationnel.
    Vous pouvez consulter le support Powerpoint pour avoir une idée du contenu de la présentation.

    Vous pouvez aussi consulter la présentation sur ASP.NET 2 par Patrice Lamarche.

  • .NET suggestion: add a paraminfo keyword to get information on parameters at run-time

    I have added a suggestion for the .NET framework or the C#/VB.NET compilers in the MSDN Product Feedback Center: "Add a paraminfo keyword to get information on parameters".
    Basically, the idea is to be able to write paraminfo(someparam).Name and paraminfo(someparam).Value to access to information about a parameter at runtime inside a method.

    What do you think about this idea? You can vote for this suggestion if you find it interesting...

  • Interesting stats and viral marketing experiment

    Don't you think this is a nice bell curve, with a short tail?



    These are the stats for a page I put in place about the TransAtlantys hoax, an advertisement campaign based on viral marketing, which claimed a tunnel and train was being built under the Antlantic Ocean. This was just a campaign from a travel company to sell airline tickets from Paris to New-York!
    I think it was an interesting experiment and shows how quickly viral marketing takes on the internet. The first day, there was no result from Google about this hoax; two days after, 16,000; and now more than 100,000. The traffic quickly reduced starting on June 3, because this is the day when the hoax was revealed on the official site. You can also see "holes" during the week-ends (4-5 and 11-12).
    What's nice is that my page is ranked number 2, just after the official site :-)

  • ASP.NET hosting solution with gigabytes of disk space!

    If you've been reading this weblog for some time, you may remember that I wrote about a web hosting solution with ASP.NET support. This is just a note to let you know that they now propose from 1000MB to 3000MB of disk space and from 2000MB to 3000MB of SQL Server space for the same price!
    They also recently upgraded their mail system (POP and IMAP) with features like SSL, SPAM protection, virus protection, and more.
    Ah, and they have ASP.NET 2.0 beta...
    I definitely invite you to take a look at them.

  • Visual Studio 2005 and web projects : no good

    Chris Szurgot writes about the problems and frustrations with the new model Microsoft has chosen for web projects in Visual Studio 2005: no web project file!
    The decision to remove the web projects is really a bad choice and a big source of problems. I can't believe Microsoft decided to step back like this just to seduce PHP developers and in fact ignore the enterprise world! This would have been fine for the Express editions, but why changing this for the professional editions too?!
    For those who haven't tried Visual Studio 2005 yet, what happens is that there are no project files for web projects anymore. Why is that a problem? Well, it introduces a whole new set of problems: Where is stored the list of references of your project?  How do you share code between pages? How can one page reference another? etc. Of course, Microsoft engineers have found workarounds for this new situation, but they all make your web projects look and behave differently from other projects, as well as second-class citizens. Without forgetting that this requires that developers re-learn how to work with Visual Studio... Try to explain this to your manager...

    Sadly, it seems to me that it's too late for Microsoft to change the way it works in VS2005, but I would certainly prefer to see it happen. I'm sure they have realized their mistake, but cannot go back...

  • Google Content Blocker

    Google releases new services at an impressive rate. Here is the last one: Google Content Blocker. Of course, it's still in beta - like any other Google service as you'd expect - but it looks very useful. The best ever, in fact!

  • PageMethods released - well-defined URLs for your ASP.NET sites and applications

    PageMethods for Visual Studio .NET 2003 has just been released.

    PageMethods (code name was sharpUrls) enables well-defined URLs for your ASP.NET sites and applications.
    Linking to a web page is very easy, both in simple HTML and in ASP.NET. Linking to a page that really exists, passing the right parameters, and parsing these parameters, is a bit different.
    PageMethods takes care of your URLs. It proposes a solution to define structured URLs for each of your pages, as well as a clean and simple way to call them.
    The idea is based on strict page inputs and declarative parameter binding. With PageMethods, each page exposes a set of methods that represent the different ways to call the page. All you have to do to start benefiting from sharp, reliable URLs is to add methods to your pages, and mark these methods with attributes provided by PageMethods.

    Features include:

    • Object-oriented approach for hyperlinks
    • No concatenations of strings required anymore
    • Strongly typed parameters
    • Automated parameter handling
    • Parameter validation
    • Compile-time checks
    • Code completion
    • Integrated with Visual Studio .NET
    PageMethods is available for free.

    Learn more on the dedicated site, where you'll find:
    • an introduction
    • a walkthrough tutorial
    • details about the features and benefits
    • and of course a page to download the product.
    See http://metaSapiens.com/PageMethods

    Don't forget to let me know what you think about the product, and what your experience with it is!

  • Playing with Flickr and Google Maps

    A lot of people have been hacking Google Maps lately, and I thought I had to play the game too :-)
    Another great site is Flickr, which propose a great way to share pictures.
    I wrote a small service that lets you see your Flickr pictures on a Google map.
    Feel free to use it, and let me know what you think.

    Update: fixed a few things; files were missing.
    Update: I just noticed Geobloggers, which is quite similar actually.

  • Feature addiction

    Funny how quickly you get used to new features. Looking at a map on a web site, I found myself trying to drag the map with the mouse, à la Google Maps...
    Conclusion: even if at first sight some features may look like gadgets, your mind can get addicted to them anyway and they become key differentiating features.

  • Hosted source control

    In case you need to host your code online, mostly for open source projects, here are some providers you can try:

    Notes:
    • Not all accept closed source projects.
    • Not all support binary releases.
    • Most offer more services than just source code hosting: forums, bug tracking, task management, project web site, etc.
    Page sponsored by A2 Hosting

  • How to handle unhandled exceptions in Windows Forms

    If you've already handled unhandled exceptions in your Windows Forms applications, your probably know the Application.ThreadException event. Thanks to this event, all you have to do is to:

    1. Register a handler for the event
    2. Handle the exception in this event handler
    Here is an example:
    [STAThread]
    static
    void Main()
    {
      Application.ThreadException += new ThreadExceptionEventHandler(Application_ThreadException);
      Application.Run(new FrmMain());
    }

    private static void Application_ThreadException(object sender, ThreadExceptionEventArgs e)
    {
      MessageBox.Show("Unhandled exception: "+e.Exception.ToString());
    }

    If you want to reuse the default dialog box, you can use the following code:
    if (SystemInformation.UserInteractive)
    {
      using (ThreadExceptionDialog dialog = new ThreadExceptionDialog(exception))
      {
        if (dialog.ShowDialog() == DialogResult.Cancel)
          return;
      }
      Application.Exit();
      Environment.Exit(0);
    }

    This is all fine and easy, but what if you have several threads? What if an exception is thrown in a thread other than the main one?
    Well, the answer is simple: you won't be notified by the Application.ThreadException event.
    Of course there is a solution: you can use the AppDomain.UnhandledException event instead. There is one thing to be aware of though: your event handler will be executed by the thread that threw the exception. This can be a problem if you want to display something or interact with graphical components, because all this kind of actions should be performed in the same thread (the main thread).

    Here is a code sample that shows a complete solution that takes care of this:
    private delegate void ExceptionDelegate(Exception x);

    static private FrmMain _MainForm;

    ///
    <summary>
    ///
    The main entry point for the application.
    /// </summary>
    [STAThread]
    static
    void Main()
    {
      _MainForm = new FrmMain();
      AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(AppDomain_UnhandledException);
      Application.Run(_MainForm);
    }

    private static void AppDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
    {
      Exception exception;

      exception = e.ExceptionObject as Exception;
      if (exception == null)
    {
    // this is an unmanaged exception, you may want to handle it differently
       return;
    }
      PublishOnMainThread(exception);
    }

    private static void PublishOnMainThread(Exception exception)
    {
      if (_MainForm.InvokeRequired)
      {
        // Invoke executes a delegate on the thread that owns _MainForms's underlying window handle.
        _MainForm.Invoke(new ExceptionDelegate(HandleException), new object[] {exception});
      }
      else
      {
        HandleException(exception);
      }
    }

    private static void HandleException(Exception exception)
    {
      if (SystemInformation.UserInteractive)
      {
        using (ThreadExceptionDialog dialog = new ThreadExceptionDialog(exception))
        {
          if (dialog.ShowDialog() == DialogResult.Cancel)
            return;
        }
        Application.Exit();
        Environment.Exit(0);
      }
    }

    private void ThreadMethod()
    {
      throw new Exception("From new thread");
    }

    private void button1_Click(object sender, System.EventArgs e)
    {
      Thread thread;
      thread = new Thread(new ThreadStart(ThreadMethod));
      thread.Start();
    }

    Nota Bene: You'll have to register a handler for the UnhandledException event for each AppDomain.
    Nota Bene 2: The UnhandledExceptionEventArgs parameter contains a IsTerminating property that indicates whether the common language runtime is terminating. Something to test in order to know what to do with the exception.

    Thanks to Pierrick for the help.

  • How to handle unhandled exceptions in Windows Forms

    If you've already handled unhandled exceptions in your Windows Forms applications, your probably know the Application.ThreadException event.
    This event is simple to use, but cannot be used to handle exceptions thrown in threads other than the main thread.
    If you are working with multiple threads, you can take a look at this short article that shows how to handle unhandled exceptions for multithreaded Windows Forms applications.

  • SharpToolbox feeds in Javascript for your sites

    This has been up on this weblog for quite a while, but I never talked about it. If you want to display SharpToolbox' latests additions and updates on your site without having to deal with the RSS feeds, you can use this simple HTML block:

    <script src="http://z.sharptoolbox.com/js/latest.js"></script>

  • Simulated multiple inheritance pattern for C#

    David Esparza-Guerrero has a trick to simulate multiple inheritance in C#. This is not a perfect solution, but it's interesting to look at.
    Too bad we can't use the same approach (using the implicit operator) to have classes implement interfaces by delegation just like Delphi does with the implements keyword. Compiler error CS0552 states that "You cannot create a user-defined conversion to or from an interface" :-(

  • The Business of Software for microISVs

    I've been following the discussions about microISVs for a little while now, and there are some good sites on the subject.
    microISVs are usually one-developer Independent Software Vendor companies.

    A good place for discussions is The Business of Software, hosted by Joel on Software and Eric Sink.
    For news and other resources, you can visit microISV.com.
    For articles on the subject, you can should read Eric Sink's great articles:

  • Celestia: free space travels

    If you like to travel, this is for you...
    This is great software with endless possiblities. You can follow satellites, view planets in real-time, watch eclipses back in time, etc.

    Celestia is a free space simulation software that lets you explore our universe in three dimensions. Celestia runs on Windows, Linux, and Mac OS X.

    Unlike most planetarium software, Celestia doesn't confine you to the surface of the Earth. You can travel throughout the solar system, to any of over 100,000 stars, or even beyond the galaxy.
    All movement in Celestia is seamless; the exponential zoom feature lets you explore space across a huge range of scales, from galaxy clusters down to spacecraft only a few meters across. A 'point-and-goto' interface makes it simple to navigate through the universe to the object you want to visit.
    Celestia is expandable. Celestia comes with a large catalog of stars, planets, moons, asteroids, comets, and spacecraft. If that's not enough, you can download dozens of easy to install add-ons with more objects.

  • New date for Visual Studio 2005 Beta 2

    There is a new date for the release of Visual Studio 2005 Beta 2, and this time it is no April Fool's stupid joke ;-)
    According to http://www.microsoft.com/emea/msdn/betaexperience/, we should have something in our hands the 25th of April.
    This is for EMEA (Europe, Middle-East, Africa), so there may be releases sooner for other regions.

    What can you expect from the Beta Experience?
    • Visual Studio 2005 Team System Beta 2
    • Team Foundation Server Beta 2
    • WeFly247 training DVD
    • SQL Server 2005 Standard Edition Community Technology Preview
    • The Beta Experience newsletter (6-weekly, terminated with the launch of the final version of Visual Studio 2005)

  • Visual Studio 2005 is out!

    VS 2005 and .NET 2.0 are finally released today!
    Microsoft realized it wouldn't be possible to meet the deadlines and get full versions out before the end of the year, and so give a sense to the 2005 moniker. They decided to release NOW lighter versions with all the basic features we all need and that are ready, and postpone advanced features and all the extra stuff for a later release next year Q1 2006.
    Go to the download page.

  • SharpToolbox is two-year-old

    Two years ago, I started collecting development tools for .NET on this weblog. This list quickly became a web site: SharpToolbox.com.
    Two years after, it references 680 tools including 186 libraries in 49 categories. To date, 33 tools have been flagged as discontinued.
    I believe SharpToolbox is a comprehensive directory of the available tools for .NET. Let's hope its sister site, JavaToolbox, will have the same future.
    I continue to add improvements to the sites. Soon I will improve the search and filter functions.

  • Windows Forms designer and DesignMode property issues

    It's interesting to know how the Windows Forms designer in Visual Studio loads forms. Did you ever wonder how it is possible for you to design an instance of a form while the underlying class is not completed and compiled? Raghavendra Prabhu explains how it works.

    One problem that remains unanswered is how to detect a form is in design mode, to avoid accessing to run-time resources. One would think the DesignMode property is the solution.
    Let's consider the following constructor for example:

    public MyClass()
    {
      if (!DesignMode)
      {
        _Connection = new DatabaseConnection("aceofbase");
        _Connection.Open();
      }
    }


    The small problem with the DesignMode property is that it is not always telling the full truth!
    The DesignMode property isn't set to true in the constructor.

    Remember, there's no real magic here.
    Visual Studio .NET creates your object as it parses the InitializeComponent() method. Once the object is constructed, Visual Studio .NET keeps track of the objects it creates, and simply says: newlyCreatedObject.DesignMode = true

    There is no definitive solution to this problem.
    All kinds of workarounds are used.
    • We could call GetService(typeof(IDesignerHost)) and see if it returns something.
    • Other option: test System.ComponentModel.LicenseManager.UsageMode == System.ComponentModel.LicenseUsageMode.Designtime
    • Some are comparing System.Diagnostics.Process.GetCurrentProcess().ProcessName to "devenv" to see if the form is hosted in Visual Studio. But I don't like this one because in many cases it won't work (like with VS add-ins).
    On a related note, Brian Pepin has written about the problems with designing abstract forms.

  • Targeted text ads are getting big!

    Google has just added new features to its AdSense program. Some are very cool like the ability to get money in your currency and directly on your bank account. Goodbye change rates and check deposit expenses!
    Another feature is Ad Links units, which display a list of topics that are relevant to a page. Each topic, when clicked, brings the user to a page of related advertisements.
    You can see how they look like and test them on this weblog. Look on the right. We'll see how they perform money-wise...

    Google also updated its Terms and Conditions to allow users to reveal how much they make out of AdSense. A lot of people already started to release some figures. And then we realize that contextualized text ads are becoming quite a big opportunity, and a full-time job for some.

    New players are starting to challenge Google and its AdSense and AdWords programs: Kanoodle, MSN, Overture/Yahoo!...
    Definitely something to follow and that will heat up in the near future.

  • New game: Tag The Tools

    I've just made an update to the SharpToolbox (and JavaToolbox): you can now tag the tools to help categorizing them.
    This works like del.icio.us. After tags have been added to tools, people can use these tags with the search function to find the tools.
    This should enable a looser classification, which could be better than the current category-based one.

    To tag a tool, go to its page and click on the "Add tags" link. That's all!
    Tags are words used to categorize tools and help people searching for them. Please only add tags that make sense for a specific tool.

    The next step will be to have a Google Suggest-like drop-down list to help using the tags...

  • Introducing sharpUrls - well-defined URLs for your ASP.NET sites and applications

    I'm pleased to introduce sharpUrls, the first product proposed by metaSapiens.

    sharpUrls enables well-defined URLs for your ASP.NET sites and applications.
    Linking to a web page is very easy, both in simple HTML and in ASP.NET. Linking to a page that really exists, passing the right parameters, and parsing these parameters, is a bit different.
    sharpUrls takes care of your URLs. It proposes a solution to define structured URLs for each of your pages, as well as a clean and simple way to call them.
    The idea is based on strict page inputs and declarative parameter binding. With sharpUrls, each page exposes a set of methods that represent the different ways to call the page. All you have to do to start benefiting from sharp URLs is to add methods to your pages, and mark these methods with attributes provided by sharpUrls.

    Features include:

    • Object-oriented approach for hyperlinks
    • No concatenations of strings required anymore
    • Strongly typed parameters
    • Automated parameter handling
    • Parameter validation
    • Compile-time checks
    • Code completion
    • Integrated with Visual Studio .NET
    Current stage is Beta 1. Beta 2 and the final release will probably be available quickly.
     
    Learn more on the dedicated site, where you'll find an introduction, a walkthrough tutorial, details about the features and benefits, and of course a page to download the product.

    Don't forget to let me know what you think about the product, and what your experience with it is!

  • More mappings: Relational Model - Domain Model - Presentation Model

    A new meme is starting to make some buzzing noise.
    Paul Wilson started to talk about UI Mapping in July, and lately more and more people are talking about this concept.
    Mats Helander has a complete series on various mappings (1, 2, 3, and up to 6). Roger Johansson is also talking about the concept and even has a prototype implementation (1, 2, 3).
    Roughly, the idea is to use more mappings than just object-relational mapping, which is used to map your domain objects to a relational database. The first new mapping is between your domain objects and the presentation layer. This means we would have Relational Model <-> Domain Model <-> Presentation Model.
    But I won't try to explain the concept, Roger Johansson and Mats Helander do this very well on their weblogs.

    This goes towards a more declarative approach, and I think we need it because GUI code is the next pain in the neck after data access - a lot of code for nothing.
    No need to say I'll follow this closely and even use it if possible.

  • Logging unhandled exceptions in ASP.NET

    The best solution I've seen for logging unhandled exceptions in ASP.NET is ELMAH (Error Logging Modules And Handlers).
    It is easy to use, the code is clean and well documented.
    But that's not all! The author published with Scott Mitchell an article about ELMAH on MSDN. This article is very good and detailed (as usual with Scott). It's also an occasion to see a good way to make use of HTTP Handlers and Modules.

  • Let ASP.NET know you have a powerful web browser like Firefox or Opera

    By default ASP.NET 1.x downgrades its reponses to lower-level HTML with web browsers other than Internet Explorer 5+.
    The result is that browsers like Mozilla, Firefox, Opera or Safari get a different HTML than IE 6, while they could handle it. As a developer this is a nightmare because when you develop a page with IE, and then test it with Firefox, it looks all broken and you start cursing the Mozilla team and the consortiums in charge of the standards. You end up having to do the work twice, once for IE, once for the other browsers.