Categories

Navigation

MVP

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

Tag cloud

Ajax (8) All (206) Arena Wars (21) Boo (4) BroodWar (8) Conferences (1) Development (44) Game Development (142) IronPython (3) Lost Squadron (17) Lua (6) meinSport.de (4) Other (150) Polynapping (12) Programming (156) Racing Game (7) Reviews (76) Rocket Commander (49) Silverlight (10) SQL (1) StudiHelp.de (2) XNA (40)

On this page

What to do if you receive the System.Runtime. InteropServices.COMException error in Visual Studio
Silverlight 1.0 Final Released
Migrating from Silverlight 1.1 alpha to 1.1 alpha refresh and that lovely AG_E_RUNTIME_ HTML_ACCESS_RESTRICTED error
Silverlight 1.0 RC and 1.1 Alpha Refresh released
VS 2008 and .NET 3.5 Beta 2 Released
Silverlight Error Codes Explained!
Fixing the Sys.Res. namespaceContainsObject error with ASP.NET Ajax+Silverlight
Silverlight and Web Services
RegionAddin to fix collapsing and expanding regions in Orcas and IronPython region support!
Debugging Silverlight in Visual Studio

Archive

Popular

My Bookmarks
CR_Commenter Update v1...
Contact
A new more effective k...
Getting XNA to work in...
How to write a CodeRus...
NormalMapCompressor v1...
English Rocket Command...
Migrating ASP.NET VS20...
The year 2005 - Review...
Rocket Commander V1.1 ...
New look for www.exDre...

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: 213
This Year: 9
This Month: 0
This Week: 0
Comments: 403
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

My brothers

netfreak.de

mirkman.de

Sign In

 Monday, January 28, 2008
Monday, January 28, 2008 3:21:17 PM UTC (  |  |  |  |  |  |  |  )
Hi everyone,

I prepared some new exciting blog posts, especially about XNA and I will post them shortly and also quite a few things will change at this blog. Stay tuned.

Recently one of my companies (namely realis) moved to Hamburg and I have a new PC at the new office, where I installed Visual Studio 2008 and everything else I needed. After I downloaded the latest source code files from Team System, I ran into some problems. BTW: The Team System trial will end next month and I will probably not switch back to SubVersion, but instead go back to Visual SourceSafe since the integration is the best in Visual Studio. Team System is nice to have but absolutely not something important for me as I'm most of the time the only guy using it anyways.

Back to the Problem. After I loaded the main solution the 2 web applications in it were unable to be loaded. The rest of the projects did load fine and worked after a while until I had all the missing Assemblies installed (xunit, Ajax stuff, Silverlight, IronPython, EntitySpaces, etc.). But even after making sure Silverlight and the Silverlight Tools for Visual Studio Alpha was installed and working (checked it by creating a new Silverlight project, which worked fine), I was still unable to load those projects. I thought at first maybe something went wrong when I checked in or out all the files, but after testing it on my laptop this was not the issue, all files are intact. Everything worked just fine on my laptop, where I had done most of my work during the move and first weeks until everything was finally working here.

After digging around a bit I went back to the IIS were those 2 websites should run on and they did not run yet (not compiled yet, no wonder). But even after I pointed to some dummy website the IIS did throw out some errors (first some dlls were missing, they were quickly replaced, then some security issues with Vista, also easy). Then I pointed back to the location of the projects and made sure IIS was working this time. Now I could go back to Visual Studio and finally load the web projects.

If you have such a InteropServices.COMException, try to see if you have missed something like the Silverlight Tools for Visual Studio Alpha and then figure out if your IIS is working. You can also edit the .csproj file and remove the references to IIS at the very end of the file to see if the project can then be loaded (using IIS again is not hard through the project properties).

Hope this helps (phase stolen from ScottGu, btw: really cool stuff going on over there, the ASP.NET MVC framework is nice and the .NET Framework SourceCode is very helpful!)

 Wednesday, September 05, 2007
Wednesday, September 05, 2007 5:15:37 PM UTC (  |  |  |  )
From http://nerddawg.blogspot.com/2007/09/ nothing-beats-shipping-silverlight-10.html:
Today Microsoft announced the debut release of Silverlight, the new cross-browser, cross-platform technology for developing compelling media experiences and RIAs. I joined the Silverlight effort around November of 2006 from working on WPF 3.5 feature areas, and it has been a wonderful ride. Working on two different product releases – Silverlight 1.0 and 1.1 - simultaneously is a very unique experience not easily summarized in a blog post. The kind of stuff this team has done in a matter of months is nothing short of amazing. We joke internally about how someday books will be written about these episodes; and needless to say, about the giants upon whose shoulders people like me stood. But for now, I’m happy and tremendously fortunate to have been a part of shipping a great product that millions will use and love.

