Visual Studio For MacOS .NetCore開發踩坑記

來源:互聯網
上載者:User

標籤:file   bsp   paste   end   copy   find   dap   pil   exist   

  自從Visual Studio For  MacOS公布以來,就開始嘗試在Mac上進行net core開發。斷斷續續遇到了各種奇奇怪怪的問題。雖然大部分利用google查查(百度屁都查不出來),都能找到解決方案,但還是做個記錄吧~

問題一:

錯誤提示:error MSB4057: The target “Build” does not exist in the project

記錄時間:2017-03-31

原因解析: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.但是小版本號碼不夠。升級到最新,問題解決。

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

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

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

 

 

問題二:

錯誤提示:Unable to attach to CoreCLR.

記錄時間: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 

Visual Studio For MacOS .NetCore開發踩坑記

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.