On this page

XnaRacingGame.com goes online
XNA Racing Game downloads now available on creators.xna.com
Quo Vadis Conference 2007 Photos
Quo Vadis Conference 2007 (die-entwicklerkonferenz.de)
How to allow web services to be called and tested remotely
Unit testing for web sites
Reusing ascx web controls
Annoying Files Remover Tool
SearchDotNet, a new search site just for .NET Developers
ASP.NET Ajax Template support in Visual Studio Orcas
Installing Visual Studio Orcas March CTP and getting Addins like CodeRush to work with it

MVP

Microsoft MVP (since 2006) in the XNA/DirectX category

Tag cloud

Ajax (8) All (266) Arena Wars (21) Boo (4) BroodWar (10) Conferences (19) dasBlog (2) Development (77) DLR (6) Fun (25) Game Development (164) iPhone (5) IronPython (8) Lost Squadron (17) Lua (10) meinSport.de (4) Other (196) Polynapping (12) Programming (181) Racing Game (11) Reviews (126) Rocket Commander (50) Silverlight (14) SQL (2) StudiHelp.de (2) XNA (60)

Categories

Navigation

Archive

Popular

My Bookmarks
Contact
Migrating ASP.NET VS20...
CR_Commenter Update v1...
A new more effective k...
New Fancy Guide for In...
How to write a CodeRus...
NormalMapCompressor v1...
The year 2005 - Review...
German developer price...
Raid explained.
Quick Tip: Getting rid...

Blogroll

Projects

Arena Wars (2004)

Rocket Commander (2006)

Pizza Commander (2006)

Rocket Racer (2006)

Coop Commander (2006)

Flower Commander (2006)

Fruit Commander (2006)

Euro Vernichter (2003)

Lost Squadron (2005)

Zombie Quest (very simple 2D Adventure, 2006)

Freifunk Hannover project (GoogleMaps support)

Older projects (2000 and earlier)

MeinSport.de - German Sport Community Site

About

About me: Contact

Send mail to the author(s) Email:

Total Posts: 276
This Year: 43
This Month: 1
This Week: 1
Comments: 457
Made with

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

RSS 2.0 | Atom 1.0 | CDF

Sign In

 Friday, April 27, 2007
Friday, April 27, 2007 7:24:34 PM (GMT Standard Time, UTC+00:00) ( All | Development | Game Development | Programming | Racing Game | XNA )

I have put together a little website for the XNA Racing Game Starter Kit released yesterday on
http://creators.xna.com/Education/StarterKits.aspx

Here you go: http://www.XnaRacingGame.com




A little rant about the XNA Racing Game Starter Kit download: The download file is 130 MB in size and will eat up almost 290 MB of your hard disk space extracted. It is also only available in the .vsi format and can't be used in anything but XNA Game Studio Express or Visual C# Express. The main reason for this incredible size is the Textures directory, with uses mainly uncompressed .TGA files. The original Racing Game version had only about 50-70 MB in total with DDS textures and the Simple Racing Game version from my book is even smaller (30 MB I think, but a lot of content is not in there, its a also a much smaller and simplified project).

Microsoft has also removed all credits of me, all readmes, all unit tests, most comments, some screens like the credit screens. It's a little bit sad for me because all references to me or my website were removed and I'm not even mentioned on the starter kit download page :( I think the starter kit is now much harder to understand because there are no unit tests in the code to test anything out. Anyway, I just hope the XNA Racing Game Starter Kit is useful for you guys, it helps XNA and everyone wins :-)

Update 2007-05-01: I'm now mentioned on http://creators.xna.com and happy :)
Comments [14] | | # 
Friday, April 27, 2007 9:28:15 AM (GMT Standard Time, UTC+00:00) ( Development | Game Development | Other | Programming | XNA | Racing Game )

Nice one. The Racing Game Starter kit for XNA Game Studio Express I made last year is now available on
http://creators.xna.com/Education/StarterKits.aspx