I agree with that statement, not much I can add. I'm glad to see Silverlight 1.0 is now final and Scott Guthrie and his team will now focus on improving Silverlight 1.1. In our german sport community website meinSport.de we already use Silverlight too and we plan to add even more features with that exciting technology in the near future.

You can get Silverlight at Silverlight.net

 Sunday, July 29, 2007
Sunday, July 29, 2007 6:57:29 PM UTC (  |  |  |  |  )
When you have some Silverlight 1.1 alpha code and want to use it with the new Silverlight 1.1 alpha refresh bits, you should make sure to replace all assemblies and recompile any libraries you have. You still might get quite a few errors because of some minor changes in the javascript code. I haven't fixed all issues yet, but the main one was replacing the Silverlight.js and fixing the .js files for html (or aspx) pages to the new syntax. Sys.Silverlight is now just Silverlight, the version is now not longer called 0.95, but 1.1 and enableHtmlAccess has to be set to "true" instead of just true before.

When you get the 2211 error code with Silverlight 1.1 alpha refresh with that nice AG_E_RUNTIME_HTML_ACCESS_RESTRICTED error follow this steps:
  • Replace Silverlight.js with the newer version from alpha refresh (you probably have done that already)
  • Replace Sys.Silverlight.createObjectEx with Silverlight.createObjectEx in all your .js files
  • Also replace all version="0.95" with version="1.1" in all .js files!
  • Finally replace enableHtmlAccess: true with enableHtmlAccess: "true"
    This change is very important and will finally get rid of the Html access restricted error above.
    If you like the error, you can "enable" it again by setting enableHtmlAccess to "false" ^^

There are probably much more little changes and fixes, but this should get the simpler pages up and running again.

Sunday, July 29, 2007 12:43:40 PM UTC (  |  |  |  |  |  )
After VS2008 beta 2 is available now, Silverlight was also updated. For Javascript development the Silverlight 1.0 RC means you are not longer in beta mode and the version will stay the same. For .NET development Silverlight 1.1 is still in alpha, which propably means there are still a lot of features missing, a lot of bugs in there and it is still hard to work with it. However, over 2000 bugs where fixed since the Silverlight 1.1 Alpha release 3 months ago.

For Silverlight designers: Blend 2 was also updated to an August CTP, a lot of small improvements here too. The best thing here is the ability to create and compile user controls and some nice changes to the Storyboard editing process.

Download links:
Seen first on:
Scott Guthrie also has a nice blog entry about VS2008 Intellisense improvements, a lot of small improvements, which might impress you if you have never used Resharper and CodeRush before. It is always nice to see the overall coding experience becoming easier, even if it is in small steps.

 Friday, July 27, 2007
Friday, July 27, 2007 4:52:59 AM UTC (  |  |  |  |  |  )
Great News, read all about it on Scott Guthries Blog:
http://weblogs.asp.net/scottgu/archive/2007/07/26/
vs-2008-and-net-3-5-beta-2-released.aspx


It features major improvements to ASP.NET Ajax, Linq, the build in Webdesigner and CSS/Javascript.
Seems like nothing for Silverlight yet, still awaiting some updates there :)

Have to check VS 2008 out now ^^

 Friday, July 20, 2007
Friday, July 20, 2007 11:49:28 PM UTC (  |  |  |  |  |  |  )
Side note: FX Composer 2 RC1 is out. Check it out, works even better now.

I worked a bit with Silverlight 1.1 (alpha) over the last few weeks and I noticed a lot of annoying
javascript error messages with just stupid error codes and no stack trace for the exceptions.
This is definately the worst thing about Silverlight, you have to do a lot of trial and error testing,
unit testing and debugging silverlight is also hard to do.

I wrote down all the errors I have encountered and some solutions to them, which might be
helpful to other people coding Silverlight too. Now whenever I get an error I just look into this
list and follow the steps from top to bottom and this way I save a lot of time ^^ maybe I will
also rewrite the javascript on_error code that throws these errors to a more useful version.

