<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Techquila (Posts about .NET Development)</title><link>http://techquila.com/</link><description></description><atom:link href="http://techquila.com/categories/net-development.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><lastBuildDate>Fri, 13 Mar 2020 13:15:27 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Installing Sphinx on Windows</title><link>http://techquila.com/posts/2013/05/installing-sphinx-on-windows/</link><dc:creator>Kal Ahmed</dc:creator><description>&lt;div&gt;&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://sphinx-doc.org/"&gt;Sphinx&lt;/a&gt; is an open-source tool for creating documentation. Written originally for the documentation of Python projects it also supports C/C++ with plans in the pipeline for support of other languages. Right now, my interest in Sphinx is that it is the tool used by &lt;a href="https://readthedocs.org/"&gt;readthedocs.org&lt;/a&gt; where I am planning to host the documentation for &lt;a href="http://brightstardb.com/"&gt;BrightstarDB&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;BrightstarDB is a .NET application written in C# and I'm quite happy with the output of &lt;a href="http://shfb.codeplex.com/"&gt;Sandcastle&lt;/a&gt; for the API documentation. However the developer and user docs were all originally created using the (commercial) &lt;a href="http://www.helpandmanual.com/"&gt;Help &amp;amp; Manual&lt;/a&gt; application - which is a great documentation tool in its own right but would require contributors to the project to purchase a license in order to update or extend the docs.&lt;/p&gt;
&lt;p&gt;Getting a local version of Sphinx running is the first step in evaluating if this approach is going to be feasible and as I'm developing on Windows 8, getting it running under Windows is my priority. So my goal here is to document how to install all you need to run Sphinx on Windows - with the qualifier that I'm doing this on Windows 8. YMMV on other Windows OSes.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://techquila.com/posts/2013/05/installing-sphinx-on-windows/"&gt;Read more…&lt;/a&gt; (3 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>.NET Development</category><category>General</category><guid>http://techquila.com/posts/2013/05/installing-sphinx-on-windows/</guid><pubDate>Sun, 19 May 2013 11:41:29 GMT</pubDate></item><item><title>MVC4 List view template error: Column Attribute is an ambiguous reference</title><link>http://techquila.com/posts/2012/11/mvc4-list-view-template-error-column-attribute-is-an-ambiguous-reference/</link><dc:creator>Kal Ahmed</dc:creator><description>&lt;div&gt;&lt;p&gt;I came across this problem when trying to create a strongly-typed MVC4 view using the List scaffolding template in Visual Studio 2010. When trying to add the view, an error is generated that reports:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="c"&gt;c:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ItemTemplates\CSharp\Web\MVC 4\CodeTemplates\AddView\CSHTML\List.tt(206,35):&lt;/span&gt;
&lt;span class="err"&gt;error CS0104: Compiling transformation: 'ColumnAttribute' is an ambiguous reference between&lt;/span&gt;
&lt;span class="err"&gt;'System.ComponentModel.DataAnnotations.ColumnAttribute' and 'System.Data.Linq.Mapping.ColumnAttribute'&lt;/span&gt;
&lt;/pre&gt;


&lt;p&gt;The fix for this is to locate that .TT file (&lt;code&gt;c:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ItemTemplates\CSharp\Web\MVC 4\CodeTemplates\AddView\CSHTML\List.tt&lt;/code&gt;) and on line 206 change&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="err"&gt;var column = attribute as ColumnAttribute;&lt;/span&gt;
&lt;/pre&gt;


&lt;p&gt;to&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="err"&gt;var column = attribute as System.Data.Linq.Mapping.ColumnAttribute;&lt;/span&gt;
&lt;/pre&gt;