More information will be available shortly on the in-official website for the Racing Game (link to the xna creators club, screenshots, mod support and forums later):
http://www.XnaRacingGame.com

Enjoy the Racing Game ;-)

My book Professional XNA Game Programming for the Xbox 360 and Windows seems to be out too. I have not received a copy myself yet, but I received some emails about other guys already holding it in their hands ^^ If you try to download the source code for the book from the Wrox website and encounter problems, please be aware that the download link is currently pointing to an older version, which still has some issues. I will try to sort that out as soon as possible. The official release date was 11 May, 2007, but Amazon says it is already available, while their own release date is stated as 30 April, 2007. Confusing, isn't it?

If you find any issues with the starter kit or the book download please write me a message so I can fix it as soon as possible. Many thanks to ZMan (Andy Dunn) for an early bug report.

Comments [3] | | # 
 Monday, April 23, 2007
Monday, April 23, 2007 12:58:53 PM (GMT Standard Time, UTC+00:00) ( All | Development )
Here are some pics from the Quo Vadis Conference 2007 in Berlin (from last weekend).



This is what the Quo Vadis is about, everything and nothing.


Entering Berlin, bigger roads and bigger houses, other than that not much different than Hannover except for its huge size (in Germany we do not have any big cities except for Berlin).


The "Siegessaeule". Dunno whats that is in English, probably Victory Column, doesn't make much sense, does it?


The Brandenburger Tor .. maybe it would be better if I write this blog entry in German.


And the big TV tower in the middle of the city with a rotating restaurant in the middle.


Finally at the Quo Vadis Conference itself. A lot of people are already here, a lot of familar faces, but not many developers from our region for some strange reason, but all the big guys were there.


The game design lecture about Crysis. It was actually quite nice and the Nanosuit looks like a very polished feature. Hopefully the game design will not suck as much as in FarCry for the second half of the levels.


You really had to concentrate hard in order to get Wifi working. With that many people logging onto the same hotspot, it was not very likely that you get any download through in the middle of the day. In the morning and evening the Wifi Lan was pretty fast and useable.


One of the few technical lectures. This is Intel's Core 2 Duo lecture, which was quite technical with a lot of assembler code and internal tricks. It was very informative.


This is the room I was speaking in. It was a little workshop about XNA and I showed some games and showed how to work with XNA Studio Express.


A little bit of the Racing Game.


And here a bit of the Dungeon Quest game I did last month on the GDC in 4 days. Little dark on a projector in the middle of the day.


And some other games. There was also someone trying out XNA as I was speaking. There was not much interaction with the audience because most people had no questions, but I talked my way through it and I heard some positive feedback about XNA later.


Me in Terminator mode at night when we went to the Quo Vadis Party per train. Maybe my cell phone is as explosive as the one from Terminator 3 ^^


At the Party it was loud and hard to speak, but we met a lot of nice people and the usual suspects. Its always good to know what everyone else is doing because most developers you just meet on such events.


And that's it for this years Quo Vadis, 3 days of lectures and workshops, which turned out to be better than we thought. Especially on day 3 the project management workshops were really interesting.

Comments [1] | | # 
 Wednesday, April 18, 2007
Wednesday, April 18, 2007 8:20:13 PM (GMT Standard Time, UTC+00:00) ( All | Development )



The next 3 days I will be on the german Quo Vadis conference and I will speak a lot about XNA together with my good old Microsoft friend Dirk Primbs. You can find us every day from 14 to 18 o'clock at the "Seminar 10 - Ufo" Room where we will do the Workshop "Hands on XNA". More information can be found in the program on the official Quo Vadis site: http://www.die-entwicklerkonferenz.de

If you are there too and want to meet with me, drop me an email or use the meeting form on the website there. Or just come by. I will also show all the latest projects I have done so far with XNA and .NET, hopefully this attracks more people to XNA, which means more people can buy my book ;-)
Comments [5] | | # 
 Friday, April 13, 2007