Silverlight Error Codes:
  • 1001: usually AG_E_UNKNOWN_ERROR (yeah, thats really helpful)
  • some element is null while loading a control
    Fix: Check all controls constructors and fields, set breakpoints there!
  • Namespace duplicate found (usually error code 2254)
    Fix: Check all namespaces, make sure each name and namespace is only set once

  • Control has no default Constructor and can't be instantiated
    Fix: Provide a default constructor with no parameters, it can be empty!
  • NullReferenceException (or other exceptions) happend somewhere
    (usually in the Control constructor somewhere)
    Fix: Catch the exception or set breakpoints to find it, then fix it.
    Often it is also useful to comment code out and test if it works again.

  • If this all not helps and the 1001 errors keeps coming up when you use the
    control use the following approach:

    Fix: Comment out the control, the page should now work.
    Comment it in again and check every single property you set, try removing
    as much as possible and test again. If it still does not work, check out
    the control itself, comment everything out here inside the control canvas.
    It should work now except for some errors of missing inner control names.
    Now slowly comment everything in again and try to see which inner control
    did not work. Often a depreciacted, commented out or deleted property is
    used and causes this error. Again try to work with as little as possible
    control properties and increase until the error pops up again.

    This more complex case will hopefully not happen to you in the beginning,
    but the more controls you build, the more likely it is that this one
    will annoy the hell out of you. Keep calm and go forward as methodically
    as possible, it will also help you for future error encounters.
  • Can happen if a TargetName for a Storyboard (or something similar) cannot
    be found. Make sure the target control name is still valid.

  • 2005:    ParserError: Unknown namespace xy
  • The line should tell you which namespace is unknown and this should
    be quite easy to fix. It usually means you have either forgotten to
    add a namespace or add an element into an unsupported location.
    E.g. adding something to a nested Canvas can sometimes cause this error.

  • 2024: ParserError:
  • Invalid attribute value text/python, usually happens in the main xaml file.
    Similar to 2265, use the same fixes.

  • It can also happen when the mime type
    is not available (e.g. in IIS) and .py files can't be used.
    Fix: Define .py as mime type in IIS as 'text/ironpython'
        
  • 2101: can be:
  • LostFocus event (or similar) not supported here
    Fix: Move global events to the main canvas, they are only supported there!

  • 2207: AG_E_RUNTIME_METHOD
  • playing media failed, unable to play it, loading probably failed with 403
    or 404

  • 2210: AG_E_INVALID_ARGUMENT
  • Short: In 90% of your cases the embedded resource cannot be found, make
    sure that the name of your embedded resource is correct in the
    GetManifestResourceStream function in your control constructor. Also make
    sure the file is marked as an embedded resource in VS Orcas!
  • This means the embedded resource could not be found, which means either the
    call to GetManifestResourceStream uses the wrong string OR the resource
    is just not existant because of a wrong content type! make sure the
    control you are trying to access is actually an Embedded Resource and not
    just a Content or Silverlight Page.

    Fix: Set control xaml as Embedded Resource and make sure all strings are
    correct! GetManifestResourceStream should succeed! Using the Silverlight
    1.1 API UI Controls is also helpful because they figure out the path
    for you (just leaving you with misstyping the control name or forgetting
    to set the embedded resource type or one of the million errors below).

    Note: This is very annoying because SourceControl sometimes messes this up
    and just merges 2 files and setting it as Content or Silverlight Page,
    which make this error hard to track, so always check for the correct
    file build action first, it should always be Embedded Resource for controls.
  • Another way this error can happen is when inside the control a namespace
    error occurs (similar to 1001 or 2254), you just get 2210 and trying to
    find why it does not work while all names are set ok and the resource is
    found, etc. One example of this failing is that a namespace or assembly
    used inside a control to reference other controls cannot be found or is
    misspelled (e.g. path does not longer fit, can be stupid things like
    ClientBin/Some.dll should be ../ClientBin/Some.dll)

    Fix: Check all namespaces in the control too, make sure all names are
    correct and files (especially assemblies) can be found the way they
    are specified!

    Advanced Fix: I use reflection to find out about the class name and use
    that same name for the .xaml file, this way I never have to specify
    any name and merging files does not lead to problems as long as the xaml
    file has the same name as the class (which is easy to spot in VS Orcas).
  • Another VERY crazy way for this to happen is when one of your controls is
    using the partial keyword for its control class and overwrites some of the
    autogenerated background fields (through x:Class in the main Canvas of the
    control), it is probably better to always remove the partial and make sure
    the control is all managed by you (like in the SDK samples).

    Fix: Remove the partial in c# and the x:Class in xaml if you get compile
    errors, after that it usually just works :)
  • Older notes (before I figured this out):
    Seems to happen with perfectly fine xaml code, no c# breakpoint is ever
    hit, so this must happen while parsing the xaml. Often also changes to error
    2254 if some name or namespace is wrong, but then gets back to 2210 if that
    is fixed.
  • Someone here traced the 2210 back to “InitializeFromXaml” being called
    with an invalid resource stream (GetManifestResourceStream), which failed
    one line above it:
    http://silverlight.net/forums/t/1755.aspx
    
  • 2251: ParserError, AG_E_RUNTIME_MANAGED_ACTIVATION
  • Probably a security issue, seems to happen on a Max when the xaml file
    could not be loaded or accesses something that is not available (assemblies)
    Fix: Seems to be a Mac bug, will hopefully be fixed in the future.
        
  • 2252: can be:
  • Canvas Load Error, canvas could not be loaded because something is wrong
    it may help to check out the line and error description for more details.
    Fix: Look through the xaml line by line, annoying, but something is wrong
  • AG_E_RUNTIME_MANAGED_ASSEMBLY_DOWNLOAD:
    When this happens the control at the line specified failed to load.
    This can be because it crashed somewhere in the constructor, setting a
    breakpoint usually tells you wether it crashed in C# or already in the
    xaml. If it is in the xaml, you have to figure out the error there (try
    to uncomment, check namings, etc.). If it happens in C# setting a
    breakpoint makes it much easier, but the error is still annoying. For
    that reason you should make sure to test your controls as much as
    possible before using them on a complex page.

    Fix: Set a breakpoint in the constructor of the control and fix the
    exception! Or if that does not help, take a close look at the xaml
    and comment it out to see what works and what does not.
  • More help about 2252 from http://silverlight.net/forums/t/370.aspx
    Assembly loading failed, this can happen because of the IIS being
    misconfigured (unlikely if you doing development) or because the
    path to the assembly could not be found (much more likely).

    Fix: Make sure both the page xaml and the control xaml point to the
    correct directory for the dll and make sure this works from the
    perspective of the page, not the directories the xaml files are in!
    In my case changing ClientBin/.dll to ../ClientBin/.dll often did
    the trick!
  • Another issue can happen when you rename the assembly, but not all the
    .dll links are correct. It can also be problematic if there are special
    letters like - in the assembly, which will get renamed to _, but the
    filename is still with -, see here:
    http://silverlight.net/forums/t/370.aspx

    Fix: Just check all .dll links and make sure both the name and the path
    are correct.
        
  • 2254: AG_E_RUNTIME_MANAGER_ASSEMBLY_DOWNLOAD, can be:
  • Control type not found because a namespace is not set correctly, this can
    happen if you just copy a file from another project and do not change the
    namespace accordingly.
    Fix: Make sure all namespaces are correct (same in xaml as in the controls)

  • Namespace duplicate found, make sure that all namespaces and names only
    occur once.
    Fix: See above 1001
        
  • 2255: AG_E_PARSER_BAD_TYPE
  • An unsupported type was found, which usually means you are specifying a
    control or class for the xaml, which does not exist (anymore). Make sure
    that the x:Class parameter points to an existing class and uses a correct
    namespace.
  • Also seems to happen when there are multiple comment blocks mixed in the
    xaml file or some name contains an invalid character because of that.
    Clear the xaml file and test until it works again, then insert the removed
    code again to figure out where the error is happening. The line/position
    information of this error is usually not very helpful!
        
  • 2265: Error: Parser code
  • Parsing xaml failed, this has been reported after saving some xaml in Blend
    but it could not be parsed in Visual Studio.
    Fix: Try using only parts of the xaml, use smaller files, dunno.

  • Parsing xmal failed, some syntax error.
    Fix: You should be able to spot the error and fix it if it is a smaller
    file, for bigger files comment most of it out and comment it back in until
    it breaks again. Then fix the issue.

  • 3001: AG_E_INVALID_FILE_FORMAT
  • Often a ImageError, which usually means you are trying to load an
    unsupported image format like the .GIF format, which is not supported
    by Silverlight yet.
    Fix: Use .PNG instead of .GIF, etc.
        
  • 3002: AG_E_NOT_FOUND:
  • Error type should describe which kind of resource was not found (usually
    ImageError). Check your constructor and Page_Loaded methods and check
    all the files that are loaded there and make sure they exist. This is
    probably the equivalent of FileNotFoundException, just all the helpful
    information (which file, why, etc.) is missing. Sometimes the error type is
    confusing because it may report an ImageError, but in reality just the xaml
    file could not be loaded, always check the xaml file (name, loading, etc.)!
        
  • 3010: can be:
  • Silverlight installation is not complete yet, restart browser (or computer
    if this error persists).
    Fix: Tell user to restart browser.

