Skip to content

Unify DesignSurface and TestConsole into DemoConsole #13437

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 1 addition & 27 deletions Winforms.sln
Original file line number Diff line number Diff line change
Expand Up @@ -102,16 +102,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Windows.Forms.Primit
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "interop", "interop", "{A31B1F6F-4880-45DE-9845-EE3EF67C2FCC}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DesignSurface", "DesignSurface", "{43E46506-7DF8-4E7A-A579-996CA43041EB}"
ProjectSection(SolutionItems) = preProject
src\test\integration\DesignSurface\README.md = src\test\integration\DesignSurface\README.md
src\test\integration\DesignSurface\Directory.Build.props = src\test\integration\DesignSurface\Directory.Build.props
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DemoConsole", "src\test\integration\DesignSurface\DemoConsole\DemoConsole.csproj", "{93310A19-DDCA-4BCD-AEDE-5C5D788DAFB4}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DesignSurfaceExt", "src\test\integration\DesignSurface\DesignSurfaceExt\DesignSurfaceExt.csproj", "{E96C74BA-9F74-4289-BF72-45CAD472D3D2}"
EndProject
Project("{778DAE3C-4631-46EA-AA77-85C1314464D9}") = "Microsoft.VisualBasic.Forms.Tests", "src\Microsoft.VisualBasic.Forms\tests\UnitTests\Microsoft.VisualBasic.Forms.Tests.vbproj", "{FC75CB54-D8D0-4B41-9A4D-9F862F34A02D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Private.Windows.Core.TestUtilities", "src\Common\tests\TestUtilities\System.Private.Windows.Core.TestUtilities.csproj", "{05FD23CE-60AE-44A8-8DD6-1688F04BE385}"
Expand Down Expand Up @@ -669,22 +661,6 @@ Global
{93310A19-DDCA-4BCD-AEDE-5C5D788DAFB4}.Release|x64.Build.0 = Release|Any CPU
{93310A19-DDCA-4BCD-AEDE-5C5D788DAFB4}.Release|x86.ActiveCfg = Release|Any CPU
{93310A19-DDCA-4BCD-AEDE-5C5D788DAFB4}.Release|x86.Build.0 = Release|Any CPU
{E96C74BA-9F74-4289-BF72-45CAD472D3D2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E96C74BA-9F74-4289-BF72-45CAD472D3D2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E96C74BA-9F74-4289-BF72-45CAD472D3D2}.Debug|arm64.ActiveCfg = Debug|Any CPU
{E96C74BA-9F74-4289-BF72-45CAD472D3D2}.Debug|arm64.Build.0 = Debug|Any CPU
{E96C74BA-9F74-4289-BF72-45CAD472D3D2}.Debug|x64.ActiveCfg = Debug|Any CPU
{E96C74BA-9F74-4289-BF72-45CAD472D3D2}.Debug|x64.Build.0 = Debug|Any CPU
{E96C74BA-9F74-4289-BF72-45CAD472D3D2}.Debug|x86.ActiveCfg = Debug|Any CPU
{E96C74BA-9F74-4289-BF72-45CAD472D3D2}.Debug|x86.Build.0 = Debug|Any CPU
{E96C74BA-9F74-4289-BF72-45CAD472D3D2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E96C74BA-9F74-4289-BF72-45CAD472D3D2}.Release|Any CPU.Build.0 = Release|Any CPU
{E96C74BA-9F74-4289-BF72-45CAD472D3D2}.Release|arm64.ActiveCfg = Release|Any CPU
{E96C74BA-9F74-4289-BF72-45CAD472D3D2}.Release|arm64.Build.0 = Release|Any CPU
{E96C74BA-9F74-4289-BF72-45CAD472D3D2}.Release|x64.ActiveCfg = Release|Any CPU
{E96C74BA-9F74-4289-BF72-45CAD472D3D2}.Release|x64.Build.0 = Release|Any CPU
{E96C74BA-9F74-4289-BF72-45CAD472D3D2}.Release|x86.ActiveCfg = Release|Any CPU
{E96C74BA-9F74-4289-BF72-45CAD472D3D2}.Release|x86.Build.0 = Release|Any CPU
{FC75CB54-D8D0-4B41-9A4D-9F862F34A02D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FC75CB54-D8D0-4B41-9A4D-9F862F34A02D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FC75CB54-D8D0-4B41-9A4D-9F862F34A02D}.Debug|arm64.ActiveCfg = Debug|Any CPU
Expand Down Expand Up @@ -1162,9 +1138,7 @@ Global
{1976540D-65A6-45D7-95D2-13106DE6D5BB} = {583F1292-AE8D-4511-B8D8-A81FE4642DDC}
{6EE57002-9965-46E7-A48B-B449969738BB} = {583F1292-AE8D-4511-B8D8-A81FE4642DDC}
{A31B1F6F-4880-45DE-9845-EE3EF67C2FCC} = {DF68A171-D27B-4E6A-8A7E-63A651622355}
{43E46506-7DF8-4E7A-A579-996CA43041EB} = {680FB14C-7B0C-4D63-9F1A-18ACCDB0F52A}
{93310A19-DDCA-4BCD-AEDE-5C5D788DAFB4} = {43E46506-7DF8-4E7A-A579-996CA43041EB}
{E96C74BA-9F74-4289-BF72-45CAD472D3D2} = {43E46506-7DF8-4E7A-A579-996CA43041EB}
{93310A19-DDCA-4BCD-AEDE-5C5D788DAFB4} = {680FB14C-7B0C-4D63-9F1A-18ACCDB0F52A}
{FC75CB54-D8D0-4B41-9A4D-9F862F34A02D} = {583F1292-AE8D-4511-B8D8-A81FE4642DDC}
{05FD23CE-60AE-44A8-8DD6-1688F04BE385} = {DF68A171-D27B-4E6A-8A7E-63A651622355}
{3596BDE6-B211-4BE7-810D-DC7A4315E296} = {E4C6C5F5-46E9-4C63-9628-26752B4D9C11}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