Friday, April 13, 2007 10:39:20 AM (GMT Standard Time, UTC+00:00) ( All | Development | Programming )
My blog posts are getting shorter ^^

Usually you can't execute web service methods from the autogenerated web service site remotely to test them. By default you will get the following message where the web service test is supposed to be:
  • The test form is only available for requests from the local machine
Fix this by adding the following to your web.config file of your web service:

<configuration>
    <system.web>
        <webServices>
            <protocols>
                <add name="HttpGet"/>
                <add name="HttpPost"/>
            </protocols>
        </webServices>
    </system.web>
</configuration>


BTW: Any messages in the Test section of the web service site will be "The test form is only available for requests from the local machine" even if the problem is something else, which you will see when testing locally like "The test form is only available for methods with primitive types as parameters.". There seem to be no way around that.
Comments [2] | | # 
Friday, April 13, 2007 8:42:28 AM (GMT Standard Time, UTC+00:00) ( All | Development | Programming )
Just found this by accident: NUnitAsp. Seems to be very useful. I was always wondering why TestDriven.NET does not support testing web sites or services. It gives you the following message if you try to run tests from a website:
  • Can't execute tests in 'Web Site' application.
There are probably other reasons why this does not work yet, but maybe it is possible to find a way around that. Currently I use a extra project and call the web site or web service from there with my custom methods. It looks much cleaner with NUnitAsp. For me it would even be better if I could write and run unit tests directly on the website without that extra project. Maybe I should drop Jamie Cansdale of TestDriven.NET a short message asking him for some support in the future for ASP.NET. There does not seem to be anything on his blog about ASP.NET yet, at least the search returned 0 results.

Here is a little example from NUnitAsp, which shows you how to test a label on a website:

[Test]
public void TestExample()
{
  // First, instantiate "Tester" objects:
  LabelTester label = new LabelTester("textLabel", CurrentWebForm);
  LinkButtonTester link = new LinkButtonTester("linkButton", CurrentWebForm);

  // Second, visit the page being tested:
  Browser.GetPage("http://localhost/example/example.aspx");

  // Third, use tester objects to test the page:
  AssertEquals("Not clicked.", label.Text);
  link.Click();
  AssertEquals("Clicked once.", label.Text);
  link.Click();
  AssertEquals("Clicked twice.", label.Text);
}

Comments [0] | | # 
 Wednesday, April 11, 2007
Wednesday, April 11, 2007 8:50:47 PM (GMT Standard Time, UTC+00:00) ( All | Development | Programming )
After developing and testing some ascx web controls in the past I was woundering why I have to copy them over to a new web project today instead of just referencing them. When you write a normal windows application and then want to reuse some library parts in another project (or if you just want to structurize your app a little bit better) you would obviously use a dll library for the job to share functionality.

Not that easy with web controls. My first thought was just to copy the .ascx and .ascx.cs files over to a new dll project and start compiling. After adding the missing images and scripts the following thing happend:



Well, the code does compile on a website, but in a dll project it will not build the ascx code for you and merge the controls defined there with your .cs file. If you do not define controls or do any visual stuff you can probably just use WebControls instead of UserControls, but you still have to implement the Render method yourself and you just do not have any design support. More information about creating server controls can be found here.

While that solution is probably the cleanest one and has the advantage of hidding the source code and make it easy to just drag and drop controls on your page, it is the hardest to develop. And I already have my .ascx controls working, I just want them in another project without copying them over again and again.

I searched for a while on the web for some solutions, see below for all the links. The best solution for me was the one from ScottGu, which just uses a normal website and then uses a post build copy to get all the files into your current website project. The controls dummy website can then be used all over the place, you just have to add the copy command to each website that should use your controls. This solution might not be the best, so if you have more complex problems, check out the links below.

