tag:support.appharbor.com,2010-11-23:/discussions/problems/1111-silverlight-5AppHarbor: Discussion 2012-01-01T17:01:47Ztag:support.appharbor.com,2010-11-23:Comment/100029382011-09-16T09:57:51Z2011-09-16T09:57:51ZSilverlight 5<div><p>Good morning!</p>
<p>It seems that AppHarbor doesn't support Silverlight 5
yet — I've got an error:<br>
<code>error MSB4019: The imported project "C:\Program
Files\MSBuild\Microsoft\Silverlight\v5.0\Microsoft.Silverlight.CSharp.targets"
was not found. Confirm that the path in the <Import>
declaration is correct, and that the file exists on
disk.</code></p>
<p>What about installing Silverlight 5 RC? This would be very much
appreciated. Afaik, this shouldn't be too difficult; I have
deployed it on our build server. Installing Silverlight 5 RC SDK
should be enough (<a href=
"http://www.silverlight.net/downloads">http://www.silverlight.net/downloads</a>).</p>
<p>Thanks in advance!<br>
——<br>
Victor</p></div>biqttag:support.appharbor.com,2010-11-23:Comment/100029382011-09-16T11:21:07Z2011-09-16T11:21:07ZSilverlight 5<div><p>Hi Victor</p>
<p>We're not keen on installing pre-release libraries on our build
servers. The main problem is that if we install the Silverlight 5
RC, and then upgrade when the RTM shows up, then, if your code
relies on behaviour present in the RC that changed in the RTM, your
code won't build after the upgrade.</p>
<p>You might want to look into adding a local version of the SL 5
targets file to your repository and referencing that from your
project file, also making sure to include required SL 5 dlls.</p>
<p>Please let us know if you get this working or if there are other
ways we can be of assistance.</p>
<p>Michael</p></div>friismtag:support.appharbor.com,2010-11-23:Comment/100029382011-09-16T15:27:34Z2011-09-16T15:27:34ZSilverlight 5<div><blockquote>
<p>You might want to look into adding a local version of the SL 5
targets file to your repository and referencing that from your
project file, also making sure to include required SL 5 dlls.</p>
</blockquote>
<p>Well, I will try some MSBuild magic in a sandbox at first... But
SL binaries are rather large to be placed in source repository.
Does AppHarbor support subrepos for Mercurial repositories? (I'm
using Bitbucket to store source code.)</p></div>biqttag:support.appharbor.com,2010-11-23:Comment/100029382011-09-16T15:41:59Z2011-09-16T15:41:59ZSilverlight 5<div><p>For Bitbucket-hosted repositories, the subrepository behaviour
depends on what Bitbucket places in the tarball that we download
from them, and I must admit that I haven't tested.</p>
<p>Michael</p></div>friismtag:support.appharbor.com,2010-11-23:Comment/100029382011-09-16T21:36:08Z2011-09-16T21:36:08ZSilverlight 5<div><p>Good evening, Michael!</p>
<blockquote>
<p>...the subrepository behaviour depends on what Bitbucket places
in the tarball that we download from them, and I must admit that I
haven't tested.</p>
</blockquote>
<p>Unfortunately, subrepo with binaries failed to be fetched.</p>
<blockquote>
<p>Please let us know if you get this working...</p>
</blockquote>
<p>As far as I can see this looks like be working. Maybe the
further exploration will reveal some issues but at least <a href=
"http://msdn.microsoft.com/en-us/library/dd460717.aspx">TPL</a>
(wich is absent in SL4 but present in SL5 RC) is resolved in
compile and run time.</p>
<p>Suggested solution “just works” for my sandbox
purposes, but in prodution environment build engineer should add
some conditions, define some auxiliary variables, etc, for safety
and reliability of build scripts.</p>
<p>The build target for standard Silverlight 5 project is placed in
<code>Microsoft.Silverlight.CSharp.targets</code> wich is found
under <code>$(MSBuildExtensionsPath32)</code>. This is <a href=
"http://msdn.microsoft.com/en-us/library/ms164309.aspx">reserved
MSBuild property</a>, and one should avoid redefining it. But, once
more, for my purposes it was just appropriate way.</p>
<p>Investigation showed that problem with unfound paths is caused
by <code>ValidateSilverlightFrameworkPaths</code> task in
<code>GetFrameworkPaths</code> target. Some Reflector inspection of
<code>Microsoft.Silverlight.Build.Tasks.dll</code> exposed the
exact meaning of the key properties
<code>$(TargetFrameworkDirectory)</code>,
<code>$(TargetFrameworkSDKDirectory)</code> and
<code>$(SilverlightRuntimeVersion)</code>. In specific environment
with SL5 RC installed (SL4 also worth looking at) these properties
can be viewed with “printf” during build:</p>
<pre>
<code><Target Name="AfterBuild">
<Message Importance="high" Text="TargetFrameworkDirectory: $(TargetFrameworkDirectory)" />
<Message Importance="high" Text="TargetFrameworkSDKDirectory: $(TargetFrameworkSDKDirectory)" />
<Message Importance="high" Text="SilverlightRuntimeVersion: $(SilverlightRuntimeVersion)" />
</Target></code>
</pre>
<p>(I hope Markdown won't eat all my tags.) This gives a hint how
to (re)define these properties manually.</p>
<p>So, what I've done. In folder
<code>$(SolutionDir)Externals\Silverlight.5.0.60818.0\</code> I
placed following subdirectories (long suffixes can be omitted, one
level is just enough):</p>
<p>
1. <code>ReferenceAssemblies\Microsoft\Framework\Silverlight\v5.0\</code> —
copied from <code>C:\Program Files (x86)\Reference
Assemblies\Microsoft\Framework\Silverlight\v5.0\</code>;<br>
2. <code>MSBuildExtensions\Microsoft\Silverlight\v5.0\</code> —
copied from <code>c:\Program Files
(x86)\MSBuild\Microsoft\Silverlight\v5.0\</code>;<br>
3. <code>MicrosoftSdks\Silverlight\v5.0\Libraries\Client\</code> —
copied from <code>c:\Program Files (x86)\Microsoft
SDKs\Silverlight\v5.0\Libraries\Client\</code>;<br>
4. <code>MicrosoftSdks\RIA
Services\v1.0\Libraries\Silverlight\</code> — copied
from <code>c:\Program Files (x86)\Microsoft SDKs\RIA
Services\v1.0\Libraries\Silverlight\</code>.</p>
<p>Then modified default build script (Silverlight 5
<code>*.csproj</code>-file).</p>
<ol>
<li>
<p>Some definitions at the beginning:</p>
<pre>
<code> <PropertyGroup>
<Biqt_Externals>$(SolutionDir)Externals\</Biqt_Externals>
<Biqt_ExternalsSilverlight>$(Biqt_Externals)Silverlight.5.0.60818.0\</Biqt_ExternalsSilverlight>
</PropertyGroup></code>
</pre></li>
<li>
<p>Target version set to 5.0:</p>
<pre>
<code> <TargetFrameworkVersion>v5.0</TargetFrameworkVersion></code>
</pre></li>
<li>
<p>(Re)defined properties used by standard targets before importing
<code>Microsoft.Silverlight.CSharp.targets</code>:</p>
<pre>
<code> <PropertyGroup Condition="$(SilverlightVersion) == 'v5.0' and !Exists('$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets')">
<MSBuildExtensionsPath32>$(Biqt_ExternalsSilverlight)MSBuildExtensions\</MSBuildExtensionsPath32>
<MSBuildExtensionsPath>$(Biqt_ExternalsSilverlight)MSBuildExtensions\</MSBuildExtensionsPath>
<TargetFrameworkDirectory>$(Biqt_ExternalsSilverlight)ReferenceAssemblies\Microsoft\Framework\Silverlight\v5.0\</TargetFrameworkDirectory>
<TargetFrameworkSDKDirectory>$(Biqt_ExternalsSilverlight)\MicrosoftSdks\RIA Services\v1.0\Libraries\Silverlight\;$(Biqt_ExternalsSilverlight)\MicrosoftSdks\Silverlight\v5.0\Libraries\Client\</TargetFrameworkSDKDirectory>
<SilverlightRuntimeVersion>5.0.60818.0</SilverlightRuntimeVersion>
</PropertyGroup></code>
</pre></li>
</ol></div>biqttag:support.appharbor.com,2010-11-23:Comment/100029382011-09-17T08:27:24Z2011-09-17T08:27:24ZSilverlight 5<div><p>Thanks for sharing Victor!</p>
<p>Michael</p></div>friism