<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>MSBuild on Marko Apfel</title><link>http://blog.marko-apfel.de/tags/msbuild/</link><description>Recent content in MSBuild on Marko Apfel</description><generator>Hugo</generator><language>en-US</language><lastBuildDate>Wed, 01 May 2013 04:18:00 +0200</lastBuildDate><atom:link href="http://blog.marko-apfel.de/tags/msbuild/index.xml" rel="self" type="application/rss+xml"/><item><title>SharpDevelop, F#, “Please ensure that the F# compiler is installed on your computer.”</title><link>http://blog.marko-apfel.de/posts/sharpdevelop-f-sharp-please-ensure-that-the-f-sharp-compiler-is-installed-on-your-computer/</link><pubDate>Wed, 01 May 2013 04:18:00 +0200</pubDate><guid>http://blog.marko-apfel.de/posts/sharpdevelop-f-sharp-please-ensure-that-the-f-sharp-compiler-is-installed-on-your-computer/</guid><description>&lt;h2 id="situation"&gt;Situation&lt;/h2&gt;
&lt;p&gt;My private machine has &lt;em&gt;Microsoft Visual Studio Express 2012&lt;/em&gt; for Windows Desktop. This Visual Studio edition doesn’t allow to develop with F#. So I installed additionally &lt;a href="http://www.icsharpcode.net/OpenSource/SD/Default.aspx"&gt;SharpDevelop&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;But it took longer as expected to get F# projects running in this environment.&lt;/p&gt;</description></item><item><title>Installing of SDKs, Visual Studio and additional toolsets on build machines</title><link>http://blog.marko-apfel.de/posts/installing-of-sdks-visual-studio-and-additional-toolsets-on-build-machines/</link><pubDate>Mon, 05 Dec 2011 15:07:00 +0100</pubDate><guid>http://blog.marko-apfel.de/posts/installing-of-sdks-visual-studio-and-additional-toolsets-on-build-machines/</guid><description>&lt;p&gt;Last week I get the information directly from Microsoft, that at build machines SDKs must be installed to guarantee that MSBuild works well in some circumstances.&lt;/p&gt;
&lt;p&gt;We have the problem, that a self-containing build should include all necessary build artifacts – particularly Silverlight stuff. I tried to encapsulate the special steps in own targets and a build was finally possible (see my former posts). But at local machines without installed Silverlight stuff it gives problems for problems. Because reason of time finally I decide to go the Microsoft way – they break my volition.&lt;/p&gt;</description></item><item><title>@Microsoft: please provide universal and professional concepts</title><link>http://blog.marko-apfel.de/posts/microsoft-please-provide-universal-and-professional-concepts/</link><pubDate>Sun, 20 Nov 2011 11:35:00 +0100</pubDate><guid>http://blog.marko-apfel.de/posts/microsoft-please-provide-universal-and-professional-concepts/</guid><description>&lt;p&gt;Why such constructs are included in the &lt;code&gt;.csproj&lt;/code&gt;-Files?&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-xml" data-lang="xml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;&amp;lt;CodeAnalysisRuleSetDirectories&amp;gt;&lt;/span&gt;;c:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets&lt;span class="nt"&gt;&amp;lt;/CodeAnalysisRuleSetDirectories&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;&amp;lt;CodeAnalysisRuleDirectories&amp;gt;&lt;/span&gt;;c:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules&lt;span class="nt"&gt;&amp;lt;/CodeAnalysisRuleDirectories&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;So it every projects needs some manual steps to clean the project file so the solution could be build on a continuous integration server. That annoying!&lt;/p&gt;</description></item><item><title>Toolset agnostic build server and Silverlight projects</title><link>http://blog.marko-apfel.de/posts/toolset-agnostic-build-server-and-silverlight-projects/</link><pubDate>Thu, 10 Nov 2011 22:42:00 +0100</pubDate><guid>http://blog.marko-apfel.de/posts/toolset-agnostic-build-server-and-silverlight-projects/</guid><description>&lt;h2 id="problem"&gt;Problem&lt;/h2&gt;
&lt;p&gt;Normally I try to have my continuous integration as most a possible toolset free to ensure that no local stuff could have an impact to my build.&lt;/p&gt;
&lt;p&gt;My Silverlight app references a special compile target in a folder outside my developer tree:&lt;/p&gt;</description></item><item><title>Setup license stuff for PostSharp 2.1</title><link>http://blog.marko-apfel.de/posts/setup-license-stuff-for-postsharp-2-1/</link><pubDate>Tue, 08 Nov 2011 20:03:00 +0100</pubDate><guid>http://blog.marko-apfel.de/posts/setup-license-stuff-for-postsharp-2-1/</guid><description>&lt;h2 id="problem"&gt;Problem&lt;/h2&gt;
&lt;p&gt;Normally &lt;em&gt;PostSharp&lt;/em&gt; runs fine on unattended build servers. So on our global Jenkins continuous integration server &lt;em&gt;PostSharp&lt;/em&gt; does the job.&lt;/p&gt;
&lt;p&gt;But on my local TeamCity continuous integration server I got the following error:&lt;/p&gt;</description></item><item><title>MSB4067: The element &lt;ImportGroup&gt; beneath element &lt;Project&gt; is unrecognized.</title><link>http://blog.marko-apfel.de/posts/msb4067-the-element-importgroup-beneath-element-project-is-unrecognized/</link><pubDate>Tue, 08 Nov 2011 11:32:00 +0100</pubDate><guid>http://blog.marko-apfel.de/posts/msb4067-the-element-importgroup-beneath-element-project-is-unrecognized/</guid><description>&lt;h2 id="problem"&gt;Problem&lt;/h2&gt;
&lt;p&gt;Our global Jenkins continuous integration server throws this error during compile step. My local TeamCity continuous integration server runs fine. What is the difference.&lt;/p&gt;
&lt;h2 id="background"&gt;Background&lt;/h2&gt;
&lt;p&gt;I integrate some static code analysis steps via MSBuild-targets in the csproj files.&lt;/p&gt;</description></item><item><title>Running StyleCop without an installation to empower continuous integration</title><link>http://blog.marko-apfel.de/posts/running-stylecop-without-an-installation-to-empower-continuous-integration/</link><pubDate>Mon, 07 Nov 2011 22:32:00 +0100</pubDate><guid>http://blog.marko-apfel.de/posts/running-stylecop-without-an-installation-to-empower-continuous-integration/</guid><description>&lt;h2 id="problem"&gt;Problem&lt;/h2&gt;
&lt;p&gt;A continuous integration server should only have a minimal toolset installed. This ensures that no unwanted libraries could affect the build and other steps.&lt;/p&gt;
&lt;p&gt;Clearly that with this slogan also &lt;em&gt;StyleCop&lt;/em&gt; should not be installed to the CI server. But we wanna have this analysis as an part of the whole build.&lt;/p&gt;</description></item><item><title>Using NuGet in a MSBuild-target to have the packages at the last stand</title><link>http://blog.marko-apfel.de/posts/using-nuget-in-a-msbuild-target-to-have-the-packages-at-the-last-stand/</link><pubDate>Wed, 06 Jul 2011 18:15:00 +0200</pubDate><guid>http://blog.marko-apfel.de/posts/using-nuget-in-a-msbuild-target-to-have-the-packages-at-the-last-stand/</guid><description>&lt;h2 id="motivation"&gt;Motivation&lt;/h2&gt;
&lt;p&gt;Encouraged from the article “&lt;a href="http://docs.nuget.org/docs/workflows/using-nuget-without-committing-packages"&gt;Using NuGet without committing packages to source control&lt;/a&gt;” I decided to wrap the NuGet-call in a MSBuild target instead of using a pre-build event.&lt;/p&gt;
&lt;p&gt;Because we also trigger FxCop and StyleCop via targets this fits better in our project management.&lt;/p&gt;</description></item><item><title>Suppressing Add-in-registration task during build process</title><link>http://blog.marko-apfel.de/posts/suppressing-add-in-registration-task-during-build-process/</link><pubDate>Mon, 16 May 2011 07:17:00 +0200</pubDate><guid>http://blog.marko-apfel.de/posts/suppressing-add-in-registration-task-during-build-process/</guid><description>&lt;p&gt;If you develop ArcGIS Add-ins with Visual Studio under limited permissions you get during the build process an error, that the stuff could not be registered.&lt;/p&gt;
&lt;p&gt;Normally its enough to run one times this build as an admin. Then all needed information are set and also taken for users with limited access.&lt;/p&gt;</description></item><item><title>Calling esriRegasm manually (outside an ArcGIS-installation)</title><link>http://blog.marko-apfel.de/posts/calling-esriregasm-manually-outside-an-arcgis-installation/</link><pubDate>Tue, 26 Apr 2011 20:53:00 +0200</pubDate><guid>http://blog.marko-apfel.de/posts/calling-esriregasm-manually-outside-an-arcgis-installation/</guid><description>&lt;p&gt;Since &lt;em&gt;ArcGIS 10&lt;/em&gt; during the &lt;em&gt;Visual Studio&lt;/em&gt; build an additional target with the execution of a program named &lt;code&gt;esriRegasm&lt;/code&gt; is called. Amongst other things this program adds the COM-categories in the registry.&lt;/p&gt;</description></item><item><title>Specify a project-specific custom dictionary for FxCop build tasks and Visual Studio Team System static code analysis</title><link>http://blog.marko-apfel.de/posts/specify-a-project-specific-custom-dictionary-for-fxcop-build-tasks-and-visual-studio-team-system-static-code-analysis/</link><pubDate>Fri, 02 Jul 2010 11:27:00 +0200</pubDate><guid>http://blog.marko-apfel.de/posts/specify-a-project-specific-custom-dictionary-for-fxcop-build-tasks-and-visual-studio-team-system-static-code-analysis/</guid><description>&lt;p&gt;Using a project-specific custom dictionary for &lt;em&gt;FxCop&lt;/em&gt; and &lt;em&gt;FxCop build tasks&lt;/em&gt; is very simple. The &lt;em&gt;FxCopCmd&lt;/em&gt; call in the &lt;em&gt;FxCop&lt;/em&gt;-target offers the parameter &lt;code&gt;/dictionary:&amp;lt;DictionaryName&amp;gt;&lt;/code&gt; for that.&lt;/p&gt;
&lt;p&gt;But for &lt;em&gt;Visual Studio&lt;/em&gt; a little bit more steps are needed. And these steps must me gone for all projects.&lt;/p&gt;</description></item><item><title>Specify a custom dictionary for FxCop and Visual Studio source analysis</title><link>http://blog.marko-apfel.de/posts/specify-a-custom-dictionary-for-fxcop-and-visual-studio-source-analysis/</link><pubDate>Tue, 11 May 2010 17:46:00 +0200</pubDate><guid>http://blog.marko-apfel.de/posts/specify-a-custom-dictionary-for-fxcop-and-visual-studio-source-analysis/</guid><description>&lt;p&gt;Renaming the default custom dictionary from &lt;code&gt;CustomDictionary.xml&lt;/code&gt; to an other name – for instance &lt;code&gt;FxCop.CustomDictionary.xml&lt;/code&gt; needs some additional changes to work in involved applications.&lt;/p&gt;
&lt;h2 id="visual-studio-team-system-code-analysis"&gt;Visual Studio Team System code analysis&lt;/h2&gt;
&lt;p&gt;For Visual Studio Team System code analysis this file should be added as a link to all projects and set to be the Build Action CodeAnalysisDirectory.&lt;/p&gt;</description></item><item><title>MSB3105: Duplicate ressource parameter</title><link>http://blog.marko-apfel.de/posts/msb3105-duplicate-ressource-parameter/</link><pubDate>Mon, 25 Jan 2010 05:17:00 +0100</pubDate><guid>http://blog.marko-apfel.de/posts/msb3105-duplicate-ressource-parameter/</guid><description>&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-txt" data-lang="txt"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;error MSB3105: The item &amp;#34;BALoginForm.resources&amp;#34; was specified more than once in the &amp;#34;Resources&amp;#34; parameter.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Duplicate items are not supported by the &amp;#34;Resources&amp;#34; parameter.
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="reason"&gt;Reason&lt;/h2&gt;
&lt;p&gt;We use two custom cultures to divide between UIs for two customers. At the machine with this error only one custom culture was installed.&lt;/p&gt;</description></item><item><title>Visual Studio 2005/2008 Code Analysis Error</title><link>http://blog.marko-apfel.de/posts/visual-studio-2005-2008-code-analysis-error/</link><pubDate>Thu, 26 Nov 2009 12:52:00 +0100</pubDate><guid>http://blog.marko-apfel.de/posts/visual-studio-2005-2008-code-analysis-error/</guid><description>&lt;p&gt;After installing VS2005 TE on my machine (which previously runs Visual Studio 2008 TE) all mixed projects (VS2005/VS2008 compatibility with TargetFramework=2.0 and ToolsVersion=2.0 options) thrown an error during compilation:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-txt" data-lang="txt"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;C:\Program Files\MSBuild\Microsoft\VisualStudio\v8.0\CodeAnalysis\Microsoft.CodeAnalysis.targets(46,4):
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;error : In order to perform Code Analysis on managed binaries, MSBuild needs to launch FxCop.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;MSBuild is unable to locate the FxCop binaries.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Make sure Visual Studio Team Edition for Software Developers or Visual Studio Team Suite is installed
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;and run MSBuild from within the &amp;#34;Visual Studio Command Prompt&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;or specify the path to FxCop by setting the FXCOPDIR environment variable.
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Specifying the &lt;code&gt;FXCOPDIR&lt;/code&gt;-variable brings up the next obscure errors.&lt;/p&gt;</description></item><item><title>Using a custom dictionary in code analysis</title><link>http://blog.marko-apfel.de/posts/using-a-custom-dictionary-in-code-analysis/</link><pubDate>Wed, 11 Nov 2009 09:22:00 +0100</pubDate><guid>http://blog.marko-apfel.de/posts/using-a-custom-dictionary-in-code-analysis/</guid><description>&lt;p&gt;see also &lt;a href="http://blog.marko-apfel.de/posts/working-with-microsoft-fxcop/"&gt;Working with Microsoft FxCop&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;As described in the previous post a custom dictionary could be referenced in a FxCop-call of a target by using the option:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cmd" data-lang="cmd"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;/dictionary:&lt;span class="p"&gt;&amp;amp;&lt;/span&gt;quot;$(ProjectDir)..\FxCop.CustomDictionary.xml&lt;span class="p"&gt;&amp;amp;&lt;/span&gt;quot;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;But how is it possible to publish this custom dictionary for the Visual Studio integrated code analysis?&lt;/p&gt;</description></item><item><title>Working with Microsoft FxCop</title><link>http://blog.marko-apfel.de/posts/working-with-microsoft-fxcop/</link><pubDate>Wed, 11 Nov 2009 09:06:00 +0100</pubDate><guid>http://blog.marko-apfel.de/posts/working-with-microsoft-fxcop/</guid><description>&lt;h2 id="run-fxcop-as-a-post-build-event"&gt;Run FxCop as a post build event&lt;/h2&gt;
&lt;p&gt;Since FxCop 1.36 it is possible to include FxCop in a post-build event.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
 &lt;img src="http://blog.marko-apfel.de/posts/working-with-microsoft-fxcop/developingtools-fxcop-01.png" alt="Screenshot for Working with Microsoft FxCop" loading="lazy" decoding="async"&gt;&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;So FxCop runs after compiling in Visual Studio and allows you directly jumping to the warned line.&lt;/p&gt;</description></item><item><title>Post-build event with folders which contains spaces</title><link>http://blog.marko-apfel.de/posts/post-build-event-with-folders-which-contains-spaces/</link><pubDate>Mon, 27 Apr 2009 03:47:00 +0200</pubDate><guid>http://blog.marko-apfel.de/posts/post-build-event-with-folders-which-contains-spaces/</guid><description>&lt;p&gt;If you want to use a Post-build event with folders which contains a space often you get an error like:&lt;/p&gt;
