时间: 2020-09-2|35次围观|0 条评论

  1. 删除csproj文件。
  2. 将 package.config 重命名为 project.json 。
  3. 转换文件,将xml转换为json格式。
  4. <?xml version="1.0" encoding="utf-8"?><packages>  <package id="Newtonsoft.Json" version="8.0.3" targetFramework="net451" />  <package id="SomeCoolPackage" version="3.0.1" targetFramework="net451" /></packages>

    转换之后

    {  "dependencies": {    "SomeCoolPackage": "3.0.1",    "Newtonsoft.Json": "8.0.3"  },  "frameworks": {    "net45": {    }  },  "runtimes": {    "win": { }  }}
  5. 执行 dotnet restore
  6. 执行 dotnet build
  7. 你可能会遇到错误,尝试添加对Frmework的引用
    {  "dependencies": {    "SomeCoolPackage": "3.0.1",    "Newtonsoft.Json": "8.0.3"  },  "frameworks": { "net45": {      "frameworkAssemblies": {        "System.Runtime.Serialization": "4.0.0.0",      }    }  },  "runtimes": {    "win": { }  }}
  8. 打开Visual Studio,添加现有项目。

文章转载于:https://www.cnblogs.com/Soar1991/p/5635645.html

原著是一个有趣的人,若有侵权,请通知删除

本博客所有文章如无特别注明均为原创。
复制或转载请以超链接形式注明转自起风了,原文地址《将Visual Studio项目转换为Dot Net Core项目 csproj to xproj
   

还没有人抢沙发呢~