Skip to content
This repository has been archived by the owner on Dec 6, 2019. It is now read-only.

Commit

Permalink
[#476] Change approach to fixing System.Buffers reference issue
Browse files Browse the repository at this point in the history
* 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 3e4cb1e
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 18 deletions.
10 changes: 10 additions & 0 deletions src/Project/Common/code/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -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>
4 changes: 0 additions & 4 deletions src/Project/Common/code/Web.config.xdt
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
34 changes: 20 additions & 14 deletions src/Project/Habitat/code/Sitecore.Habitat.Website.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -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" />
Expand Down Expand Up @@ -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>
Expand All @@ -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>
Expand All @@ -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.