Dev Blog - Johan Danforth

I'm Johan Danforth and this is my dev blog - a mix of .NET, ASP.NET, Rest, Azure and some other random coding stuff.

  • ASP.NET 4 Website Fails to Start on Your TFS 2010 Server?

    Getting a “Could not find permission set named ‘ASP.Net’” error on your TFS 2010 server? It may have to do with the fact you’re trying to run ASP.NET as a child site of a SharePoint Web Site. The problem is described in the “ASP.NET 4 braking changes” site:

     

    This error occurs because the ASP.NET 4 code access security (CAS) infrastructure looks for a permission set named ASP.Net. However, the partial trust configuration file that is referenced by WSS_Minimal does not contain any permission sets with that name.

    Currently there is not a version of SharePoint available that is compatible with ASP.NET. As a result, you should not attempt to run an ASP.NET 4 Web site as a child site underneath SharePoint Web sites.

     

    There is a workaround you could try by setting this in your web.config, if you know what you’re doing:

    <trust level="Full" originUrl="" />

  • Compile ASP.NET MVC on TFS 2010 Build Server

    Note to self: If you need to build ASP.NET MVC 2 applications on a fresh TFS 2010 Build Server without Visual Studio installed, copy the System.Web.Mvc.dll from your dev box to the build server and register it there.

  • Upgrading TFS 2010 from RC to RTM

    Just did a test upgrade on my virtual 2008 server from the RC version of TFS 2010 to RTM. I’ve a single-server installation and the instructions for upgrade is to first backup the server and the database, uninstall the RC version, make sure you really did a backup then install TFS 2010 RTM. There’s an upgrade option, make sure to select it! The upgrade will find (sometimes with a little help from the user) the old TFS databases and such and migrate/upgrade them.

    I stomped on a couple of things, first I got a couple of warnings related to Sharepoint during the final parts of the install/upgrade. For example:

    TF205016: Required permissions could not be granted to the service account for the SharePoint Web application in Team Foundation Server. The following error occurred: TF249063: The following Web service is not available: http://win2k8:17012/_vti_bin/TeamFoundationIntegrationService.asmx. This Web service is used for the Team Foundation Server Extensions for SharePoint Products. The underlying error is: The remote server returned an error: (503) Server Unavailable..

    The reason in this case was that the service-account use for the Sharepoint Central Administration v3 application pool was somehow out of sync and the application pool was stopped. I fix this I made sure the account was correct and had correct password, made sure the app pool was started and that I could access the Sharepoint admin web app.

    The other thing that went kind of wrong was a build configuration I had. It failed with error:

       The working folder C:\Builds\xxxxx is already in use by the workspace 1_1_WIN2K8;NT AUTHORITY\NETWORK SERVICE on computer WIN2K8.

    The name of my virtual server is of course WIN2K8 (I know, really creative but I was tired).

    So, this may have to do with me using a virtual server and such, but I just removed the workspace with the tf-command:

       tf workspace /delete /server:http://WIN2K8:8080 “1_1_WIN2K8;NT AUTHORITY\NETWORK SERVICE“

    After that the build runs just fine.

  • Most Wanted: IronRuby Integration in Visual Studio 2010

    ironruby This week the IronRuby team announced IronRuby version 1.0 RC at RubyConf 2009 and IR is really starting to shape up into something awesome when looking at compatibility and performance.

    The blog to really, really follow if you’re interested in IronRuby is Jimmy Schemanti’s (PM and developer on the IronRuby team). He’s got up-to-date information on the project as well as good tips on how to make best use of IR in your other .NET projects.

    In a couple of places on the Net, there’s been discussions and also deep concerns about the fact that there is no proper support for the Iron* languages inside Visual Studio. One interesting discussion is going on in the IronRuby mailing list –> http://www.mail-archive.com/ironruby-core@rubyforge.org/msg05124.html and another over at Sapphire Steel, who released an alpha version of IR integration in VS2008 –> http://www.sapphiresteel.com/Who-Needs-IronRuby 

    A couple of months ago, Matt Ward wrote a blog post about IronRuby integration in SharpDevelop 3.1. SharpDevelop being an open source IDE for the .NET platform which supports various project types and multiple programming languages. Today, this might be the best option for people who are used to the the programming support you normally get in Visual Studio.

    Personally I would hate to see the thousands of hours from the IronRuby team and the wonderful community being spent on a product not used just because the lack of VS integration. It’s my personal view that most .NET developers have been totally spoiled by the wonderful support VS gives us. We’re used to getting project support, syntax highlightning, refactoring, F5 debugging and at least *some* intellisense. 

    I know that some people over at Microsoft is a bit disappointed in the community (IronRuby is a kind of an Open Source project after all) for not doing something in VS for IronRuby already – Sapphire shows is possible for sure, and it should be even “less hard” in VS2010 – but I think I know why. Coding up a good VS integration with the features I listed above is NOT a walk in the park to get right. We’re talking thousands of hours that MIGHT go down the drain if Microsoft eventually releases something themselves.

    For a while now there’s been a suggestion on Microsoft Connect for IronRuby integration into VS2010, which has now become the most up-voted feature request for VS2010!

    A couple of days ago, Jimmy commented this on his own blog post:

    VS integration will happen eventually; we've been focusing on the languages up until now. After the 1.0 is released we'll probably have some time to make the VS integration. However, I'm a little disappointed in the community for not making this already ...

    And yesterday Jimmy wrote:

    After 1.0 is released, we’ll probably take a bit of a break, but then look to do some features we didn’t get to finish in 1.0, as well as Visual Studio Integration, since it’s the highest voted feature for VS2010.

    So, there you got it. It WILL happen eventually, I wish it will be sooner than later and I hope to see the same kind of short release cycles we’ve seen for IronRuby. :D

  • Weeko – MEF and WPF to plug in Tool Windows into Visual Studio 2010

    Today I opened up a new Codeplex project called “Weeko”, which is a Sioux name for “pretty”.

    Weeko is an experiment which uses MEF to easily plug in tool windows into VS2010. The tool windows are developed as ordinary WPF UserControls. Install the Visual Studio extension and drop your user control assembly into the extensions directory of Visual Studio and it will show up inside the IDE.

    This is how it can look with a couple of sample “addins” – The Rss feed, Twitter feed and a digital clock are all WPF User Controls which are exported and imported using MEF – Managed Extensibility Framework.

    sample.png

    Feel free to check it out and if you got some ideas for improvements please let me know. I’m thinking about how to better manage available plugins, load/unload etc.

  • Some Good Feedback for Writespace

    WritespaceIt’s been a while since I actually looked at the Codeplex statistics for Writespace, but it seems that people keep downloading it and that’s always fun! So far Writespace has been downloaded over 4.000 times which is peanuts compared to other open source tools, but perhaps I helped some people get more productive and that feels good!

    Following the top referring sites I can see that this simple addin for Word gets some good reviews from people that compares it with other similar tools. One of the best articles I’ve seen so far is the one by Rob Oakes, which he calls On Writing – Software that cuts out distraction and clutter where he compares DarkRoom, WriteRoom, Writespace and PyRoom. They are all very similar to each other.

    What’s not so cool is that Writespace is an open source project, and it would have been fun to get some patches or help from other developers. Of the 4.000 downloads, I’m sure there are a whole lot of .NET developers that know their XAML well. I’ve got some feedback for ideas, one guy I know made some changes but didn’t send me code or a patch… pity. If you extend open source software, shouldn’t you share that? Maybe it’s too hard to create a patch?

  • Writespace Updated with Command Line Version and Some IronRuby Fun

    WritespaceI had a few minutes to fix a few issues and release an updated version (1.3) of Writespace – the full screen editing environment addin for Word.

    So what’s new? I removed the annoying illuminated animation for row and column when typing. Added F4 shortcut for the Options dialog. Also added a command line program and a sample ditto to run Writespace with IronRuby.

    IronRuby can be downloaded from http://ironruby.codeplex.com 

    The command line programs are optional downloads, but it seems to run pretty well if pinned to the Windows 7 TaskBar:
    Win7Taskbar.png

    Have fun!

  • SQL Azure Explorer on Channel 9

    SQL Azure Explorer LogoOur SQL Azure Explorer Addin for VS2010, which is on Codeplex was mentioned on the  Last Week on Channel 9 show, which is cool. Made the download stats peek even though it’s for VS2010 Beta 1 only and you need to have an SQL Azure CTP account. 

    That show is one of the best for people like me who need to keep up with the latest stuff happening on the Windows and .NET front.

    I need to get some time and refactor the data access layer. It works, but it’s not consistent and could use more integration tests. Or I’ll let it be and just work on new features, which is way funnier ;)

  • Custom Caret “cheat” in WPF TextBox

    I’ve seen people ask for custom Carets in the WPF TextBox, like in insert mode and you want to have a block caret or underscore. Some say it’s going to be possible/easier to do this in .NET 4.0, but until then, there are some simple cheats you can do to add it yourself, but it will need some tweaking. In this test I’ve put a Canvas on top of the TextBox, on which I draw the custom caret and move it when keys are pressed in the TextBox. If you absolutely need this behavior you can probably tweak it to work, but movement, drawing and all that depends on the font face and size.

    CustomCaret

    In my sample code, the custom caret is invisible to start with, and only drawn when in overwrite mode. The drawing is kind of jerky when using the arrow keys and home, end etc, but I think it can be fixed. One way would be to make the built in caret the same color as the TextBox background, like described by Lester in his blog post.

  • SQL Azure Explorer Addin for VS2010 Beta 1

    Me and Dag König just released the alpha version of a (so far) small Codeplex project we’ve been working on for the last week or so – an SQL Azure Explorer Addin for Visual Studio 2010 Beta 1.

    The reasons for this project are several, but mostly to learn more about VS2010, how to create addins for it, dig into SQL Azure and at the same time learn some WPF and XAML.

    The addin is a VSIX package and easily installed in VS2010 by just downloading and double clicking it.

    Here’s a sample screenshot of the explorer and the integrated SQL Editor:

    SQL Azure Explorer Addin

    If you got VS2010 Beta 1 and some SQL Azure databases you work with, please download and feedback. I’m sure Microsoft will eventually support SQL Azure in the built-in server explorer, but as I said, this is for fun (it’s great fun to code addins) and the code might be useful for other future projects :)