Link to the silverlight.net forum (post this here too), 13 known issues
with Silverlight 1.1. It is good to know them:
http://silverlight.net/forums/t/2400.aspx

Other helpful links:
http://blogs.conchango.com/stevenevans/archive/2007/06/06/
Silverlight-Adventures-with-Blend.aspx

http://www.thescripts.com/forum/thread650457.html
http://silverlight.org/forums/t/1422.aspx

Note: I will add more errors to this list for Silverlight 1.1 alpha, but I will probably just
write a new blog entry for newer Silverlight versions. Still pretty excited about the new
VS Orcas Beta 2 release ^^

 Tuesday, July 17, 2007
Tuesday, July 17, 2007 6:58:07 PM UTC (  |  |  |  |  )
When you try to implement a Silverlight project into an existing ASP.NET Ajax
website you will just click Add Silverlight link to a specific directory in your
website (don't spam everything into your main directory). Then you might want
to use same the html code from your test sites in the ASPX page, like this:

<head runat="server">
  <title>Some title</title>
  <script type="text/javascript" src="Silverlight.js"></script>
  <script type="text/javascript" src="Default.aspx.js"></script>
</head>


And the SilverlightControlHost somewhere in the body (in the form).
You also might want to move the body onload method to a div panel in case you
are using a master page or you want multiple silverlight controls:

        <div id="SilverlightControlHost"
            onload="document.getElementById('SilverlightControl').focus()">
            <script type="text/javascript">
                createSilverlight();
            </script>
        </div>


You might be able to compile and start that without any problems, BUT if you
already have a lot of ASP.NET Ajax code you might end up with this error (and
a bunch more, most of them with Sys.Res in the error description).

Line: 967
Error: Sys.Res.namespaceContainsObject is null or not an object



The problem is that both Silverlight and some generated ASP.NET Ajax javascript
files use the same javascript object (Sys.Res), but overwrite it and disable the
functionality that is needed. You won't find much information on that with
google, but the solution is very simple! Just put the scripts directly into
your ScriptManager of the site like this and remove the scripts from the header:

        <asp:ScriptManager ID="ScriptManager1" runat="server">
            <Scripts>
                <asp:ScriptReference Path="Silverlight.js" />
                <asp:ScriptReference Path="Default.aspx.js" />
            </Scripts>
        </asp:ScriptManager>

        
Hope this helps and saves you some time.
 Friday, July 13, 2007
Friday, July 13, 2007 8:58:58 PM UTC (  |  |  |  )
Using a webservice in silverlight can be very problematic. It does not work out of the
box when you just add a web reference and try to use it. You will get a lot of
501 - Internal Server Errors, WebException - Error invoking service, etc.

Instead of repeating what so many people have already reported for Silverlight
and Web services I will just link to them and give you a small comment about
each link. My solution is below (it was something completely different than
the links I present here, but maybe I did not read all of them carefully).

Links:
  • Silverlight documentation about using remoting and webservices. Two solutions are presented, but the help is very short and if you have not done it before there can be many problems that are not discussed here. But this two ways are the standard solutions that almost everyone uses.
    http://www.silverlight.net/QuickStarts/Remote/default.aspx



  • I used another solution to put all websites, web services and silverlight projects onto my IIS 7 server in Vista x64, but I had troubles debugging them. I moved also to IIS because it was annoying to test the website with the fun crashes VS Orcas gives you from time to time and it also has the advantage to show a working version on your colleagues computers by pointing to your computer's IIS.





        In short this is what I had to do to get debugging and executing working for web sites and web services in IIS7 with VS Orcas:
  • Install IIS (Internet Information Services) first, you can find it in the Control Panel -> Programs/Features -> Turn Windows features on or off.
  • Open the IIS tree and select the Web Management Tools (just install all of them). Also make sure you install ASP.NET in World Wide Web Services/  Application Development Features, it will also select all the other required components.
  • Last but not least select the Basic, IP, URL and Windows Authentications in the Security tree below World Wide Web Services.

  • After installing it you probably need to restart (it did not work without restarting at my colleagues computer). With the IIS Manager (in Computer Management) navigate to your Default Web Site and go into Authentication. Only Anonymous Authentication will be enabled, also enable Windows Authentication (and whatever else you need). You should also switch from the Default AppPool to the Classic .NET AppPool in the Default Web Site -> Right Click -> Advanced Settings -> Application Pool, else debugging will probably not work (Ctrl+F5 works fine even when you do not do this).
  • All websites you create from now will use the Classic .NET AppPool, if you already have websites in IIS, make sure to change them too if you want to debug them.
  • If you still cannot debug you probably do not have sufficiant rights for the user account that is used in IIS. I usually create a new account with Admin rights (plus password), set it to the IIS (Anonymous Authentication, click edit to select a new user) and then downgrade the Account until it does not work anymore, then you can set the appropriate rights (directory access, etc.) to the account. If you only use your IIS for yourself, you can also use your own user account for testing and debugging.




My problem however was the inability to access the web service via HTTP.
You can access it via SOAP and call the main page and execute the methods,
but directly calling Service.asmx/Method?Parameter=Value was not possible
and lead to the:
WebException - Error invoking service
and Internal Server Error
exceptions (depending on the mood and the way I used web services, I used
mainly the first method (Plain XML Requests over HTTP) as described here:
http://www.silverlight.net/QuickStarts/Remote/default.aspx

To test this I called the website directly the way described in the article
I used something like this:
http://localhost/TestService/Service.asmx/HelloWorld?SomeText=Hi
This returned a 501 Internal Server Error (IIS7) or 404 The Page cannot be found
(IIS6), which means this kind of HTTP gets is not supported in this web service
right now. To fix this you have to activate HTTP get in the web.config file with the following code:
    <webServices>
<protocols>
<add name="HttpGet"/>
<add name="HttpPost"/>
</protocols>
</webServices>

From the MSDN Help on activating HTTP Get and HTTP Post for web sites and web services.
http://support.microsoft.com/default.aspx?scid=kb;en-us;819267

Hope this helps, make sure to read the articles mentioned above in detail if you still have issues.

Update 2007-07-14: BTW, if you are interested in webservices for ajax and silverlight,
check out this new project from microsoft live labs:
http://astoria.mslivelabs.com/
From the astoria website: "The new wave of web applications are built on technologies such as AJAX and Microsoft Silverlight that enable developers to build better, richer user experiences. These technologies bring a shift in how applications are organized, including a stronger separation of presentation from data.

The goal of Microsoft Codename Astoria is to enable applications to expose data as a data service that can be consumed by web clients within a corporate network and across the internet. The data service is reachable over HTTP, and URIs are used to identify the various pieces of information available through the service. Interactions with the data service happens in terms of HTTP verbs such as GET, POST, PUT and DELETE, and the data exchanged in those interactions is represented in simple formats such as XML and JSON.

We are delivering this first early release of Astoria as a Community Tech Preview you can download and also as an experimental online service you can access over the internet."

 Monday, July 09, 2007
Monday, July 09, 2007 6:19:33 PM UTC (  |  |  |  |  |  |  )
I've been working with VS Orcas for 3-4 months now and while most projects are still in C#, I switch over to IronPython more and more, especially if I do anything new like some Silverlight website.

CodeRush is working ok in VS Orcas, but there are still some issues, for example expanding/collapsing regions like in my CR_Commenter plugin does not work at all. Visual Studio's Ctlr+M+M and Ctlr+M+L work, but they are pretty much useless because they either collapse just the most inner region (Ctrl+M+M) or just too much (Ctlr+M+L) and pressing these hotkeys is too complicated anyway.

With CR_Commenter you can press Ctrl+4 to collapse or expand the region you are in or Ctrl+5 to collapse/expand all regions (but not summaries, methods, etc.). This works fine in VS 2005, but not in Orcas, there are also some other issues in Orcas like switch or namespace blocks are not commented anymore. For this reason I started writing a new addin (without using CodeRush this time) last month, but I never found time to finish it.

Instead I wrote a new addin this weekend. It just fixes the region issue and adds support for IronPython, which does not have any regions at all. Now regions for all classes, defs (methods) and if blocks are generated for you and can be expanded and collapsed with the same hotkeys (Ctrl+4, Ctrl+5 or the VS defaults). Please note that I had commenter support for IronPython too and added stuff like #region and #endregion to it too, but it does not feel like Python anymore if you add too much comments and blocks. The beauty of Python is its short and self-explaining code and the more I work with it the more I like it.

RegionAddin Hotkeys:
  • Ctrl+1, Ctrl+2: Comment code like CR_Commenter (not implemented yet, it is commented out, too much features from CR_Commenter missing).
  • Ctrl+3: Build region like CodeRush or CR_Commenter, also commented out, CodeRush's version currently does work much better, but adds comments to #endregion
  • Ctrl+4: Collapse or expand the current region you are in
  • Ctrl+5: Collapse or expand all regions in the current file. In IronPython it has 3 modes: All uncollapsed, All methods collapsed, All classes and methods collapsed
  • Ctrl+6: Regenerate all collapsable blocks in IronPython, this is important because the IronPython language service does not support any collapseable blocks, maybe I will implement that later in there ...

Lets take a look at the region feature of RegionAddin for IronPython, Ctrl+6 generate all regions at once, otherwise regions are created automatically as you write code.




As always here is the full SourceCode and a Installer:
This is version 1, I will improve the addin in the future and provide better versions with more features in the future. Maybe I will also finish the CommenterAddin completely and add more support for IronPython (have to think about how it makes sense). Hopefully the RegionAddin is useful for C# and IronPython right now, it also supports all other C style languages like C++.

 Friday, June 08, 2007
Friday, June 08, 2007 10:46:55 AM UTC (  |  |  |  )


Couple of tips if you want to debug Silverlight applications in Visual Studio. Please note I have not worked myself with Silverlight much, I was just observing my colleagues and helping them out when they were unable to debug their Silverlight code.

  • First of all: Visual Studio 2005 is NOT supported, you need Visual Studio Orcas Beta 1 (see my last 2 posts about it)

  • You need the VS_SilverlightTools_Alpha_Setup.exe setup file to get started with silverlight and allow debugging

  • The XAML designer view never seems to work and it usually does not even show up. If you want to hide it, switch the design and xaml views and then click the button on the very right to hide the design view on the bottom.

  • Most importantly: If debugging does not work for you make sure that:

    • Close ALL your instances of Firefox and Internet Explorer first. Then start the debugger of VS Orcas with F5 and let it create a new instance of your browser. This is VERY important because if you leave the browser open and start to set some breakpoints and debug the application, it won't work. Every time you press F5 in VS Orcas to start the project a new browser instance must be created, else debugging is just skipped and you just see the website, the debugger ends immediately. I tested it with Internet Explorer first, but Firefox is ok too if you can live with the constant opening and closing. For me it is much more comfortable to use Firefox for browsing and then Internet Explorer for testing the Silverlight stuff.

    • Your project/website/etc. does not contain any spaces. Like the .NET 3.5 installation there are still issues with spaces. Just make sure there are none. This wasn't a problem at my PC, but on a Vista machine it caused problems.

    • Exceptions seem to be ignored and there seems to be some Exception-Eating-Monster in the Silverlight runtime because no matter what happens or what you throw, it will not be passed to the debugger. Instead it just seems to end the debugging session and shows the page as far as it got. It is probably best to catch all exceptions yourself and display them in some label or flush them to a log file ..

Search

Projects I currently work on

MeinSport.de - German Sport Community Site

StudiHelp.de - German Student Community Site

Arena Wars Reloaded

New Arena Wars Website

My book: Professional XNA Game Programming (May 2007)

Dungeon Quest

Racing Game XNA Starter Kit

Speedy Racer Mod (from da book)

XNA Shooter

Some unannounced projects (games, websites, wikis, and my favorite: a new programming language)

See completed projects on the left side

Downloads: Games, Tools and Sourcecode

Rocket Commander, Mods and SourceCode

NormalMapCompressor v1.3

CR_Commenter

AbiKeyboardV9 layout and CountMostUsedKeys