No reason to repeat all the stuff ScottGu has already written, check out his great article here or here.

BTW: I use this just for simpler web controls or when I have something that needs to be duplicated on some pages. For Ajax controls on the other hand I got a project similar to the AjaxControlToolkit, but there you live without design time editors anyway.

Links:
Comments [0] | | # 
 Saturday, April 07, 2007
Friday, April 06, 2007 11:25:01 PM (GMT Standard Time, UTC+00:00) ( All | Development | Other | Programming )

AnnoyingFilesRemover.zip (6.1 KB)

Recently I had to remove a lot of .svn and Thumbs.db files from certain directories because I wanted to move them or someone else had created thumb files (which is really annoying). After deleteing those files by hand a couple of times I decided it would be better to have some tool doing that for me. That should be easy to do, shouldn't it?

I started by opening VS Orcas and coding for a while, but for some reason the commenter plugin for CodeRush was not working anymore, which already annoyed me. Then the Intellisense crashed several times, but VS Orcas did not close, which was a nice feature. But without CodeRush it was a little bit annoying to generate all that code by hand and then to write all the comments also by hand. I removed the LINQ test code I used to go through all directories and added some foreach loops (just 2 lines more, how cares) and went back to VS 2005 for this project.

The next big problem was the removal of read-only files and directories, which is just not allowed in the .NET framework, you will get the following exception:

System.UnauthorizedAccessException occurred
  Message="Der Zugriff auf den Pfad entries wurde verweigert."
  Source="mscorlib"
  StackTrace:
       bei System.IO.Directory.DeleteHelper(String fullPath, String userPath, Boolean recursive)
       bei System.IO.Directory.Delete(String fullPath, String userPath, Boolean recursive)
       bei System.IO.Directory.Delete(String path, Boolean recursive)
       bei AnnoyingFilesRemover.RemoverForm.SafeDeleteDirectory(String directory) in C:\code\Communities\AnnoyingFilesRemover\RemoverForm.cs:Zeile 153.

The MSDN help for Directory.Delete gives you the explanation that this happens because you are trying to delete a read-only file.

   UnauthorizedAccessException: The caller does not have the required permission.

This is only half the story because if you look in File.Delete you see a more detailed error explanation:

    UnauthorizedAccessException: The caller does not have the required permission.

    -or- path is a directory.

    -or- path specified a read-only file.


And the directory I wanted to delete was ".svn", which is read-only and hidden. An easy way around that is to change the directory attributes. But that won't help if there are still files in the directory because you will still get the same error. Instead you have to replace all the file attribute for all sub directories and files too. I wrote the following method to do that.

#region RemoveAllAttributes
/// <summary>
/// Helper to remove all file and sub directory readonly attributes
/// to make SafeDeleteDirectory work!
/// </summary>
/// <param name="directory">Directory to change (will be deleted later
/// anyway)</param>
private static void RemoveAllAttributes(string directory)
{
    // Get all files and sub directories.
    string[] files = Directory.GetFiles(directory);
    string[] directories = Directory.GetDirectories(directory);

    // Kill all attributes, make files normal and directories just directories
    foreach (string file in files)
        File.SetAttributes(file, FileAttributes.Normal);
    foreach (string dir in directories)
        RemoveAllAttributes(dir);

    // Finally set the main directory to a normal directory!
    File.SetAttributes(directory, FileAttributes.Directory);
} // RemoveAllAttributes(directory)
#endregion


The rest of the tool is easy to understand and there is nothing special about this tool except that I find it very useful right now. It is also very fast, I let it run over 20 000 files and it was done immediately and had deleted several hundert files in the process. Again: Be careful what you type in the filters textbox and save important directories before messing with them.

As always, here is the download and source code (both in .NET 2.0 since I have removed all LINQ features that were not important for this project anyway):
Comments [2] | | # 
 Wednesday, April 04, 2007
