in

ljusberg.se

Smöråkning

July 2006 - Posts

  • MSBuild script for Sandcastle

    Update

    After installing the August CPT of Sandcastle, you'll need to update to the latest version of the MSBuild script.

    The MSBuild script has been improved to work with Help Compiler 2. Check out the new instructions!

    Last friday, Microsoft finally released a CTP version of Sandcastle. For this initial release however, they didn't really focus on usability, and that shows! The 11-step instructions you need to follow just in order to compile the sample documentation are not really straight-forward..

    There have already been some contributions to help you on your way; Mikael Söderström has created a Sandcastle Helper, there is a batch script from Ashley van Gerven, and a Power shell script from Scott Hanselman.

    But what I really missed was some sort of MSBuild-integration, so I've spent the day building a .targets-file that can be used to simplify your Sandcastle builds greatly!

    You can download the following files:

    • Sandcastle.zip
      Unzip the contents of this file to c:\Program Files\MSBuild\Sandcastle.
    • SandcastleTest.zip
      This file contains a sample solution and a sample MSBuild script (called Documentation.proj).

    Instructions for trying this out:

    1. If you haven't already done so, install the Sandcastle June CTP. The scripts rely on a completly unmodified installation, so don't make any changes to it (especially not the sandcastle.config file).
    2. Unzip the contents of Sandcastle.zip to your MSBuild folder (usually c:\Program Files\MSBuild)
    3. Unzip the contents of SandcastleTest.zip to wherever you like to keep your sample projects.
    4. Open up the SandcastleTest.sln solution file and build the project.
    5. Open a Visual Studio 2005 Command prompt, navigate to the SandcastleTest folder and run the following command:
      MSBuild Documentation.proj
    6. Cross your fingers, and when the process is finished, look for the Output\SandcastleTest.chm file!

    Please post any errors and/or comments! The next step will be to try to integrate this script in the Team Foundation Build process.. I'll keep you posted..

    Update

    I've updated the script to work better with the Visual Studio plugin

    Update 2

    If you're interested in the inner workings of Sandcastle, check out my Sandcastle under the hood-series: Part 1 and Part 2 and Part 3

  • Sandcastle och nDoc

    Som jag skrev i det föregående inlägget så är Microsoft på väg att släppa Sandcastle, deras egna dokumentationskompilator, till allmänheten. Tyvärr har CTPn fortfarande inte dykt upp, men nu finns iallafall en ny blog som nog är värd att hålla ett öga på de närmaste dagarna.

    Lite tråkigt är att Kevin som byggde nDoc nu har beslutat sig för att lägga ner projektet. Ännu tråkigare är de påhopp han har råkat ut för, och nu fortfarande råkar ut för från otacksamma människor som uppenbarligen inte förstår hur mycket jobb som ligger bakom ett sådant projekt. Lite kortfattat så lägger Kevin av pga att "önskemålen" från omvärlden att han skulle komma ut med version 2.0 nu snarare började likna hot! Dessutom har han, trots att nDoc blivit de facto-standarden för att generera dokumentation, bara fått in totalt sätt 11 donationer! Jag önskar att jag kunde säga att jag själv var en av dem - jag brukar faktiskt donera till de gratisprogram jag använder mig av - men jag har helt enkelt aldrig använt nDoc..

    Många verkar menar att han inte har rätt att gnälla eftersom han alltid har tackat nej när andra personer erbjudit sig att hjälpa till med utvecklingen. Men vad de inte riktigt verkar ha greppat är att det snarare skulle göra hans arbetsbörda (eller åtminstone pressen att leverera) ännu större! Nej, det bästa sättet att ge support till ett projekt som nDoc är nog att visa sin uppskattning, helst med en donation men åtminstone med lite glada tillrop då och då.

    Posted Jul 28 2006, 09:22 AM by anders with no comments
    Filed under:
  • Äntligen på väg, Sandcastle!

    Det verkar som om Microsoft äntligen är på väg att släppa ett verktyg för att generera dokumentation. Sandcastle är tydligen samma verktyg som används internt för att generera dokumentationen till .NET Framework, och det bådar ju gott. Ska finnas med i Augusti CTP-releasen av Visual Studio SDKn.
    Posted Jul 19 2006, 02:59 PM by anders with no comments
    Filed under:
  • "Weak" assembly reference not found by MSBuild

    I'm really going crazy over this problem with MSBuild. Let me give you some background information first...

    We have a solution which produces a web service project. This web service depends on having a specific assembly in its bin-folder in order to run properly, but this assembly is not being refered to in any of the compiled code (it is a custom data provider that is only refered to in web.config and then dynamically loaded). The assembly is always found in (at least one) of the current assembly folders on all our machines, but the actual path can vary.

    We build all our solutions using Team Foundation Server Build on a separate build box (actually a virtual server). TFSBuild, of course, uses MSBuild in order to build the actual solution. During the build process, we also run all unit tests that have been written against the webservice.

    Now here comes the problem.. MSBuild, when figuring out which assemblies that should be copied to the website bin directory, doesn't understand that our custom data provider assembly must be included. This, of course, is not so strange since the assembly isn't referenced anywhere in the code. But when running the tests, the assembly must be in place, otherwise they all fail.

    Unfortunately, I have still not found a reasonable solution to this problem. Here is a list of the things I've tried so far:

    • Add a file reference to the web project. This creates a file called .refresh in the Bin directory of the solution. This file is then used to resolve the reference and add it. But, the file path is relative to the current solution, and since the folder setup is different on the build box than on my (and other developer's), this fails.
    • Add a file reference to any other project in the solution (that is in its turn referenced by the web project). This actually works fine when building within Visual Studio, but the reference is ignored when building on the build box. This is probably because MSBuild is used in a different manner when building inside the IDE than it is when building from the command line.
    • Overriding the AfterDropBuild target to manually copy the assembly. Works fine in order to get the final build drop to work, but since the testing is done prior to this (and in a completely different directory) the tests still fail

    As I'm writing this, I realize that there probably is a target somewhere that can be overridden after the build but before the testing where I could copy the assembly. I'll probably try that tomorrow. Still.. Why is this so difficult??

    Update - the simple solution

    The painfully obvious solution was of course to edit the .refresh file so that it contains the complete UNC path to the assembly on the build box. Can't believe I didn't think of this before..

    Posted Jul 06 2006, 04:42 PM by anders with no comments
    Filed under:
  • vwd.webinfo

    Aarrghh.. I keep getting a vwd.webinfo-file added to some of my websites. According to this post on the ASP.NET forums, this file was previously known as vwdsettings.xml and contains information about what services to start in order for the web app to build and run properly. Now, to my knowledge I don't need any services at all to be started, but I just can't get rid of the bloody file.. One odd thing is that it only gets added when I close the solution..

    I finally traced its origins to my installation of Visual Studio 2005 SDK (the June 2006 release). It seems to have something to do with the text templating engine, though I'm not even sure what that is.. Unfortunately, the problem didn't go away even after uninstalling the SDK. I had to manually remove the file (both from source control AND the local web folder) AND also walk through all .csproj files and remove all references to it there:

    <ItemGroup> <Service Include="{B4F97281-0DBD-4835-9ED8-7DFB966E87FF}" /> </ItemGroup>
  • Consolas, trevligt typsnitt för Visual Studio

    Courier har ju alltid varit standardtypsnittet som används i princip i alla utvecklingsmiljöer. Synd bara att det egentligen är ett ganska dåligt val. Nu har (äntligen) Microsoft tagit fram ett typsnitt som är skräddarsytt för Visual Studio! Consolas heter det och är gratis att ladda ner.

Powered by Community Server (Non-Commercial Edition), by Telligent Systems