namespace TestConsole;
namespace DemoConsole;

[DesignerCategory("Default")]
[Designer(typeof(CustomButtonDesigner), typeof(IDesigner))]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

namespace TestConsole;
namespace DemoConsole;

public class CustomButtonDesigner : ControlDesigner
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

namespace TestConsole;
namespace DemoConsole;

public class CustomButtonDesignerActionList : DesignerActionList
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

namespace TestConsole;
namespace DemoConsole;

internal class DesignerActionVerbItem : DesignerActionMethodItem
{
Expand Down
58 changes: 48 additions & 10 deletions src/test/integration/DesignSurface/DemoConsole/DemoConsole.csproj
Original file line number Diff line number Diff line change
@@ -1,20 +1,38 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<AssemblyName>DesignSurface</AssemblyName>
<RootNamespace>TestConsole</RootNamespace>
<AssemblyName>DemoConsole</AssemblyName>
<RootNamespace>DemoConsole</RootNamespace>
<ApplicationIcon>painter.ico</ApplicationIcon>
<OutputType>WinExe</OutputType>
<StartupObject />
<Copyright>Copyright © Paolo Foti 2008</Copyright>
<Company />
<Authors>Paolo Foti</Authors>
<PackageLicenseExpression>CPOL</PackageLicenseExpression>
<PackageProjectUrl>
https://www.codeproject.com/Articles/24385/Have-a-Great-DesignTime-Experience-with-a-Powerful</PackageProjectUrl>
<EnableUnsafeBinaryFormatterSerialization>true</EnableUnsafeBinaryFormatterSerialization>
<DefaultItemExcludes Condition="'$(TargetFramework)' != 'net481'">
$(DefaultItemExcludes);**/Framework/*
</DefaultItemExcludes>
<EnableXlfLocalization>false</EnableXlfLocalization>
<UpdateXlfOnBuild>false</UpdateXlfOnBuild>

<SuppressLicenseValidation>true</SuppressLicenseValidation>
<NoWarn>$(NoWarn);SA1633</NoWarn>

<!-- Do not build this project when doing a .NET product build. -->
<!-- The files for this project have been removed from the .NET product due to licensing issues. -->
<ExcludeFromDotNetBuild>true</ExcludeFromDotNetBuild>
<IsTestUtilityProject>true</IsTestUtilityProject>
<TargetFrameworks>$(NetCurrent)-windows;net481</TargetFrameworks>
<!-- Unset TargetFramework as this property gets set in the repo's root. This is necessary to avoid over-building. -->
<TargetFramework />
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' != 'net481'">
<!-- Include framework-specific items as 'None' to show them in the Solution Explorer -->
<None Include="**/Framework/*" />
</ItemGroup>


<PropertyGroup Condition="'$(TargetFramework)' == 'net481'">
<NoWarn>$(NoWarn)CS8002;CA1824</NoWarn>
<GenerateResourceUsePreserializedResources>true</GenerateResourceUsePreserializedResources>
Expand All @@ -27,14 +45,34 @@
<Compile Update="Properties\Resources.Designer.cs" AutoGen="True" DependentUpon="Resources.resx" DesignTime="True" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\DesignSurfaceExt\DesignSurfaceExt.csproj" />
</ItemGroup>

<ItemGroup>
<None Update="painter.ico">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == '$(NetCurrent)-windows'">
<ProjectReference Include="..\..\..\..\..\src\System.Design\src\System.Design.Facade.csproj" />
<ProjectReference Include="..\..\..\..\..\src\System.Drawing.Design\src\System.Drawing.Design.Facade.csproj" />
<ProjectReference Include="..\..\..\..\..\src\System.Windows.Forms.Design\src\System.Windows.Forms.Design.csproj" />
<ProjectReference Include="..\..\..\..\..\src\System.Windows.Forms\System.Windows.Forms.csproj" />
<ProjectReference Include="..\..\..\..\..\src\System.Drawing.Common\src\System.Drawing.Common.csproj" />
</ItemGroup>


<PropertyGroup Condition="'$(TargetFramework)' == 'net481'">
<LangVersion>latest</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' == '$(NetCurrent)-windows'">
<PackageReference Include="System.Runtime.Serialization.Formatters" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net481'">
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Drawing" />
<Reference Include="System.Design" />
</ItemGroup>


</Project>
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

global using System.Diagnostics;
global using System.Windows.Forms;
global using System.Drawing;
global using System.Diagnostics;
global using System.ComponentModel;
global using System.ComponentModel.Design;
global using System.ComponentModel.Design.Serialization;
global using System.Windows.Forms.Design;
global using DemoConsole;
global using Timer = System.Windows.Forms.Timer;
global using System.Reflection;
global using System.Collections;
global using System.Collections.Concurrent;
global using System.Collections.Immutable;

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

namespace TestConsole;
namespace DemoConsole;

public partial class MainForm
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

namespace TestConsole;
namespace DemoConsole;

public partial class MainForm
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
namespace TestConsole;
using Timer = System.Windows.Forms.Timer;

namespace DemoConsole;

[DesignerCategory("Default")]
public partial class MainForm : Form
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

namespace TestConsole;
namespace DemoConsole;

internal class Program
{
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

79 changes: 79 additions & 0 deletions src/test/integration/DesignSurface/DemoConsole/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# DesignSurface (DemoConsole)

- [Debugging Native Code in This Project](#debugging-native-code-in-this-project)
- [1. Enable Native Code Debugging](#1.-enable-native-code-debugging)
- [2. Configure Symbol Server for Native Debugging (Symweb)](<#2.-configure-symbol-server-for-native-debugging-(symweb)>)
- [Running the Project Against .NET Framework](#running-the-project-against-.net-framework)

## Debugging Native Code in This Project

To fully enable debugging in this project (including native code and symbol resolution), perform the following two steps:

### 1. Enable Native Code Debugging

This allows Visual Studio to step into native code

**Option A – Using Visual Studio GUI:**

1. Right-click the project in Solution Explorer and select **Properties**.
2. Go to the **Debug** then **Open debug launch profiles UI**.
3. Check the box **Enable native code debugging**.
4. Save and rebuild the project.

> This setting is saved in a user-specific `.csproj.user` file.

**Option B – Editing `launchSettings.json`:**

1. Open the file `Properties\launchSettings.json`.
2. Under the `"profiles"` section, locate the profile matching your project name.
3. Add or update the property `"nativeDebugging": true`.

Example:

```json
{
"profiles": {
"YourProjectName": {
"commandName": "Project",
"nativeDebugging": true
}
}
}
```

---

### 2. Configure Symbol Server for Native Debugging (Symweb)

To resolve native symbols when stepping through native code, configure the Symweb server:

1. Go to **Debug > Options** from the Visual Studio toolbar.
2. In the left pane, select **Debugging > Symbols**.
3. Under **Symbol file (.pdb) locations**, click the **➕** (plus) button.
4. Enter the following URL:

```
https://symweb
```

5. Press **Enter** or click **OK** to save.

---

After completing both steps above, Visual Studio will be able to debug both managed and native parts of the application, using symbols downloaded from Symweb as needed.

## Running the Project Against .NET Framework

This project targets multiple frameworks, including .NET Framework 4.8.1. To run or debug it against the .NET Framework instead of .NET (e.g., net10.0-windows), follow the steps below:

1. In Visual Studio, locate the Debug dropdown on the top toolbar (next to the green **Start** button).
2. Click the small downward arrow next to the active configuration. You will see the currently selected framework (typically something like `Framework (net10.0-windows)`).
3. Click the displayed framework name to open a submenu showing all target frameworks for this project.
4. Select **net481** from the list.
5. Build and run the project using any of the usual commands:
- **Build**: `Ctrl + Shift + B`
- **Start Without Debugging**: `Ctrl + F5`
- **Start With Debugging**: `F5`

This configuration change ensures that Visual Studio builds and runs the project using the .NET Framework target.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<PropertyGroup>
<AssemblyName>DesignSurfaceExt</AssemblyName>
<RootNamespace>DesignSurfaceExt</RootNamespace>
<ApplicationIcon>dll.ico</ApplicationIcon>

<Copyright>Copyright © Paolo Foti 2008</Copyright>
<Company />
Expand All @@ -12,19 +11,12 @@
<PackageProjectUrl>
https://www.codeproject.com/Articles/24385/Have-a-Great-DesignTime-Experience-with-a-Powerful
</PackageProjectUrl>
<DefaultItemExcludes Condition="'$(TargetFramework)' != 'net481'">
$(DefaultItemExcludes);**/Framework/*
</DefaultItemExcludes>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'net481'">
<SignAssembly>true</SignAssembly>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' != 'net481'">
<!-- Include framework-specific items as 'None' to show them in the Solution Explorer -->
<None Include="**/Framework/*" />
</ItemGroup>

</Project>

This file was deleted.

Loading
Loading