Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building main with Castle.Core 5.2.1 gives build errors (Possible null reference) #871

Open
304NotModified opened this issue Mar 9, 2025 · 1 comment

Comments

@304NotModified
Copy link
Contributor

304NotModified commented Mar 9, 2025

See #870

Error: /home/runner/work/NSubstitute/NSubstitute/src/NSubstitute/Proxies/CastleDynamicProxy/ProxyIdInterceptor.cs(28,29): error CS8602: Dereference of a possibly null reference. [/home/runner/work/NSubstitute/NSubstitute/src/NSubstitute/NSubstitute.csproj::TargetFramework=net8.0]
Error: /home/runner/work/NSubstitute/NSubstitute/src/NSubstitute/Proxies/CastleDynamicProxy/CastleInvocationMapper.cs(12,13): error CS8602: Dereference of a possibly null reference. [/home/runner/work/NSubstitute/NSubstitute/src/NSubstitute/NSubstitute.csproj::TargetFramework=net8.0]
Error: /home/runner/work/NSubstitute/NSubstitute/src/NSubstitute/Proxies/CastleDynamicProxy/CastleInvocationMapper.cs(27,72): error CS8603: Possible null reference return. [/home/runner/work/NSubstitute/NSubstitute/src/NSubstitute/NSubstitute.csproj::TargetFramework=net8.0]
Error: /home/runner/work/NSubstitute/NSubstitute/src/NSubstitute/Proxies/CastleDynamicProxy/CastleDynamicProxyFactory.cs(128,26): error CS8604: Possible null reference argument for parameter 'target' in 'object ProxyGenerator.CreateInterfaceProxyWithTarget(Type interfaceToProxy, Type[]? additionalInterfacesToProxy, object target, ProxyGenerationOptions options, params IInterceptor[] interceptors)'. [/home/runner/work/NSubstitute/NSubstitute/src/NSubstitute/NSubstitute.csproj::TargetFramework=net8.0]

See logs: https://github.com/nsubstitute/NSubstitute/actions/runs/13752672225/job/38455602274?pr=870

PS: There is a comment about
Castle.Core 5.2 and NSubstitute, but that seems about something else. castleproject/Core#684 (comment)

@304NotModified 304NotModified changed the title Building with Castle.Core 5.2.1 gives build errors Building main with Castle.Core 5.2.1 gives build errors Mar 9, 2025
@304NotModified
Copy link
Contributor Author

304NotModified commented Mar 9, 2025

I haven't tested NSubstitute locally with Castle.Core 5.2.1 yet. Maybe it isn't a runtime error with NSubstitute 5.3.0

@304NotModified 304NotModified changed the title Building main with Castle.Core 5.2.1 gives build errors Building main with Castle.Core 5.2.1 gives build errors (Possible null reference) Mar 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant