Skip to content
Permalink
Browse files

[#476] Change approach to fixing System.Buffers reference issue

* Ensure we don't replace the version shipped with the product
* Add explicit reference to 4.5.0 in Project layer
* Ensure project dependencies are such that it's deployed last
  • Loading branch information...
nickwesselman committed Aug 8, 2019
1 parent edb9ed2 commit 3e4cb1e461cd74150c094343ed8360c37130a802
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!--
Referencing in Directory.build.props will prevent Visual Studio from expanding the globs when you rename a project.
-->
<ItemGroup>
<ProjectReference Include="..\..\..\Foundation\*\code\*.csproj" />
<ProjectReference Include="..\..\..\Feature\*\code\*.csproj" />
</ItemGroup>
</Project>
@@ -2,10 +2,6 @@
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<!-- Remove problematic assembly redirect found in 9.2. -->
<dependentAssembly xdt:Transform="RemoveAll"
xdt:Locator="Condition(./_defaultNamespace:assemblyIdentity/@name='System.Buffers')"></dependentAssembly>

<!-- Update aseembly binding to resolve 9.2 w3wp crash in some environments. Related to https://kb.sitecore.net/articles/494291 -->
<dependentAssembly xdt:Transform="RemoveAll"
xdt:Locator="Condition(./_defaultNamespace:assemblyIdentity/@name='System.Security.Cryptography.Algorithms')"></dependentAssembly>
@@ -62,6 +62,8 @@
<PackageReference Include="Microsoft.Web.Infrastructure" Version="1.0.0.0" />
<PackageReference Include="Microsoft.Web.Xdt" Version="2.1.1" />
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
<!-- Need to explicitly reference to ensure compatible version: https://sitecore.stackexchange.com/questions/20379/sitecore-9-2-could-not-load-file-or-assembly-system-buffers-or-one-of-its-dep/20380#20380 -->
<PackageReference Include="System.Buffers" Version="4.5.0" />
<PackageReference Include="System.ComponentModel" Version="4.0.1" />
<PackageReference Include="System.Diagnostics.Debug" Version="4.0.11" />
<PackageReference Include="System.Globalization" Version="4.0.11" />
@@ -171,6 +173,10 @@
<Name>Sitecore.Foundation.SitecoreExtensions</Name>
<Private>True</Private>
</ProjectReference>
<ProjectReference Include="..\..\Common\code\Sitecore.Common.Website.csproj">
<Project>{c98ead78-4d83-4789-a621-6011c3d7314d}</Project>
<Name>Sitecore.Common.Website</Name>
</ProjectReference>
</ItemGroup>
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
@@ -189,15 +195,15 @@
<Output TaskParameter="Include" ItemName="StyleCopFiles" />
</CreateItem>
<StyleCopTask ProjectFullPath="$(MSBuildProjectFile)" SourceFiles="@(StyleCopFiles)" ForceFullAnalysis="true" TreatErrorsAsWarnings="true" OutputFile="StyleCopReport.xml" CacheResults="true" />
<!--<Xslt Inputs="StyleCopReport.xml"
RootTag="StyleCopViolations"
Xsl="tools\StyleCop\StyleCopReport.xsl"
Output="StyleCopReport.html" />
<XmlRead XPath="count(//Violation)" XmlFileName="StyleCopReport.xml">
<Output TaskParameter="Value" PropertyName="StyleCopViolations" />
</XmlRead>
<!--<Xslt Inputs="StyleCopReport.xml"
RootTag="StyleCopViolations"
Xsl="tools\StyleCop\StyleCopReport.xsl"
Output="StyleCopReport.html" />
<XmlRead XPath="count(//Violation)" XmlFileName="StyleCopReport.xml">
<Output TaskParameter="Value" PropertyName="StyleCopViolations" />
</XmlRead>
<Warning Condition="$(StyleCopViolations) > 0" Text="StyleCop found $(StyleCopViolations) broken rules!" />-->
</Target>
<ProjectExtensions>
@@ -219,10 +225,10 @@
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target> -->
</Project>

0 comments on commit 3e4cb1e

Please sign in to comment.
You can’t perform that action at this time.