Skip to content

Commit

Permalink
Mark assembly as CLS compliant. Fixes #10
Browse files Browse the repository at this point in the history
  • Loading branch information
bgrainger committed Apr 14, 2022
1 parent 9e6ece0 commit 1f75757
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
4 changes: 4 additions & 0 deletions VersionHistory.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Version History

### 1.0.2

* Mark assembly as CLS compliant.

### 1.0.1

* Add support for .NET Framework 3.5.
Expand Down
12 changes: 8 additions & 4 deletions src/IndexRange/IndexRange.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<VersionPrefix>1.0.1</VersionPrefix>
<VersionPrefix>1.0.2</VersionPrefix>
<TargetFrameworks>net35;net45;net47;netstandard2.0;netstandard2.1</TargetFrameworks>
<CheckEolTargetFramework>false</CheckEolTargetFramework>
<LangVersion>10.0</LangVersion>
Expand All @@ -16,9 +16,7 @@
<Authors>Bradley Grainger</Authors>
<PackageTags>Index;System.Index;Range;System.Range;C#8</PackageTags>
<PackageProjectUrl>https://github.com/bgrainger/IndexRange</PackageProjectUrl>
<PackageReleaseNotes>* Add support for .NET Framework 3.5.
* Produce a deterministic build.
* Embed symbols in the NuGet package.</PackageReleaseNotes>
<PackageReleaseNotes>* Mark assembly as CLS compliant.</PackageReleaseNotes>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageIconUrl>https://raw.githubusercontent.com/bgrainger/IndexRange/master/icon.png</PackageIconUrl>
<PackageIcon>icon.png</PackageIcon>
Expand All @@ -31,6 +29,12 @@
<EmbedUntrackedSources>true</EmbedUntrackedSources>
</PropertyGroup>

<ItemGroup>
<AssemblyAttribute Include="System.CLSCompliantAttribute">
<_Parameter1>true</_Parameter1>
</AssemblyAttribute>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All"/>
<Using Include="System.Runtime.CompilerServices"/>
Expand Down
5 changes: 3 additions & 2 deletions src/IndexRange/Range.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,10 @@ public override string ToString()
/// It is expected Range will be used with collections which always have non negative length/count.
/// We validate the range is inside the length scope though.
/// </remarks>
#if !NET35
#if !NET35
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
#endif
[CLSCompliant(false)]
public (int Offset, int Length) GetOffsetAndLength(int length)
{
int start;
Expand Down

0 comments on commit 1f75757

Please sign in to comment.