Skip to content

Commit

Permalink
Merge pull request #55 from Lombiq/issue/OSOE-49
Browse files Browse the repository at this point in the history
OSOE-49: Enforce Windows newlines for C# files to avoid false positives with IDE0055 warning.
  • Loading branch information
0liver authored May 26, 2022
2 parents beeba32 + 1007bdb commit f4408f8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
* text=auto

# Enforce Windows newlines for C# files to avoid false positives with IDE0055 warning.
# See https://github.com/Lombiq/Open-Source-Orchard-Core-Extensions/issues/106 for more information.
*.cs text eol=crlf
10 changes: 7 additions & 3 deletions Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,24 @@
<Import Project="$(MSBuildThisFileDirectory)CommonPackages.props" />

<ItemGroup>
<!-- Fixing the <"error CS8032: An instance of analyzer Microsoft.CodeAnalysis.[...]Analyzer cannot be created from
<!-- Note: This is fixed as of SDK version 6.0.202. If you need to build the solution on a system with an older SDK
version, please uncomment the PackageReferences below. Leave this commented out unless you are certain you need
it, because it is a risky workaround as it makes us use the compiler from NuGet instead of the SDK, which is
unexpected and discouraged according to Microsoft.Net.Compilers.Toolset's Readme too.
Fixing the <"error CS8032: An instance of analyzer Microsoft.CodeAnalysis.[...]Analyzer cannot be created from
[...]\.nuget\packages\microsoft.codeanalysis.csharp.codestyle\4.1.0\analyzers\dotnet\cs\Microsoft.CodeAnalysis.CSharp.CodeStyle.dll:
Could not load file or assembly 'Microsoft.CodeAnalysis, Version=4.1.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.."> by
adding "Microsoft.CodeAnalysis" AND "Microsoft.Net.Compilers" manually; see:
https://docs.microsoft.com/en-us/answers/questions/244179/microsoftcodeanalysis-problem.html -->
https://docs.microsoft.com/en-us/answers/questions/244179/microsoftcodeanalysis-problem.html
<PackageReference Include="Microsoft.CodeAnalysis.Compilers" Version="4.1.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers;</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Net.Compilers.Toolset" Version="4.1.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers;</IncludeAssets>
</PackageReference>
</PackageReference> -->
</ItemGroup>

<!-- Packages only for .NET Core and later. -->
Expand Down

0 comments on commit f4408f8

Please sign in to comment.