zoukankan      html  css  js  c++  java
  • 编译并调试Dot Net Core WindowsForm 源代码

    1. 克隆源代码:

    https://github.com/dotnet/winforms

    2. 安装项目需要的 .net core sdk:

    运行这个脚本:

    方法:

    1. 输入PowerShell,并右键管理员权限打开

    2. 输入Set-ExecutionPolicy RemoteSigned

    3. 输入A,回车

    4. & "路径xxx.ps1"

    3.到克隆的仓库,找到工程文件,直接用VS2019打开,编译

     4.编译成功

    调试源代码:

    1. 新建一个 winform .net core 工程

     2. 手动加引用,引用之前产出的dll

    3. 编写代码,简单测试,创建一个 TextBox,并添加到窗体里

     4.运行,打断点,调试

     

     F11,跟进去看看创建时 dot net core都做了什么事情

    记录一个简单的winform工程文件,专门为调试源代码用:

    <Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
    
      <PropertyGroup>
        <OutputType>WinExe</OutputType>
        <TargetFramework>netcoreapp5.0</TargetFramework>
        <!--<UseWindowsForms>true</UseWindowsForms>-->
      </PropertyGroup>
    
      <ItemGroup>
        <ProjectReference Include="..frameworkGrapeCity.Framework.InputMan.csproj" />
        <ProjectReference Include="..inputInput.csproj" />
      </ItemGroup>
    
      <ItemGroup>
        <Reference Include="D:PersonalDataGitHubwinformsartifactsinWinformsControlsTestDebug
    etcoreapp5.0System.Windows.Forms.dll" />
        <Reference Include="D:PersonalDataGitHubwinformsartifactsinWinformsControlsTestDebug
    etcoreapp5.0System.Windows.Forms.Primitives.dll" />
        <Reference Include="D:PersonalDataGitHubwinformsartifactsinWinformsControlsTestDebug
    etcoreapp5.0
    untimeswinlib
    etcoreapp3.0System.Drawing.Common.dll" />
        <Reference Include="D:PersonalDataGitHubwinformsartifactsinSystem.Windows.Forms.TestsDebug
    etcoreapp5.0System.Security.Permissions.dll" />
        <Reference Include="C:Program FilesdotnetsharedMicrosoft.NETCore.App5.0.0-preview.4.20216.4Microsoft.Win32.Registry.dll" />
      </ItemGroup>
    
    </Project>
  • 相关阅读:
    springboo 添加logback日志
    logback配置日志输出
    认知升级:提升理解层次的NLP思维框架
    2019第29周日
    《如何有效社交》晨读笔记
    控制论模型&心流模型&波模型
    数学中常见的思维模型
    分布式服务跟踪系统
    Spring Cloud Sleuth
    微服务调用跟踪
  • 原文地址:https://www.cnblogs.com/chenyingzuo/p/12716474.html
Copyright © 2011-2022 走看看