zoukankan      html  css  js  c++  java
  • 使用十年的电脑在家用记事本调试 .NET 程序

    引言

    春节放假回老家,没有把笔记本电脑带上,由于肺炎疫情的原因只能呆在家里,写的一个WinForm程序无法正常使用,需要及时修复,看我如何使用家里十年的台式机来调试修复 .NET 应用程序。

    WinForm程序无法正常使用的原因,主要是在解析html源代码的时候,找不到指定的节点导致的错误。

    开发环境

    • CPU:Pentium(R) Dual-Core CPU E6300 @ 2.80GHz
    • 内存:2G
    • 系统:Windows 7 家庭普通版

    配置

    开发工具

    尝试安装vs code软件,发现安装完成运行后,打开界面一直处于黑屏状态,电脑非常卡,只能使用Notepad++记事本修改代码。

    • MSBuild
    • Notepad++

    MSBuild 2015工具下载地址:

    https://www.microsoft.com/zh-CN/download/confirmation.aspx?id=48159

    在安装MSBuild的时候,需要先安装.net framework 4.5框架。

    MSBuild

    安装完成后,需要将目录添加到环境变量,我安装后的目录为:C:Program FilesMSBuild14.0Bin

    如何将目录添加到环境变量略。

    编译运行

    首先,将源代码从github上面下载到本地,解压即可,如下图:

    MSBuild 文档地址:

    https://docs.microsoft.com/zh-cn/visualstudio/msbuild/msbuild

    尝试编译,代码如下:

    MSBuild.exe itsvse.csproj -property:Configuration=Debug
    

    报错如下:

    “C:UserspiDownloadsitsvseitsvseitsvse.csproj”(默认
    目标)
    (1) ->
    (CoreCompile 目标) ->
      Form1.cs(13,7): error CS0246: The type or namespace name 'CsharpHttpHelper' c
    ould not be found (are you missing a using directive or an assembly reference?)
     [C:UserspiDownloadsitsvseitsvseitsvse.csproj]
      Form1.cs(14,7): error CS0246: The type or namespace name 'Newtonsoft' could n
    ot be found (are you missing a using directive or an assembly reference?) [C:U
    serspiDownloadsitsvseitsvseitsvse.csproj]
    
        6 个警告
        2 个错误
    
    已用时间 00:00:05.28
    

    解决方案,将程序引用的 dll 复制到 /bin/Debug 文件夹下面,重新编译即可,如下图:

    可以正常打开编译后应用程序,然后通过写日志的方式一点点调试输出,使用Notepad++记事本修改代码,重新编译程序,WinForm 程序即可正常运行。

    原文地址:https://down.itsvse.com/k/0nomps.html

  • 相关阅读:
    python常见异常
    python+selenium动态抓取网页数据
    python基于scrapy配置日志
    Python依赖
    nginx配置详解
    Centos 用户登录失败N次后锁定用户禁止登陆
    CENTOS 7 firewalld详解,添加删除策略
    Centos7搭建Zookeeper 3.4.14集群
    Centos7安装FastDFS整合nginx
    VMware VCSA 6.7配置vSAN存储
  • 原文地址:https://www.cnblogs.com/itsvse/p/12241394.html
Copyright © 2011-2022 走看看