Visual Studio For MacOS .NetCore开发踩坑记

  自从Visual Studio For  MacOS公布以来,就开始尝试在Mac上进行net core开发。断断续续遇到了各类奇奇怪怪的问题。虽然大部分利用google查查(百度屁都查不出来),都能找到解决方案,但仍是作个记录吧~node

问题一:git

错误提示:error MSB4057: The target “Build” does not exist in the projectgithub

记录时间:2017-03-31macos

缘由解析:Mono版本低了。对,就是Mono版本低了,别问我为何开发netcore和mono怎么扯起来联系的。人家说了:Yes it is a dependency. Currently the updater will not show it as a dependency for technical reasons. Visual Studio (Windows) depends on MSBuild 15 to compile .NET Core projects. Visual Studio for Mac also depends on MSBuild 15 and this is shipped with Mono 4.8. Earlier versions of Mono 4.8 were not including the latest bits to support compiling .NET Core projects。并且这个时间段恰好是netcore项目从xproj文件转为csproj,因此老版本的不兼容。  我查了下个人mono版本的,是16年的版本,虽然也是4.8.可是小版本号不够。升级到最新,问题解决。api

参考地址:http://www.mono-project.com/  app

     http://stackoverflow.com/questions/41773344/project-not-build-in-active-configuration-visual-studio-macos-net-core visual-studio

     http://stackoverflow.com/questions/41788027/visual-studio-macos-error-msb4057-the-target-build-does-not-exist-in-the-projui

 

 

问题二:this

错误提示:Unable to attach to CoreCLR.google

记录时间:2017-04-01

缘由解析:我把macos的版本从10.12.3升级到了10.12.4。这里面出现了一些不兼容。  这已是第二次由于macos版本升级致使netcore不能用了!

解决方案:

  1. Download https://dotnet.myget.org/F/dotnet-core/api/v2/package/runtime.osx.10.10-x64.Microsoft.NETCore.Runtime.CoreCLR/1.1.2-servicing-25123-01
  2. Open the resulting file as a zip, and copy out runtimes/osx.10.10-x64/native/libdbgshim.dylib
  3. Navigate to /Applications/Visual Studio.app/Contents/Resources/lib/monodevelop/AddIns/DotNetCore.Debugger/Adapter/ in Finder or Terminal
  4. Rename libdbgshim.dylib to libdbgshim.dylib.old
  5. Paste in the new libdbgshim.dylib

参考地址: https://github.com/dotnet/coreclr/issues/10279

                https://github.com/dotnet/core/issues/377 

相关文章
相关标签/搜索