Visual Studio for mac从入门到放弃1
MAC
第一步:从微软官网下载:https://www.visualstudio.com/vs/visual-studio-mac/
第二步:安装软件过程出现
Download the Mono Framework v4.8.0 archive to any directory on your disk, double-click it and follow the instructions on screen. Please accept all the defaults during the installation, including the target drive.
Download the Android SDK for Mac OS X version 24.4.1, open the downloaded archive and copy the contents of the folder found at its root directory (most probably named android-sdk-macosx) to the /Users/cong/Library/Developer/Xamarin/android-sdk-macosx directory.
Click here in order to start the Android SDK Manager application. In the GUI make sure the following components are installed or selected for installation:
- Android SDK Tools
- Android SDK Platform-tools
- Android SDK Build-tools
- Android API 15
- Android API 19
- Android API 21
Once all the required components are selected (you can select others as well, if you wish) start the installation.If you cannot see /Users/cong/Library/Developer/Xamarin/android-sdk-macosx in Finder please click here to reveal the directory in Finder.
Download the Android NDK for Mac OS X version r10e, open the downloaded archive and copy the contents of its root directory (most probably named android-ndk-r10e) to the /Users/cong/Library/Developer/Xamarin/android-ndk directory.
When the Android SDK installation is finished you might want to start the Android Emulator Manager and create as many emulator images as you might need for your development. This step can be performed at any time, on an as-needed basis.
Download the Visual Studio for Mac Preview v7.0.0 archive to any directory on your disk, double-click it and then drag and drop the Visual Studio for Mac Preview icon to the Applications folder.
Download the Xamarin.Android v7.1.0 archive to any directory on your disk, double-click it and follow the instructions on screen. Please accept all the defaults during the installation, including the target drive.
Download the Xamarin.iOS v10.4.0 archive to any directory on your disk, double-click it and follow the instructions on screen. Please accept all the defaults during the installation, including the target drive.
Download the Xamarin.Mac v3.0.0 archive to any directory on your disk, double-click it and follow the instructions on screen. Please accept all the defaults during the installation, including the target drive.
(这里没有用到移动端只需要下载:Mono Framework v4.8.0 archive Visual Studio for Mac Preview v7.0.0 archive 这2个包就可以,其他都是开发跨平台包)
三、激动人性时刻到来,打开vs,界面非常简洁,去除vs很多冗余功能,感觉舒服很多。。。。
四、新建一个mvc项目,会提示你要在线安装支持mvc类库,是从nuget下载dll??
Windows
如果将上面代码放到windows系统,结果会怎么样呢?
环境:win10+vs2015 编译正常,运行也正常
上面那些只是小试牛刀,下面是见证奇迹时候,直接把之前项目【不连接数据库】丢到mac vs运行
居然报错,彻底把我惊呆了Operation is not supported on this platform. 这个操作不支持此平台。。。这个是预览版上bug?
对于出现问题,可以用以下几种方案
1:重启vs,重启电脑,卸载项目重新加载(成功一次,后来不知道为啥不行。。。)
2:so上面有人说是debug模式问题,我切换编译还是报错。(失败)
3:google一下说多了pdb文件,我清理一下整个解决方案,把所有bin目录删除,编译还是报错。。。(失败)
4:切换目标框架 (成功一次,之后失败就没法成功过了)
会不会是Mono4.5没有全部移植过来类库?于是这个设置一下4.5.1 4.5.2,我在windows是net4.5,编译一下,依然报错。 我切换4.6.1一下编译 成功了。。。。
(然而我高兴太早了,准备想重现这个问题操作,备份一下csproj文件,还原之前旧版本csproj,然后一路报错下去解决不了,把正确csproj替换也不行)
5:mac上新建一个mvc项目,把代码拷贝过去(如果所有方法试过都不行,此方案是百试百灵,强烈推荐)
6:我旧项目对比一下5新建项目csproj,改了一摸一样也不行,fk(失败,不知道为啥)
本人在项目采用第5个方案,Sorry,时间有限,暂时分析不出报错原因具体在哪里...
最后想说:vs在mac操作加入【未包括项目文件】很蛋疼。。
测试Demo:https://files.cnblogs.com/files/walleyekneel/VSForMacTest.zip
2 vs mac-工具体验吐槽
3 vs mac-加入数据库访问项目
4 vs mac-ios开发
5 vs mac-安卓开发
6 vs mac netcore体验
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· 单线程的Redis速度为什么快?
· 展开说说关于C#中ORM框架的用法!
· Pantheons:用 TypeScript 打造主流大模型对话的一站式集成库