&lt;p&gt;Strangely, this error does not occur in a VS2012 installation so it must have got fixed at some point but even after reinstalling MVC4 into VS2010 the error still came up.&lt;/p&gt;
&lt;p&gt;Hopefully this post will help someone else find the fix !&lt;/p&gt;
&lt;p&gt;Edit: The same problem seems to also affect the &lt;code&gt;Create.tt&lt;/code&gt; template (on line 122), the &lt;code&gt;Delete.tt&lt;/code&gt; template (line 174),
the &lt;code&gt;Details&lt;/code&gt; template (line 179) and the &lt;code&gt;Edit&lt;/code&gt; template (line 229) - the same fix works in all cases.&lt;/p&gt;&lt;/div&gt;</description><category>.NET Development</category><guid>http://techquila.com/posts/2012/11/mvc4-list-view-template-error-column-attribute-is-an-ambiguous-reference/</guid><pubDate>Wed, 07 Nov 2012 10:59:54 GMT</pubDate></item><item><title>Chaining MSIs with WiX 3.0</title><link>http://techquila.com/posts/2009/03/chaining-msis-with-wix-30/</link><dc:creator>Kal Ahmed</dc:creator><description>&lt;div&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;In some deployment scenarios it is not possible to bundle everything into a single installer. This may be because you need to install some third-party software, or because your build process forces you to split a single product across multiple MSIs.&lt;/p&gt;
&lt;p&gt;Although there is not much in the WiX documentation about this, it is possible to chain multiple MSI installers in a setup.exe wrapper so that the installers execute one after the other. The key to this is the setupbld.exe command-line tool that comes with the WiX 3.0 installation. Jon Torresdal has written a useful article on &lt;a href="http://blog.torresdal.net/Trackback.aspx?guid=001283d1-5c8e-4b16-b369-7008675e2e72"&gt;using setupbld.exe to force elevated privileges for an installer under Vista&lt;/a&gt;, and I recommend starting there for an explanation of how to prepare your build to generate setup.exe files. In addition to doing this, setupbld.exe can combine multiple MSI files into a single setup.exe installer. To do this use a command line like:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;setupbld.exe -out $(TargetDir)setup.exe -msu FirstInstaller.msi -msu SecondInstaller.msi -setup $(ProjectDir)setup.exe&lt;/code&gt;&lt;/p&gt;&lt;/div&gt;</description><category>.NET Development</category><category>Installers</category><category>WiX</category><guid>http://techquila.com/posts/2009/03/chaining-msis-with-wix-30/</guid><pubDate>Wed, 04 Mar 2009 11:15:34 GMT</pubDate></item><item><title>Custom Project Templates Not Registered with Visual Studio 2008</title><link>http://techquila.com/posts/2009/03/custom-project-templates-not-registered-with-visual-studio-2008/</link><dc:creator>Kal Ahmed</dc:creator><description>&lt;div&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;At the moment I'm in the middle of updating the NetworkedPlanet NPCL Schema Editor so that it works with Visual Studio 2008, a task that sets new standards for the word 'frustrating'. Anyway, having got my whine out of the way, I did find the fix for something which no amount of Googling revealed and I'm writing it up here in the hope that it might save some other poor soul from a bruised forehead.&lt;/p&gt;
&lt;p&gt;One of the key steps in deploying a Visual Studio package is writing all of the correct package registration details into the target machine's registry. For my deployment I wanted to use the WiX toolset to create my installer. According to &lt;a href="http://msdn.microsoft.com/en-us/library/bb707481.aspx"&gt;this MSDN article&lt;/a&gt;, you can use the tool regpkg.exe in the Visual Studio SDK to generate a .wxs file that contains the necessary WiX magic to get all of the package registration entries written by the installer. Its then just a question of writing the rest of the installer to put files in the right place, include the .wxs file with the right sort of invocation and off you go.&lt;/p&gt;
&lt;p&gt;On testing the deployment on a clean Visual Studio installation I found that the project template I had created to allow users to choose to create an NPCL project didn't show up in the New Project dialog box. I could see that my Project Package was properly registered with Visual Studio on the target machine (as proof of which I could see it displayed in the list of registered extensions in the Help &amp;gt; About dialog box). I could also see that the project template was installed into the Common7IDEProjectTemplates directory as expected.&lt;/p&gt;
&lt;p&gt;After much cursing, rebuilding, redeploying and retesting I finally went back to first principles and decided to compare my package registration key by key with another project package extension that I knew worked - in this case the WiX installation. What I found was interesting. This is the code generated for my project package's template registration by regpgk.exe:&lt;/p&gt;
&lt;p&gt;&lt;code xml:space="preserve"&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;Registry Root="HKLM" Key="SoftwareMicrosoftVisualStudio9.0NewProjectTemplatesTemplateDirs{41a84a7e-462c-4a74-9559-3c2568001dc2}/1"&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;Registry Name="SortPriority" Value="100" Type="integer" /&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;Registry Name="TemplatesDir" Value="[$ComponentPath].NullPath" Type="string" /&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;/Registry&amp;gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;And here, for comparison is the Wix registration&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;lt;RegistryKey Key="NewProjectTemplatesTemplateDirs$(var.WixVsPackageGuid)" Action="createAndRemoveOnUninstall"&amp;gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;RegistryKey Key="/1"&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;RegistryValue Value="WiX" Type="string" /&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;RegistryValue Name="SortPriority" Value="30" Type="integer" /&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;RegistryValue Name="TemplatesDir" Value="[VsProjectTemplatesWixDir$(var.VsVersion)]" Type="string" /&amp;gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;/RegistryKey&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;/RegistryKey&amp;gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The key difference is that the generated registration doesn't set the default value for the /1 registry key. It appears that this default key value is actually the label for the project type that is displayed in the New Project dialog box, but the regpkg.exe tool doesn't generate a &amp;lt;Registry&amp;gt; tag to set its value. In the WiX schema there appear to be multiple ways to do this, and I found the syntax below worked for me:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;lt;Registry Root="HKLM" Key="SoftwareMicrosoftVisualStudio9.0NewProjectTemplatesTemplateDirs{41a84a7e-462c-4a74-9559-3c2568001dc2}/1" Type="string" Value="NPCL"&amp;gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;Registry Name="SortPriority" Value="100" Type="integer" /&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;Registry Name="TemplatesDir" Value="[ptNPCL]" Type="string" /&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;/Registry&amp;gt;&lt;/p&gt;
&lt;p&gt;As an aside, the regpkg.exe generates a .wxs file that uses the schema supported by WiX 2.0. I'm using WiX 3.0 for my installer, and it reports these &amp;lt;Registry&amp;gt; elements as deprecated. However, it does work and I can now get on with finishing off my installer.&lt;/p&gt;
&lt;p&gt;I hope that this tip saves some one the hours that I will never get back again ;-)&lt;/p&gt;&lt;/div&gt;</description><category>.NET Development</category><category>Installers</category><category>VS2008 SDK</category><category>WiX</category><guid>http://techquila.com/posts/2009/03/custom-project-templates-not-registered-with-visual-studio-2008/</guid><pubDate>Wed, 04 Mar 2009 09:00:18 GMT</pubDate></item></channel></rss>