You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// <summary>
/// Expose the `OnChanged` event of a property.
/// </summary>
/// <typeparam name="T"></typeparam>
internal class EventAccessor<T> : IImmutable
{
/// <summary>
/// This event will be invoked whenever the value of the property of this accessor changes.
/// </summary>
public event EventHandler? OnChanged
{
add
{
_property.OnChanged += value;
}
remove
{
_property.OnChanged -= value;
}
}
protected readonly Immutable<T> _property;
}
Adding the primary constructor
internal class EventAccessor<T>(Immutable<T> value) : IImmutable
{
/// <summary>
/// This event will be invoked whenever the value of the property of this accessor changes.
/// </summary>
public event EventHandler? OnChanged
{
add
{
_property.OnChanged += value;
}
remove
{
_property.OnChanged -= value;
}
}
protected readonly Immutable<T> _property = value;
}
I am not sure where to report this bug, as it seems to be related to the new C# version, but the error is a MSB error, so I suppose I'm gonna start here.
Also: This bug is, atleast for me, not urgent; one can simple fallback to using the classic constructor (Although it was very annoying to track down the source of the error)
Throws the error: Error MSB6006 "csc.exe" exited with code -2146232797. Application C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\Roslyn\Microsoft.CSharp.Core.targets 84
Analysis
I have no experience in debugging this close to the source, but if it helps, here is the code snipped that visual studio tells me is throwing the error:
0qln
changed the title
[Bug]: Build failes for primary contructor, but not classic constructor
[Bug]: Build fails for primary contructor, but not classic constructor
Apr 25, 2024
Issue Description
I have the class
EventAccessor<T>
like following:Adding the primary constructor
and trying to run the project yields the error:
I am not sure where to report this bug, as it seems to be related to the new C# version, but the error is a
MSB
error, so I suppose I'm gonna start here.Also: This bug is, atleast for me, not urgent; one can simple fallback to using the classic constructor (Although it was very annoying to track down the source of the error)
Steps to Reproduce
I have stripped my original project down to the minimal stuff needed for the error to occur:
Expected Behavior
Successful build
Actual Behavior
Throws the error:
Error MSB6006 "csc.exe" exited with code -2146232797. Application C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\Roslyn\Microsoft.CSharp.Core.targets 84
Analysis
I have no experience in debugging this close to the source, but if it helps, here is the code snipped that visual studio tells me is throwing the error:
in the file
C:\Program Files\Microsoft Visual Studio\2022\Community\Msbuild\Current\Bin\Roslyn\Microsoft.CSharp.Core.targets
Versions & Configurations
msbuild -version
output:The text was updated successfully, but these errors were encountered: