primordic/IssueDupesLite huggingface dataset:
Repository: dotnet/roslyn-analyzers

Issue #1325: CA1010 false positive
Created: 2017-10-18T22:25:21Z
Analyzer package
Microsoft.CodeAnalysis.FxCopAnalyzers
Analyzer
CA1010
Repro steps
// external code, out of my control
public class ThirdPartyType : IEnumerable
{
    ...
}

public class MyClass : ThirdPartyType
{
}
Expected behavior
No violation, since it is not my code violating the rule.
Actual behavior
error CA1010: Collections should implement generic interface

Duplicate issue #1509: CA1003 false positive and bad message
Created: 2018-01-08T14:48:42Z
Analyzer package
Microsoft Code Analysis, version 2.6.0.6241303
Analyzer
CA1003
Repro steps
Create a WPF project. In there, add the following class:
using System.Windows;

public class Example : UIElement
{
    public static readonly RoutedEvent ExpandedEvent = EventManager.RegisterRoutedEvent(
        "Expanded", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(Example));

    public event RoutedEventHandler Expanded
    {
        add { AddHandler(ExpandedEvent, value); }
        remove { RemoveHandler(ExpandedEvent, value); }
    }
}

Expected behaviour
No diagnostics are reported.
Actual behaviour
A diagnostics is reported on the Expanded identifier, with description Remove {0} and replace its usage with EventHandler<T>
Note that there are two problems here:

a diagnostic should not be reported, as there is absolutely nothing the developer can do to avoid the diagnostic (other than suppress it)
the message contains {0}

Closing comment (2018-01-09T21:18:40Z): Adding @sharwell @333fred as this seems to be very similar to #1325 and this comment from Sam clarifies our stance - RoutedEventHandler is not a generic event handler and hence doesn't follow recommended guidelines. You should suppress this diagnostic if you feel there is no alternate implementation for you that follows the guidelines.
I will send a PR to fix the second issue: the message contains {0}
Repository: dotnet/roslyn-analyzers

Issue #5479: CA2101 false positive
Created: 2021-09-14T22:46:25Z
Analyzer
Diagnostic ID: CA2101: Specify marshaling for P/Invoke string arguments
Analyzer source
NuGet Package: Microsoft.CodeAnalysis.NetAnalyzers
Version: 5.0.3
Describe the bug
This code produces a CA2101 diagnostic.
        [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Ansi)]
        private static extern IntPtr GetProcAddress(IntPtr hModule, string lpProcName);
The code fix offered changes Ansi to Unicode, although this method is only exposed as ANSI, so the code fix would produce faulty code, and the analyzer should not tell me to specify the string marshaling when I already have.

Duplicate issue #6071: False Positive on CA2101 (Specify marshaling for P/Invoke string arguments)
Created: 2022-07-17T10:35:54Z
Version Used:
Version 17.3.0 Preview 2.0
Rosyln 4.3.0-2.22307.7
Steps to Reproduce:

define a P/Invoke and set CharSet explicitly to Ansi
run CodeAnalysis


Expected Behavior:
it was set, it should not complain it wasn't set
Actual Behavior:
it suggests to convert Ansi to Unicode which will be wrong; the backend library handles const char* and not const wchar_t*

Closing comment (2022-12-12T19:22:05Z): Duplicate of #5479
Repository: dotnet/roslyn-analyzers

Issue #1320: CA1052 false positive
Created: 2017-10-18T00:51:40Z
Analyzer package
Microsoft.CodeAnalysis.FxCopAnalyzers
Analyzer
CA1052
Repro steps
public sealed class EmptyDto
{
    public static readonly EmptyDto Instance = new EmptyDto();

    private EmptyDto()
    {
    }
}
Expected behavior
No violation (because the type is sealed).
Actual behavior
warning CA1052: Type 'EmptyDto' is a static holder type but is neither static nor NotInheritable

Duplicate issue #1292: CA1052: StaticHolderTypesShouldBeSealed, but the type *is* sealed
Created: 2017-09-16T13:08:05Z
Analyzer package
Microsoft.CodeAnalysis.FxCopAnalyzers, v2.3.0-beta1
Analyzer
StaticHolderTypesShouldBeSealed
Repro steps

Write this class:

        [SuppressMessage("Microsoft.Design", "CA1053:StaticHolderTypesShouldNotHaveConstructors", Justification = "Must not be static to make a Dummy.")]
        public sealed class ConcurrentCreationDummy
        {
            private static int creationAttempts;

            public ConcurrentCreationDummy()
            {
                if (IsCreatingFirstInstance())
                {
                    CreatingFirstInstance.Set();
                    CreatedSecondInstance.Wait();
                }
            }

            public static ManualResetEventSlim CreatingFirstInstance { get; } = new ManualResetEventSlim();

            public static ManualResetEventSlim CreatedSecondInstance { get; } = new ManualResetEventSlim();

            private static bool IsCreatingFirstInstance()
            {
                return Interlocked.Increment(ref creationAttempts) == 1;
            }
        }

(note: this is a nested class, in case it matters)
Expected behavior
No warning should be reported, since the type is sealed.
Actual behavior
CA1052 is reported with this message:

Type 'ConcurrentCreationDummy' is a static holder type but is neither static nor NotInheritable

(not sure why NotInheritable instead of sealed... this is C#, not VB)

Closing comment (2017-11-10T21:56:01Z): Seems similar to #1320 but the test case seems to be different (public ctor and static fields).
Repository: dotnet/roslyn-analyzers

Issue #464: Port FxCop rule CA1811: AvoidUncalledPrivateCode
Created: 2015-11-21T19:36:33Z
Title: Avoid uncalled private code
Description:
A private or internal (assembly-level) member does not have callers in the assembly; it is not invoked by the common language runtime; and it is not invoked by a delegate.
Dependency: IOperation
Notes:
Implementation: Create a dictionary at compilation start; add to it each time you see a function call.

Duplicate issue #2193: CA1811: AvoidUncalledPrivateCode, not working if class contains a typeof() call
Created: 2019-03-12T08:54:48Z
I've seen other issues mentioning rule CA1811, so I suppose this is the right place to post this one.
The rule stops working if the source code contains a call to typeof(), either in class code or in a class attribute (like [ToolboxBitmap]). The argument of typeof() must be the class itself.
VisualStudio version
Microsoft Visual Studio Community 2017
Version 15.9.8
Repro steps

Enable rule CA1811
Add the following source code to project

namespace TestNamespace
{
    // ========================================================
    // Uncomment the line below and the CA1811 rule won't trigger anymore...
    // ========================================================
    //[System.Drawing.ToolboxBitmap(typeof(TestClass), "image.bmp")]
    public class TestClass
    {
        private void TestMethod()
        {
            // ========================================================
            // Uncomment the line below and the CA1811 rule won't trigger anymore...
            // ========================================================
            //System.Console.WriteLine(typeof(TestClass).ToString());
        }

        private void UncalledMethod()
        {
            System.Console.WriteLine("This method is not called...");
        }
    }
}


run code analysis on the code and it will trigger two CA1811 warnings on the 2 class methods
uncomment the [ToolboxBitmap] class attribute
run code analysis again and now the warnings do not trigger
comment back the attribute and uncomment the body of TestMethod() method
run code analysis again and the warnings do not trigger again

Expected behavior
CA1811 triggering should be unrelated to typeof() calls...
Actual behavior
Adding a call to typeof() anywhere in a class brokes CA1811 rule.
Note
Update: the argument of typeof() must be the class itself for the rule to break.

Closing comment (2019-07-01T23:37:46Z): Duplicate of #464
This rule has not yet been implemented in FxCop analyzers package. We have an equivalent implementation in VS IDE that flags unused private members.
Repository: dotnet/roslyn-analyzers

Issue #2195: PublicApiAnalyzer Fix All duplicate entries for partial types
Created: 2019-03-12T17:13:14Z
Analyzer package
Example: DotNetAnalyzers.PublicApiAnalyzer
Package Version
Example: 2.9.0-beta1.19162.2+321600d1
Diagnostic ID
Repro steps
Tested in Visual Studio 2017 version 15.9.8.

Create a public partial type with parts in multiple files
Delete the contents of the Public API files
Apply a Fix All operation to add all the missing APIs

Expected behavior
The partial type appears once in PublicAPI.Unshipped.txt.
Actual behavior
The partial type appears once in PublicAPI.Unshipped.txt for each part.

Duplicate issue #1193: PublicAPI analyzer double-lists accessors of forwarded types
Created: 2017-05-11T20:32:46Z
If a type is forwarded, we're listing both the properties and accessors twice:
Microsoft.CodeAnalysis.Options.OptionKey.Language { get; } -> string (forwarded, contained in Microsoft.CodeAnalysis) 
Microsoft.CodeAnalysis.Options.OptionKey.Language.get -> string (forwarded, contained in Microsoft.CodeAnalysis) 

We don't do this for non-forwarded types.

Closing comment (2019-07-01T20:15:44Z): Duplicate of #2195
Repository: dotnet/roslyn-analyzers

Issue #6573: Primary constructor parameter gives incorrect "could be static" warning
Created: 2023-04-06T15:59:21Z
Version Used: Version 17.7.0 Preview 1.0 [33603.545.main]
Steps to Reproduce:

Compiler this code:

using System.Collections.Generic; 
using System.Linq;

public class Student(int id, string name, IEnumerable<decimal> grades)
    {
        public Student(int id, string name) : this(id, name, new List<decimal>()) { }
        public int Id => id;
        public string Name { get; set; } = name.Trim();
        public decimal GPA => grades.Any() ? grades.Average() : 4.0m;
    }

Check for warnings

Diagnostic Id: CA182
Expected Behavior: Does not offer to change to static.
Actual Behavior: For two of the three primary ctor parameters in the example, an offer is made to change to static. It is not clear why 2 of the 3.

Duplicate issue #6786: CA1822 is incorreclty reported for classes with primary constructors
Created: 2023-07-20T16:16:12Z
Analyzer
Diagnostic ID: CA1822 Mark members as static
Analyzer source
NuGet Package: Microsoft.CodeAnalysis.NetAnalyzers
Version: 8.0.0-preview1.23165.1
Describe the bug

Steps To Reproduce
class A(int i)
{
    void Foo() // <- says Foo can be marked as static
    {
        Console.WriteLine(i); // it uses i, to it can't
    }
}

Closing comment (2023-07-21T08:19:16Z): Duplicate of #6573
Repository: dotnet/roslyn-analyzers

Issue #1478: [Proposal] Add analyzer to warn about infinite recursion
Created: 2017-12-14T01:28:02Z
Proposal
We should consider adding an analyzer to warn when a method or property unconditionally recurses (e.g. has no exit points) and will cause a StackOverflowException at runtime. Here's an example of a plausible scenario where this analyzer could help:
public int X
{
    get => X; // Forgot base.X
    set { AdditionalLogic(); X = value; } // Forgot base.X
}
I just ran into a Roslyn bug myself where this would have helped. See dotnet/roslyn#23777
Potential False Positives
The analyzer should not issue warnings for the following scenarios:
int M(int n) {
    if (...) { return 3; } // Possible exit point
    return M(n - 1);
}

int M(int n) {
    if (...) { throw ...; } // Possible exit point
    return M(n - 1);
}
Other things to consider

Mutually recursive methods
Multiple recursion points, e.g.

// Should fire here
public int M() {
    if (...) {
        return M();
    } else {
        return M();
    }
}

Duplicate issue #5846: Detect infiniate call to same function
Created: 2018-11-01T08:07:55Z
View on Developer Community
private PThing _Thing;
public PThing Thing { get => _Thing; set { Thing = value; } }
Visual Studio should throw a warning for the error above, as the developer has accidently called the same function without any if, while, or break, and will receive a stack overflow exception.
This should have an underscore, so
private PThing _Thing;
public PThing Thing { get => _Thing; set { _Thing = value; } }
Ideally, Visual Studio should offer to return the private variable and change this to _Thing automatically.

Closing comment (2022-12-12T19:41:10Z): Duplicate of #1478
Repository: dotnet/roslyn-analyzers

Issue #2888: CA1822 Code fix strips the async keyword.
Created: 2019-10-02T13:55:24Z
Analyzer package
FxCopAnalyzers
Package Version
2.9.4 & 2.9.5
Diagnostic ID
CA1822
Repro steps
Enter the following code, wait for the rule to identify that the BarAsync method could be static and then apply the code fix.
public async Task<int> BarAsync()
{
    await Task.Delay(20).ConfigureAwait(false);
    return 20;
}
Expected behavior
I would expect it to simply add the static keyword,
public static async Task<int> BarAsync()
{
    await Task.Delay(20).ConfigureAwait(false);
    return 20;
}
Actual behavior
The current behaviour is that static keyword replaces the async keyword, resulting in compiler errors.
public static Task<int> BarAsync()
{
    await Task.Delay(20).ConfigureAwait(false);
    return 20;
}

Duplicate issue #3124: Make static refactoring (CA1822) removes "async" modifier
Created: 2019-12-19T20:45:47Z
This issue has been moved from a ticket on Developer Community.

When using the "Make static" refactoring, Visual Studio replaces "async" with "static" rather than making the method "static async."
i.e.:
Original method signature:
public async Task GetTask() { }
Refactored method signature:
public static Task GetTask() { }
Expected refactoring:
public static async Task GetTask() { }

Original Comments
Visual Studio Feedback System on 11/13/2019, 02:38 AM:
We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.
Visual Studio Feedback System on 11/15/2019, 03:06 PM:
This issue is currently being investigated. Our team will get back to you if either more information is needed, a workaround is available, or the issue is resolved.

Original Solutions
(no solutions)

Closing comment (2020-01-03T13:56:10Z): Duplicates #2888 which was fixed.
Repository: dotnet/winforms

Issue #3390: Winforms child window is not scaled according to the DPI of the moitor.
Created: 2020-06-04T00:50:49Z
Have you experienced this same bug with .NET Framework?:

Yes
Problem description:
Winfrom application is unable to render the child window appropriately according to the current monitor DPI when it's DpiAwareness is set to PermonitorV2. Also, when the application is dragged from one monitor to another with different DPI setting and then a new child window is opened, the child window is not rendered according to the monitor's DPI.
Same behavior is experienced if  the scaling of the monitor is changed and  then a new child window is opened, the child window is not rendered according to current monitor's DPI. Below is a screenshot clicked after dragging the application from one monitor to another and the front window was opened after dragging the application to second

Expected behavior:
Scaling of the parent and child forms should be consistent and according to the monitor DPI that they are rendered.
Minimal repro:
WindowsFormsApplication (2).zip

Duplicate issue #3411: Winforms child window is not scaled according to the DPI of the monitor on signal monitor
Created: 2020-06-08T08:50:44Z
Have you experienced this same bug with .NET Framework?:
Yes


.NET Core Version:
Latest .net core sdk 5.0 preview7 20307.3


More info:
The issue also can reproduce when changing the Display Scale and Layout settings from 300% to 100% of the monitor in which the application is running.
Problem description:
Winform application is unable to render the child window appropriately according to the current monitor DPI when it's DpiAwareness is set to PermonitorV2.
Expected behavior:
Scaling of the parent and child forms should be consistent and according to the monitor DPI that they are rendered.
Minimal repro:

Open the solution in Visual Studio 2019 and run the application on 100% monitor.(
CoreProject.zip)
Change the Display Scale and Layout settings from 100% to 300% of the monitor in which the application is running.
Note: Do not stop the running application
Open child window by clicking on the "Open" button in the Main Form

Closing comment (2021-11-24T06:55:13Z): @dreddy-work It seems a dup of #3390, verified this issue in the latest .Net 7.0 SDK build, it doesn't reproduce when opening child window in secondary screen directly or changing DPI when app is running on single monitor.
Repository: dotnet/winforms

Issue #3580: Default values are not shown after setting SelectedObject property for PropertyGird control 
Created: 2020-07-15T07:39:57Z
.NET SDK Version:
5.0.100-preview.8.20363.2


Have you experienced this same bug with .NET Framework?
No


Problem description:
Default values are not shown after setting SelectedObject property for PropertyGird control.

Expected behavior:
After setting the SelectedObject property for the PropertyGird control, it should display correct default values.

More info:


This is a regression issue,  and it can repro from 5.0.100-preview.8.20360.10 to latest .NET SDK, it cannot repro on .Net Core 5.0.100-preview.8.20359.5, below is the the version number of System.Windows.Forms.dll in 5.0.100-preview.8.20359.5:



This issue cannot repro with .NET Core 3.1.


This issue also occurs in design time.



Minimal repro:

Create a WinForms .Net Core application
Add a PropertyGird control to Form
Press F4 to go to the Property Browser Window, set its SelectedObject property to Form1
Build and run the application, observe the PropertyGrid

Or

Extract the attached project and open it
PropertyGirdDefaultValue.zip
Build and run this application, observe the PropertyGrid

Duplicate issue #3636: Properties window is blank
Created: 2020-07-24T06:29:21Z
.NET Core Version:
5.0.100-rc.1.20373.1


Have you experienced this same bug with .NET Framework?:
No


Problem description:
Properties window is blank, we cannot see any properties for form or added controls, and no properties and events toolbar in Properties window.
This is a regression issue. It cannot repro .Net 5.0 SDK build: 5.0.100-rc.1.20371.1

Expected behavior:
All properties and events are in Properties window

Minimal repro:
The repro step is very simple, just create an empty app

Create a WinForms .Net Core application
Focus on Form designer, and go to Properties window or press F4
Observe Properties window

Closing comment (2020-07-24T08:44:24Z): This looks like a duplicate of #3580

This issue just repro today 5.0 build, not repro those builds yesterday and last week.
Repository: dotnet/winforms

Issue #6144: ApplicationConfiguration Code Generation bug
Created: 2021-11-09T16:41:45Z
.NET Core Version:
6.0.0

Problem description:
When windows system language is set to a language which uses comma as decimal separator the code generator which creates the ApplicationConfiguration class messes up the decimal separator in emSize for the font
For instance when <ApplicationDefaultFont>Microsoft Sans Serif, 8.25pt</ApplicationDefaultFont> is set int the csproj file, the following is generated, which obviously does not compile:
Application.SetDefaultFont(new Font(new FontFamily("Microsoft Sans Serif"), 8,25f, (FontStyle)0, (GraphicsUnit)3));
The bug is probably here:

  
    
      winforms/src/System.Windows.Forms.Analyzers/src/System/Windows/Forms/ApplicationConfig.FontDescriptor.cs
    
    
         Line 35
      in
      c87540e
    
  
  
    

        
          
           return $"new Font({fontFamily}, {Size}f, (FontStyle){(int)Style}, (GraphicsUnit){(int)Unit})"; 
        
    
  


It obviously should use invariant culture to create that string.

Duplicate issue #6614: ApplicationConfiguration source generator does not support decimal font size
Created: 2022-02-03T15:47:13Z
.NET Core Version:
6.0.101


Have you experienced this same bug with .NET Framework?:
No


Problem description:
The source generator for ApplicationConfiguration.Initialize() does not handle decimal font sizes correctly. When I tried to use the old default font settings from .NET Framework in .NET 6.0 via project file, I got a build error.
The source generator uses a decimal comma instead of a decimal point:
//                                                                           ↓
Application.SetDefaultFont(new Font(new FontFamily("Microsoft Sans Serif"), 8,25f, (FontStyle)0, (GraphicsUnit)3));
//                                                                           ↑
OS: Windows 10.0.19044.1466
OS locale: de-DE
Expected behavior:
The source generator must use a decimal point for all OS locales like already written in the .csproj file:
//                                                                           ↓
Application.SetDefaultFont(new Font(new FontFamily("Microsoft Sans Serif"), 8.25f, (FontStyle)0, (GraphicsUnit)3));
//                                                                           ↑
Minimal repro:

Create a new Windows Forms project dotnet new winforms
Add the following line to your .csproj file (this is officially recommended)

<ApplicationDefaultFont>Microsoft Sans Serif, 8.25pt</ApplicationDefaultFont>

Try to build your application and watch compiler errors

Closing comment (2022-02-03T20:34:38Z): It seems it is a duplicate of #6144, which has been fixed by #6164 and will be released in 6.0.2
Repository: dotnet/winforms

Issue #11949: [Dark Mode] Button with FlatStyle 'Standard' is not in dark mode on 100% dpi after enabled SystemColorMode.Dark
Created: 2024-08-21T03:26:38Z
.NET version
9.0.0-rc.1.24418.2 + private dlls built from winforms repo main branch
Did it work in .NET Framework?
No
Did it work in any of the earlier releases of .NET Core or .NET 5+?
This is a new feature Dark Mode: #11857
Issue description
On 100% DPI, Button with FlatStyle 'Standard' is not in dark mode after enabled SystemColorMode.Dark, it cannot repro when monitor's dpi is greater than 100%.
on 100%DPI:

on 150%DPI:

Steps to reproduce

Create a WinForms .NET application with button control, set button's FlatStyle == Standard
Enable DarkMode by Application.SetColorMode(SystemColorMode.Dark) in Program.cs file
Run the application to observe

Duplicate issue #13159: VB.NET .NET 9.0 DarkMode preview - InputBox() has bad button colors
Created: 2025-03-18T20:40:28Z
.NET version
.NET 9
Did it work in .NET Framework?
No
Did it work in any of the earlier releases of .NET Core or .NET 5+?
No, it's preview feature
Issue description
InputBox has broken DarkMode - buttons are not dark

Steps to reproduce
just call: InputBox("Hello World", "App", "test")

Closing comment (2025-03-19T20:34:53Z): Since this is a duplicate of #11949 I'm going to close this one and we can continue the discussion on the original issue.
Repository: dotnet/winforms

Issue #4593: The default value is not displayed in the correct position after setting SelectedObject property for PropertyGird control
Created: 2021-02-23T08:33:49Z
.NET Core Version: .Net SDK 6.0.100-preview.2.21120.3, .Net SDK 5.0.104 from March 2021 Update Test Pass


Have you experienced this same bug with .NET Framework?:
No


Problem description:
The default value is not displayed in the correct position after setting SelectedObject property for PropertyGird control. It seems to be displayed in the upper left corner of the propertygrid.


Expected behavior:
After setting the SelectedObject property for the PropertyGird control, it should display correct default values.

More Info:
This is a regression issue, it cannot reproduce on .Net SDK 5.0.103 and .Net SDK 6.0.100-preview.2.21111.1, but can reproduce on .Net SDK 5.0.104 from March 2021 Update Test Pass and .Net SDK 6.0.100-preview.2.21112.1.
Minimal repro:

Create a WinForms .Net Core application.
Add a PropertyGird control to Form.
Press F4 to go to the Property Browser Window, set its SelectedObject property to Form1.
Build and run the application, observe the PropertyGrid.

Or


Extract the attached project and open it.
Test.zip


Build and run this application, observe the PropertyGrid.

Duplicate issue #4673: Propertygrid displays all values in top-left corner of component
Created: 2021-03-11T12:28:55Z
.NET Core Version: 5.0 (Microsoft.WindowsDesktop.App 5.0.4)


Have you experienced this same bug with .NET Framework?: No


Problem description:
In the 5.0.4 runtime release of March 9 2021, a display issue has been introduced for the WinForms PropertyGrid component that was not present in the previous 5.0.3 release. It seems that all values the property grid should display are placed in the top-left corner of the component, instead of in their cell next to their property name label.

Expected behavior:
Values are displayed in their corresponding cell.
Minimal repro:
The issue can be reproduced by adding a PropertyGrid component to a Form and setting the SelectedObject to any object. Attached is a minimal example. Make sure to have Microsoft.WindowsDesktop.App 5.0.4 installed when running it.
PropertyGridTextLocationIssue.zip

Closing comment (2021-03-12T01:04:20Z): Duplicate of #4593
Repository: dotnet/winforms

Issue #8905: [API Proposal] Ability to set the default icon for Forms.
Created: 2023-03-27T17:46:59Z
Is your feature request related to a problem? Please describe
Currently the only way to set the default icon is via reflection.  This is risky as it is looking at the internals of the object.  It would be best to expose an API to set it.
Example of a way to set the icon currently:
typeof(Form).GetField("defaultIcon", BindingFlags.NonPublic | BindingFlags.Static).SetValue(null, SystemIcons.Shield);
Describe the solution you'd like and alternatives you've considered
namespace System.Windows.Forms;

public class Form
{
    /// <summary>
    ///  Gets / sets the default icon used for a <see cref="System.Windows.Forms.Form"/>.
    /// </summary>
    /// <exception cref="System.ArgumentNullException">value is null.</exception>
    public static System.Drawing.Icon DefaultIcon { get; set; }
}
Will this feature affect UI controls?
Designer should not have to change for this.
It should not impact accessibility.
It should not need to be localized.

Duplicate issue #6955: NotifyIcon does not use the appropriate icon size
Created: 2022-04-02T17:14:28Z
.NET version
6.0
Did it work in .NET Framework?
No
Did it work in any of the earlier releases of .NET Core or .NET 5+?
No response
Issue description
There is a long-known issue that NotifyIcon does not use the proper icon size.  Rather than using the small icon size, it takes whatever size the System.Drawing.Icon has been constructed for (usually the default icon size), which Windows then scales down to the small icon size.
There is a work-around:
_notifyIcon.Icon = new Icon(_notifyIcon.Icon, SystemInformation.SmallIconSize);

NotifyIcon should do this itself.
Steps to reproduce

Create a new WinForms project, name it "NotifyIconBug".
Add a resource file and name it Resource1.resx.
Add an icon with sizes of 16x16 and 32x32 to the Resource1.resx and name it application_icon.  Use images for the two sizes of the icon that are distinguishable from one another.
Add a NotifyIcon to Form1 and name it notifyIcon1.
Set the Icon property of the NotifyIcon to the icon: notifyIcon1.Icon = Resource1.application_icon;
Run the project, having the notification area on a low-DPI display.  The 32x32 size of the icon is displayed scaled down to 16x16 rather than displaying the 16x16 size.

I'd guess you could also recreate this on a high-DPI display as well if you scale up the above sizes accordingly.

Closing comment (2023-07-15T04:09:13Z): related to #8905 (multi-icon)
Repository: dotnetcore/CAP

Issue #418: Support for EntityFramework 3.0
Created: 2019-10-30T10:36:28Z
I cannot start my project

Duplicate issue #488: CAP2.6 in .Net Core 3.1 MVC Project
Created: 2020-01-16T01:42:16Z
in my startup.cs,when I use services.AddAutoMapper();Here will has a error.

Here is the detail message:
Unable to load one or more of the requested types.
Method 'CommitAsync' in type 'Microsoft.EntityFrameworkCore.Storage.CapEFDbTransaction' from assembly 'DotNetCore.CAP.MySql, Version=2.6.0.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.

Closing comment (2020-01-16T06:08:46Z): duplicate of #418
Repository: dotnetcore/CAP

Issue #570: ado.net with dapper get an exception
Created: 2020-05-21T05:11:38Z
my demo repo:
https://github.com/wswind/Learn-CAP/tree/master/Api1
I use dapper with cap.
  services.AddCap(x =>
            {
                // If you are using ADO.NET, choose to add configuration you needed：
                x.UseSqlServer("Server=.;Database=BFF;Trusted_Connection=True;MultipleActiveResultSets=true");
                x.UseRabbitMQ(o => {
                    o.HostName = "192.168.56.10";
                    o.UserName = "rabbit";
                    o.Password = "rabbit";
                });
            });


        [Route("~/adonet/transaction")]
        public IActionResult AdonetWithTransaction()
        {
            using (var connection = _sqlFactory.CreateConnection())
            {
                using (var transaction = connection.BeginTransaction(_capBus, autoCommit: true))
                {
                    //your business logic code
                    TestTable testTable = new TestTable()
                    {
                        A = "f",
                        B = "g"
                    };
                    connection.Insert<TestTable>(testTable, transaction);
                    _capBus.Publish("testtable.insert", testTable); ## here is the exception
                }
            }
            return Ok();
        }

But an exception occurs when try to publish the message to rabbitmq.

call stack:
   at DotNetCore.CAP.SqlServerCapTransaction.AddToSent(MediumMessage msg)
   at DotNetCore.CAP.Internal.CapPublisher.Publish[T](String name, T value, IDictionary`2 headers)
   at DotNetCore.CAP.Internal.CapPublisher.Publish[T](String name, T value, String callbackName)
   at Api1.Controllers.PublishController.AdonetWithTransaction() in D:\repos\open-mine\Learn-CAP\Api1\Controllers\PublishController.cs:line 36
   at Microsoft.Extensions.Internal.ObjectMethodExecutor.Execute(Object target, Object[] parameters)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<<InvokeActionMethodAsync>g__Logged|12_1>d.MoveNext()

I use System.Data.SqlClient to create SqlConnection,I didn't use Microsoft.Data.SqlClient.
What shall I do to fix this error?

Duplicate issue #601: Unable to cast object of type 'System.Data.SqlClient.SqlConnection' to type 'Microsoft.Data.SqlClient.SqlConnection
Created: 2020-07-06T07:10:07Z
你好，更新至netcore 3.1版本使用SqlServer并用ADO.net进行连接发布消息时报“Unable to cast object of type 'System.Data.SqlClient.SqlConnection' to type 'Microsoft.Data.SqlClient.SqlConnection'.”错误。
var transactionKey = ((SqlConnection) dbTransaction.Connection).ClientConnectionId;

Closing comment (2020-07-06T08:43:38Z): Duplicate of  #570
Repository: dotnetcore/CAP

Issue #665: does cap support delay queue？
Created: 2020-09-11T02:43:08Z
when i query db,it return nothing,but
i am sure that,it would return data after several hours. when i get nonthing,i need
publish a delay queue excute after 1 hour until it returns sm data. but cap doesn't support delay queue currently. how to do?thanks!

Duplicate issue #776: cap是否支持延时消息
Created: 2021-02-02T06:32:22Z
假设我想指定消息20分钟之后在被消费，cap是否支持

Closing comment (2021-02-02T06:40:38Z): Duplicate of #665
Repository: dotnetcore/CAP

Issue #264: How to configure RabbitMQ Cluster?
Created: 2019-01-03T02:11:13Z
[√] Question or discussion


Question

如果RabbitMQ集群，在UseRabbitMQ的时候应该怎么配置呢？

Duplicate issue #423: Does it support rabbitmq clustering?
Created: 2019-11-12T08:55:59Z

Closing comment (2019-11-12T09:01:27Z): Duplicate of #264
Repository: dotnetcore/CAP

Issue #952: Consumer register cancellation token source null reference 
Created: 2021-07-19T11:13:42Z
测试过程中，并没有使用到CAP相关功能。
机器配置如下：
CPU：i5-6400 4Core
内存：8G
网络：回环
测试工具：JMeter
线程数：3000
测试过程中：CPU100%，内存100%
错误信息如下：
2021-07-19 18:21:25,064 WARN  DotNetCore.CAP.Internal.ConsumerRegister - RabbitMQ consumer cancelled. --> amq.ctag-snpfkK3zg284Ij9GVZbO6Q
2021-07-19 18:21:25,065 WARN  DotNetCore.CAP.Internal.ConsumerRegister - RabbitMQ consumer shutdown. --> Unexpected Exception
2021-07-19 18:21:28,306 WARN  DotNetCore.CAP.Processor.TransportCheckProcessor - Transport connection is unhealthy, reconnection...
2021-07-19 18:21:28,308 WARN  DotNetCore.CAP.Processor.InfiniteRetryProcessor - Processor 'DotNetCore.CAP.Processor.TransportCheckProcessor' failed. Retrying...
System.NullReferenceException: Object reference not set to an instance of an object.
at DotNetCore.CAP.Internal.ConsumerRegister.ReStart(Boolean force)
at DotNetCore.CAP.Processor.TransportCheckProcessor.ProcessAsync(ProcessingContext context)
at DotNetCore.CAP.Processor.InfiniteRetryProcessor.ProcessAsync(ProcessingContext context)
2021-07-19 18:21:31,306 WARN  DotNetCore.CAP.Processor.TransportCheckProcessor - Transport connection is unhealthy, reconnection...
2021-07-19 18:21:31,307 WARN  DotNetCore.CAP.Processor.InfiniteRetryProcessor - Processor 'DotNetCore.CAP.Processor.TransportCheckProcessor' failed. Retrying...
System.NullReferenceException: Object reference not set to an instance of an object.
at DotNetCore.CAP.Internal.ConsumerRegister.ReStart(Boolean force)
at DotNetCore.CAP.Processor.TransportCheckProcessor.ProcessAsync(ProcessingContext context)
at DotNetCore.CAP.Processor.InfiniteRetryProcessor.ProcessAsync(ProcessingContext context)
2021-07-19 18:21:34,306 WARN  DotNetCore.CAP.Processor.TransportCheckProcessor - Transport connection is unhealthy, reconnection...
2021-07-19 18:21:34,306 WARN  DotNetCore.CAP.Processor.InfiniteRetryProcessor - Processor 'DotNetCore.CAP.Processor.TransportCheckProcessor' failed. Retrying...
System.NullReferenceException: Object reference not set to an instance of an object.
at DotNetCore.CAP.Internal.ConsumerRegister.ReStart(Boolean force)
at DotNetCore.CAP.Processor.TransportCheckProcessor.ProcessAsync(ProcessingContext context)
at DotNetCore.CAP.Processor.InfiniteRetryProcessor.ProcessAsync(ProcessingContext context)

Duplicate issue #955: BUG: CancellationTokenSource was null when restart!
Created: 2021-07-20T03:14:17Z
when I receive a message from a non-cap publisher, then at the OnConsumerReceived header customer is added to the message. The message is then passed to the RegisterMessageProcessor function.
At the SelectBestCandidate function, the debugger reports _cts was null:

The cause of the error could be the MatchWildcardUsingRegex function.
i try with case
key: document.pdf
red.Name: ^doccument\\.[0-9-zA-Z]+$
if (Regex.IsMatch(key, red.Name, RegexOptions.Singleline))
{
return red.Descriptor;
}
above function returns false

Closing comment (2021-07-20T05:07:04Z): duplicate of #952
Repository: dotnetcore/CAP

Issue #1098: Why can't the exchangetype be modified?
Created: 2022-03-02T14:55:06Z
Why can't the exchangetype be modified? Some business scenarios need to be dynamically set to direct, top, fanout, etc., as shown in the following figure:

Duplicate issue #1642: RabbitMQOptions 能否 放开 ExchangeType 设置
Created: 2025-01-21T06:13:20Z
public const string ExchangeType = "topic";

源码默认为topic,不能修改为fanout，建议后期支持。

Closing comment (2025-01-21T08:14:32Z): Duplicate of #1098 ,  We need to utilize the features of the Topic for our feature, so it is not supported to modify.
Repository: dotnetcore/CAP

Issue #1368: CAP marks messages as succeeded after http timeout exception in consumer
Created: 2023-07-06T10:51:24Z
CAP/src/DotNetCore.CAP/Internal/ISubscribeExector.Default.cs
    
    
         Line 196
      in
      652207c
    
  
  
    

        
          
           catch (OperationCanceledException) 
        
    
  


refs:
https://devblogs.microsoft.com/dotnet/net-5-new-networking-improvements/
https://stackoverflow.com/questions/10547895/how-can-i-tell-when-httpclient-has-timed-out
so it most probably needed to filter out TaskCancelled with inner timeouts

catch (TaskCanceledException ex) when (ex.InnerException is TimeoutException)
{
    // Handle timeout.
    Console.WriteLine("Timed out: "+ ex.Message);
}

Duplicate issue #1502: Cannot access a disposed context instance 
Created: 2024-03-22T04:48:19Z
`public class SubscriberService : ICapSubscribe
{
private readonly HatDbContext dbContext;
public SubscriberService(HatDbContext dbContext)
{
    this.dbContext = dbContext;
}

[CapSubscribe("JobResultMerge")]
public async void JobResultMerge(long jobId)
{
    var job = await dbContext.Job.SingleAsync(m => m.Id == jobId);
    job.BatchNumber = "123";
    await dbContext.SaveChangesAsync();

    //await new HttpClient().GetAsync("http://localhost:55555/upload/temp/240322123121019/合并结果 (12).xlsx");

    job.BatchNumber = "321";
    await dbContext.SaveChangesAsync();


}

}`
When HttpClient.GetAsync is blocked, the program operates normally, and the BatchNumber is successfully modified to "321". However, if I use any await in the middle, an error will be reported the next time the database is saved. Cannot access a disposed context instance.

Closing comment (2024-03-22T07:34:13Z): Is this issue similar to #1368 ?
不用关注了，我找到原因了，我写了一个 public async void 方法····，把void 改为task就不会出现这个问题了
Repository: doublecmd/doublecmd

Issue #945: DC freezes if remote folder no longer acessible
Created: 2023-04-19T00:52:13Z
Version
Double Commander
Version: 1.0.11
Revision: 272
Commit: 0b8ba38
Build date: 2017/01/01
Lazarus: 2.2.2.0
FPC: 3.2.2
Platform: x86_64-Linux-qt5
OS version: Fedora release 37 (Thirty Seven)
Widgetset library: Qt 5.15.8, libQt5Pas 5.6.1
Description

Connect over SSH to another machine in a tab
Navigate away from that tab
Put that machine to sleep
Navigate to that remote tab

DC will freeze for a while with no progress indication.

Duplicate issue #2153: Double Commander freeezes when I`m connecting external disc
Created: 2025-02-09T13:23:49Z
Version
Double Commander
Version: 1.1.21 gamma
Revision: 630
Commit: 9c148b2
Build date: 2024/11/30
Lazarus: 3.7.0.0
FPC: 3.2.2
Platform: i386-Win32-win32/win64
OS version: Windows 10 22H2 x86_64
Description
I could not work in doublecmd **when I connect external disc while my pc dont  connect my disc, he is freezing**. After my pc connect external disc  program work well. Speed of connecting disc sometimes very small and doublecmd fell external disc and freezing. When speed very big doublecmd not freezing😀 I think doublecmd may ignore connected disc after it doesnt connected well

Closing comment (2025-02-14T19:12:18Z): This seems duplicate of #945 or #1441, please close.
Repository: doublecmd/doublecmd

Issue #183: BUG: Doublecmd does not open anymore if fileshare disappears from network
Created: 2021-09-20T21:35:40Z
Using Windows 10 with different SMB shares on 2 machines. One machine is offline now so that the tabs (2 if I recall correctly) would be initiated with that offline machine's SMB share.
Excepted behaviour: Show that the tab cannot be loaded, remain the address in the tab however
Actual behavior: Doublecmd hangs and does not load (loading screen).
OS: Windows 10
DblCmd Version 0.9.10 beta, Rev. 9640M

Duplicate issue #945: DC freezes if remote folder no longer acessible
Created: 2023-04-19T00:52:13Z
Version
Double Commander
Version: 1.0.11
Revision: 272
Commit: 0b8ba38
Build date: 2017/01/01
Lazarus: 2.2.2.0
FPC: 3.2.2
Platform: x86_64-Linux-qt5
OS version: Fedora release 37 (Thirty Seven)
Widgetset library: Qt 5.15.8, libQt5Pas 5.6.1
Description

Connect over SSH to another machine in a tab
Navigate away from that tab
Put that machine to sleep
Navigate to that remote tab

DC will freeze for a while with no progress indication.

Closing comment (2023-04-20T08:38:49Z): Related to #183.
Repository: doublecmd/doublecmd

Issue #296: "Select file name without extension when renaming" does not work properly on macos
Created: 2021-12-16T23:43:02Z
В macos 11.6.1 и doublecmd-1.1.0-10014.cocoa.x86_64.zip
если включить в "Файловые операции"
msgid "Select &file name without extension when renaming"
msgstr "П&ри переименовании выделять только имя файла, без расширения"

https://github.com/doublecmd/doublecmd/blob/master/language/doublecmd.po#L5789
то оно работает как-то супер странно:
F2 1й раз - выделяет всё
F2 2й раз - выделяет всё
F2 3й раз - выделяет расширение
F2 4й раз - выделяет имя
F2 5й раз - выделяет расширение
F2 6й раз - выделяет имя
и уже по кругу
на linux всё норм - сразу выделяет имя.
если без опции:
F2 1й раз - выделяет всё
F2 2й раз - выделяет имя
F2 3й раз - выделяет расширение
F2 4й раз - выделяет первую часть имени до пробела
F2 5й раз - выделяет вторую часть имени до пробела
F2 6й раз - выделяет расширение
F2 7й раз - выделяет первую часть имени до пробела
и уже по кругу
Тоже не уверен, что так должно быть, но может и норм.
спасибо.

Duplicate issue #185: Hot Key File Rename Does Not Obey Configuration Setting to Only Select Filename Without Extension
Created: 2021-09-23T20:42:01Z
My config is setup such that rename operation is supposed to select ONLY the filename, without the extension.
Right Click on File -> Rename: selects without extension

Double Delayed Click: selects without extension

F2 hot key: selects entire filename, this is a BUG!

Shift+F6 hot key: selects entire filename, this is a BUG!



Double Commander
Version: 1.0.0 alpha
Revision: 9887
Commit: d61ab7a
Build date: 2021/08/22
Lazarus: 2.2.0.2
FPC: 3.2.1
Platform: x86_64-Darwin-cocoa
OS version: Mac OS X 10.16.0

Closing comment (2023-04-10T15:52:18Z): the same as #296.
fixed by #545.
should be closed.
Repository: doublecmd/doublecmd

Issue #129: Win10-64bit - Drag files outside DC -> Unspecified error
Created: 2021-07-02T13:13:15Z
On version 0.9.10 (9640M) I get "Unspecified error" when dragging files or folders outside DC.
It happens on any file type (e. g. pdf, txt, docx) and I guess few days ago it worked fine. Restart of DC didnt help.
When dragging within the DC everything is fine.

Duplicate issue #229: Drag’n’Drop problems
Created: 2021-10-29T11:03:03Z
Despite trying a couple of different patterns, I wasn’t able to get one that reproduce the error all the time. Drag’n’droping files from DC to other programs like mediainfo, mkvmerge or notepad will work a couple of times but after that breaks for a random amount of time. Reopening new instances of 3rd party programs and drag’n’droping different files into them will speed up the process until the error occurs. The error results in nothings happening at all and DC freezing for a couple of seconds. If you’re not waiting that long and go back to DC with your mouse, a dialog that prompts to copy the files to the place your mouse went pops up. This is really annoying because it makes drag’n’drop pretty much unusable. The error didn’t happen inside my VM which only has one virtual monitor attached. But it did happen on my main system when removing two monitors. Therefore it might be some kind of special interaction between my daily windows and DC. The regular file explorer doesn't has this issue.
Double Commander
Version: 1.1.0 alpha
Revision: 9965
Commit: 78d2893
Build date: 2021/10/28
Lazarus: 2.2.0.2
FPC: 3.2.2
Platform: x86_64-Win64-qt5
OS version: Windows 10 20H2 x86_64
Widgetset library: Qt 5.13.0, libQt5Pas 5.6.1

Closing comment (2021-10-30T19:31:11Z): Hi, this is a duplicate of #129 (there is a screencast of bug appearance).
This bug is a real showstopper for me. I need to invoke freecommander when need to drag and drop reliably.. (made a button to open freecommander at current path..). I would assign this bug high priority, I cannot drag and drog attachements to even when writing email, simple dayly tasks are ruined :/
Repository: doublecmd/doublecmd

Issue #129: Win10-64bit - Drag files outside DC -> Unspecified error
Created: 2021-07-02T13:13:15Z
On version 0.9.10 (9640M) I get "Unspecified error" when dragging files or folders outside DC.
It happens on any file type (e. g. pdf, txt, docx) and I guess few days ago it worked fine. Restart of DC didnt help.
When dragging within the DC everything is fine.

Duplicate issue #331: Drag and Drop issue, first time it works, second time doesn't work as expected
Created: 2022-01-20T16:13:07Z
Interesting issue that D&D is not working on second time. here is repro in v1.0.3.
Open VLC media player or other player.
drag and drop a video file from DblCmd into the player... it works.. plays the video .. perfect!
while the player is playing, drag and drop another video into the player to replace what is playing.. DblCmd takes its time and displays copy window for copying a file.

Closing comment (2022-01-20T16:51:12Z): This is a duplicate of #129
This problem is a showstopper for qt5 build 😕
Repository: doublecmd/doublecmd

Issue #129: Win10-64bit - Drag files outside DC -> Unspecified error
Created: 2021-07-02T13:13:15Z
On version 0.9.10 (9640M) I get "Unspecified error" when dragging files or folders outside DC.
It happens on any file type (e. g. pdf, txt, docx) and I guess few days ago it worked fine. Restart of DC didnt help.
When dragging within the DC everything is fine.

Duplicate issue #1: Drag&Drop files to Outlook not working
Created: 2018-09-12T10:07:16Z
When you try to drag a file out of Double Commander and drop it into a new E-Mail in Outlook 2016 it's not attached. Dropping it to the Desktop or somewhere into the file system works fine under Windows 10 1803.

Closing comment (2022-03-04T06:14:48Z): I have the same problem with Adobe Acrobat DC when drag & drop PDF files.
I am not sure that it is a dupe of #129 because I do not get a message.
Just the mouse cursor change to "forbid" when I am over Adobe Acrobat DC.
Of course Windows File Explorer works.
Repository: doublecmd/doublecmd

Issue #1037: one crash on startup, during showing of the splash screen
Created: 2023-07-07T14:05:09Z
Version
Double Commander
Version: 1.0.10
Revision: 239
Commit: d00f8b7
Build date: 2023/01/21
Lazarus: 2.2.2.0
FPC: 3.2.2
Platform: x86_64-Linux-gtk2
OS version: Ubuntu 22.04.2 LTS
Widgetset library: GTK 2.24.33
Description
In Ubuntu, I pressed Ctrl+Alt+C hotkey to run DC. it shows the splash screen and crashes during it.

--------------- 07-07-2023, 17:02:25 ---------------
| DC v1.0.10 Rev. 239 -- x86_64-Linux-gtk2
| Ubuntu 22.04.2 LTS -- GTK 2.24.33 | PID 153398
Unhandled exception: EAccessViolation: Access violation
  Stack trace:
  $000000000042CB7D in /home/user/doublecmd/doublecmd
  $00000000004E7177 line 77, column 3 of include/customform.inc in /home/user/doublecmd/doublecmd
  $000000000051D2F6 line 2847, column 3 of fmain.pas in /home/user/doublecmd/doublecmd

this is doublecmd.err .

Duplicate issue #1235: Another crash on start, w/o a reason
Created: 2023-08-20T16:21:55Z
Version
Double Commander
Version: 1.0.10
Revision: 239
Commit: d00f8b7
Build date: 2023/01/21
Lazarus: 2.2.2.0
FPC: 3.2.2
Platform: x86_64-Linux-gtk2
OS version: Ubuntu 20.04.6 LTS
Widgetset library: GTK 2.24.32
Description
ERR file
--------------- 20-08-2023, 19:19:42 ---------------
| DC v1.0.10 Rev. 239 -- x86_64-Linux-gtk2
| Ubuntu 20.04.6 LTS -- GTK 2.24.32 | PID 77529
Unhandled exception: EAccessViolation: Access violation
  Stack trace:
  $000000000042CB7D in /home/user/doublecmd/doublecmd
  $00000000004E7177 line 77, column 3 of include/customform.inc in /home/user/doublecmd/doublecmd
  $000000000051D2F6 line 2847, column 3 of fmain.pas in /home/user/doublecmd/doublecmd

--------------- 20-08-2023, 19:19:57 ---------------
| DC v1.0.10 Rev. 239 -- x86_64-Linux-gtk2
| Ubuntu 20.04.6 LTS -- GTK 2.24.32 | PID 77529
Unhandled exception: EAccessViolation: Access violation
  Stack trace:
  $0000000000A6501B line 989, column 5 of fgl.pp in /home/user/doublecmd/doublecmd
  $00000000004E7355 line 109, column 3 of include/customform.inc in /home/user/doublecmd/doublecmd
  $00000000004E738E line 123, column 1 of include/customform.inc in /home/user/doublecmd/doublecmd
  $00000000004336EB in /home/user/doublecmd/doublecmd
  $00000000004E27A6 line 1958, column 3 of forms.pp in /home/user/doublecmd/doublecmd

Closing comment (2023-08-20T17:29:20Z): It is same as #1037 and #162. Crash in the TCustomForm.AfterConstruction.