&lt;p&gt;The system cannot find the file specified.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-txt" data-lang="txt"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;c:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets(3397,13):
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;error MSB3073: The command
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&amp;#34;COPY C:\Projekte\_Learning By Doing\EsriDE.QA.StyleCop\bin\Debug\EsriDE.QA.StyleCop.dll
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&amp;#34;C:\Program Files\Microsoft StyleCop 4.3&amp;#34;&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;exited with code 1.
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;In my case I used the macro &lt;code&gt;$(TargetPath)&lt;/code&gt; in following line which contains indirectly the spaces in &lt;code&gt;_Learning By Doing&lt;/code&gt;:&lt;/p&gt;</description></item><item><title>Compiler-Error: error MSB3217</title><link>http://blog.marko-apfel.de/posts/compiler-error-error-msb3217/</link><pubDate>Thu, 08 Jan 2009 11:54:00 +0100</pubDate><guid>http://blog.marko-apfel.de/posts/compiler-error-error-msb3217/</guid><description>&lt;p&gt;Since several days during compilation i had the error:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-txt" data-lang="txt"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Cannot register assembly &amp;#34;Foo.dll&amp;#34;.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Exception has been thrown by the target of an invocation.
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;In the output-window with diagnostic compile information the following statement was listed:&lt;/p&gt;</description></item></channel></rss>