Fix analyzer rebuild issue by targeting .NET Standard 2.0 and adding isolation properties #10
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes the analyzer rebuild issue where projects using the DataverseAnalyzer would encounter file locking errors during rebuild operations.
Problem
The analyzer was targeting .NET 8.0 instead of .NET Standard 2.0, which caused compatibility and isolation issues during development. When projects referenced the analyzer and attempted to rebuild, MSBuild would lock the analyzer assembly, preventing subsequent rebuilds with errors like "file is in use" or similar access violations.
Root Cause
net8.0instead of the recommendednetstandard2.0for Roslyn analyzersArgumentNullException.ThrowIfNull()which is incompatible with .NET Standard 2.0Changes
net8.0tonetstandard2.0for better compatibility across .NET versionsUseSharedCompilation=falseandRestoreProjectStyle=PackageReferenceto prevent assembly locking during rebuildsArgumentNullException.ThrowIfNull(context)with traditional null checks usingif (context is null) throw new ArgumentNullException(nameof(context))netstandard2.0instead ofnet8.0)Verification
The analyzer now follows standard Roslyn analyzer practices and should work reliably in all development scenarios without rebuild conflicts.
Fixes #9.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.