Wednesday, April 04, 2007 4:48:03 AM (GMT Standard Time, UTC+00:00) ( All | Game Development | Other | Programming )


I just heard this on the DotNetRocks podcast, where Dan Appleman talks about Discoverability with Carl and Richard. He uses Google Custom Search to create SearchDotNet.com (which was created in one day) and the idea is really cool.

You as a .NET developer will only get useful handpicked urls as search results and not any spam or meaningless sites. Dan seems to check every site himself and currently most MSDN blogs and sites are linked in there (as well as MVPs as he tells us on the show, but I could not find direct links to my blog yet).

Anyway, great idea, hopefully it will not die in a few weeks. Google Custom Search looks kinda cool too, have to check that out some time in the future.

Comments [1] | | # 
Wednesday, April 04, 2007 2:41:47 AM (GMT Standard Time, UTC+00:00) ( Ajax | All | Other | Programming )
Yeah, blogging every 5 minutes. I'm really trying to blog more again, let's see how this works out.

Ok, here is there problem: Visual Studio Orcas (March CTP) does support ASP.NET web projects and you can even load and use previously created ASP.NET Ajax projects, but you can't create new projects because the Ajax templates are missing!

The solution: Just point the user projects templates directory to your old VS 2005 project templates directory (or copy the templates over to your user projects template directory) like in the following picture. Make you you have ASP.NET Ajax installed and working in your VS 2005 installation.

Path to set:

    C:\Program files\Microsoft Visual Studio 8\Common7\IDE\ProjectTemplates\Web\CSharp\

Btw: The new path in VS Orcas is:

    C:\Program files\Microsoft Visual Studio 9.0\Common7\IDE\ProjectTemplates\CSharp\Web\

But just copying the files over there will not do it because VS 9.0 will still use the cached templates, which are not updated automatically when you change something there. Just point to the VS 8 template files, that is much easier:




Now you can create new ASP.NET Ajax projects in Visual Studio Orcas with File -> New -> Web Site:

Comments [2] | | # 
Wednesday, April 04, 2007 2:28:26 AM (GMT Standard Time, UTC+00:00) ( All | Game Development | Other | Programming | Ajax )


Today I found some time to install Visual Studio Codename Orcas CTP March 2007 (see below for all the download links), which came out last month. I have worked a lot with ASP.NET Atlas (now ASP.NET Ajax) and LINQ (C# 3.0) before, but they are now beautifully integrated in the latest CTP and intellisense works so much better than in the early days of LINQ, so getting this up and running for future projects would be a good thing since I'm an early adopter anyway.

Initially VS Orcas would not even install at all and I thought maybe my Visual Studio 2005 is messed up because I had some problems with ASP.NET Ajax before and had to repair VS 2005 a couple of times this year already. After completely uninstalling VS 2005 and trying again the same fatal error message was still coming up in the Installer:

Microsoft Web Designer Tools failed .. EventType : visualstudio8setup and then a lot of crazy numbers, which do not help (googleing did not return anything).

As usual clicking on the '
view error log' gets you a site not found page, while the installer creates a couple of log files in c:\something or c:\program files\microsoft visual studio 9\logs\ like "dd_vserror80.txt". Those files look interessting, but they only tell me the exact same crazy numbers and that this component failed. After googleing some more and only finding similar problems like this one I uninstalled everything that could even remotely being used by .NET. After restarting and trying again the exact same freaking error message appeared. Grrr ...

To make a long story a little bit shorter: I finally found out that Office 2007 was the root of all the problems, after uninstalling that one (what the hell does this have to do with web designer tools?) the Orcas installer was working and I could launch the new version:



As you can see it looks the same way as Visual Studio 2005, some colors were just enhanced. As you can also see I'm back to Windows XP just because so many games do not work correctly in Vista and many drivers (hello Nvidia) are still shitty and slow.

TestDriven.NET works beautifully in VS Orcas and the developer Jamie Cansdale really does a great job updating the product so often. He even added VS Express support again recently, which might be cool for XNA Express developers. I also like the relatively new 'Go to Reflector' feature and especially the 'Rerun test' I use all the time.

Other plugins I use like CodeRush, VisualSVN, Explorer, LineCounter and whatever do not show up however. And reinstalling them does not help because the developers of those just did not update the installers yet. I can live without most plugins, but not without CodeRush and my CR_Commenter plugin, so I had to get this working. I thought this would be a long day ahead with all the problems even installing VS Orcas, but it turned out to be quite easy to add your existing VS 2005 addins to VS Orcas.

If you install VS Orcas after VS 2005 and have all your addins already installed it will migrate most of them over to VS Orcas, but if you install VS Orcas first (like I did because I killed VS 2005 before, see above) or install new addins, then you will need the following tricks to make them work in VS Orcas. Some addins like CodeRush will not be added by the VS Orcas installation because it misses the "Addins" (CodeRush 1.x) or "PreloadAddinStateManaged" (CodeRush 2.x) registry keys, but you can easily copy them over from VS 2005 (vs 8.0) to VS Orcas (vs 9.0) the following way:
  • Open up regedit
  • Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\AddIns
  • Search for the CodeRush key and export it
  • If you can't find a CodeRush key here try (probably CodeRush 2.x specific): [HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\8.0\PreloadAddinStateManaged]
  • If you can't find it there either try the reg installers below!
  • Now edit the exported .reg file and just change the \8.0\ to \9.0\ and save.
  • Finally doubleclick the file to merge it with your registry (at your own risk btw ^^)
  • Start VS Orcas and enjoy the DevExpress menu and the CodeRush functionality :)

