Primitives nuget library reports missing properties
- Dominant language
- C#
- Stars
- 1.8k
- Forks
- 576
- Avg merge
- 6d 9h
- Merged PRs (30d)
- 2
Description
The ServiceModel.Primitives library (8.1.2 at last check) has a lib and ref copy of the DLLs. I have noted that these are missing some properties (in my case, OperationContext.InstanceContext).
The MS docs https://learn.microsoft.com/en-us/dotnet/api/system.servicemodel.instancecontext?view=net-9.0-pp for InstanceContext says that it includes an OperationContext property for .net8/9, however, that property cannot be found by the compiler (msbuild or dotnet).
To make things more confusing, the ILSpy plugin for visual studio decompiles the lib/ copy of the DLL, yet VS uses the ref/ copy to compile.
**To Reproduce**
1. This small project targets net472 and net9. It does not compile despite the docs saying it should.
[test.zip](https://github.com/user-attachments/files/21191328/test.zip)
**Expected behavior**
Compilation.
Contributor guide
Research direction
Start with the attached test.zip and compare the ServiceModel.Primitives lib/ and ref/ DLLs for the net472 and net9 targets. Check the referenced API surface for InstanceContext.OperationContext and compare it with the .NET 8/9 documentation. Done means the reproduction project compiles for the stated targets with the expected property available.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- api
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100