If you had not installed CodeRush before installing VS Orcas most important registry keys will be missing and you will probably get some "package could not be loaded error" like I did. This will also happen if you install other plugins to VS 2005, which are not installed to VS Orcas like TestDriven.NET does it. Then you have to apply the following process:

  • Open up regedit again (you have to repeat this probably a few more times if you miss any important reg key)
  • Search for your Addin name or navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\InstalledProducts
  • Find your product, it might not be just the name of the product, but something similar (like DXCore for CodeRush).
  • You need to open up the key and copy the internal package GUID (the long ugly id) like {BD359A86-BF88-4c4e-A7D2-6CDDA36C3B79} for DXCore
  • Now search the whole HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\ namespace for this key and export everything to external files.
  • Merge those exported .reg files and replace \8.0\ with \9.0\ like above.
  • Save, import again and start Orcas to test. Repeat until it works ^^
It would probably be better to write some tool for this, especially since there is almost no addin that will install itself correctly to VS Orcas, but I'm too lazy right now and have no time for that anyway. But here are a couple of .reg files I used to restore the 2 most important addins for me:

This will probably only work with the same versions of these addins, but the process is the same if you need other addins to work. I also tested it on vista and it worked there too. Again, if you just installed VS Orcas over your existing VS 2005 installation most addins will be copied and work out of the box. And even addins like CodeRush can easily be fixed with the tricks above. You probably won't need the .reg files here, but they may still be useful for someone and if you need additional addins to work.

I hope this helps if you want to work with VS Orcas too. It did not crash at my computer yet and I did some nasty things to the registry ^^ It only crashed once at my colleagues computer so far (and we both set the AutoRecover to 2 minutes just in case, we were early adopters for VS 2005 too and learned our lessons).


Links:
Comments [2] | | # 

Search

Games, Tools & Code

XNA Racing Game

CR_Commenter

NormalMapCompressor

Search XnaProjects.net for all my XNA projects

XNA Shooter

RocketCommander + Mods

AbiKeyboardLayout

Current projects

Dungeon Quest RPG (coming soon)

My book: Professional XNA Game Programming (May 2007)

MeinSport.de - German Sport Community Site