源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

.NET Core Windows环境安装配置教程

  • 时间:2020-07-27 23:50 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:.NET Core Windows环境安装配置教程
[b]1、安装.NET Core SDK [/b] 在windows下开发.NET Core最好使用Visual Studio工具。下载地址与安装: VS2015最新版本:[url=https://www.visualstudio.com/news/releasenotes/vs2015-update3-vs]Visual Studio 2015 Update 3*[/url] VS环境下的.Net Core:[url=https://go.microsoft.com/fwlink/?LinkId=817245].NET Core 1.0 for Visual Studio[/url] 对应下载的文件DotNetCore.1.0.0-VS2015Tools.Preview2.exe .Net Core安装过程(安装过程比较慢,亲们耐心等待): [img]http://files.jb51.net/file_images/article/201607/2016070416172032.png[/img] [img]http://files.jb51.net/file_images/article/201607/2016070416172033.png[/img] [img]http://files.jb51.net/file_images/article/201607/2016070416172034.png[/img] [img]http://files.jb51.net/file_images/article/201607/2016070416172035.png[/img] [img]http://files.jb51.net/file_images/article/201607/2016070416172036.png[/img] (安装慢,等待中…….) [img]http://files.jb51.net/file_images/article/201607/2016070416172037.png[/img] [img]http://files.jb51.net/file_images/article/201607/2016070416172038.png[/img] (OK,终于安装完成了,开始下一步……) .Net Core可从[url=https://www.microsoft.com/net/download]https://www.microsoft.com/net/download[/url]下载: [img]http://files.jb51.net/file_images/article/201607/2016070416172039.png[/img] VS Ent 2015 sp3效果图: [img]http://files.jb51.net/file_images/article/201607/2016070416172040.png[/img] 注意: (1)VS2015可以使用免费开发工具[url=https://www.visualstudio.com/products/free-developer-offers-vs]Visual Studio Community[/url]或者Visual Studio Code。 (2)安装之前首先确认[url=https://github.com/dotnet/core/blob/master/Documentation/prereqs.md]Windows dependencies[/url]已安装。 (3)如果你使用自己喜欢的命令行工具或使用Visual Studio Code,你紧紧需要下载[url=https://go.microsoft.com/fwlink/?LinkID=809122].NET Core SDK for Windows[/url]。 [img]http://files.jb51.net/file_images/article/201607/2016070416172041.png[/img] [img]http://files.jb51.net/file_images/article/201607/2016070416172042.png[/img] 开发工具下载地址,可参考[url=https://www.visualstudio.com/downloads/download-visual-studio-vs]https://www.visualstudio.com/downloads/download-visual-studio-vs[/url] [url=http://images2015.cnblogs.com/blog/10966/201607/10966-20160702144723327-154011289.png][img]http://files.jb51.net/file_images/article/201607/201674162722313.jpg?201664162732[/img] [/url]  [b]2、VS2015初始化代码 [/b] 让我们初始化一个Hello World应用程序。 开发环境VS Ent 2015与.Net Core 1.0 for Visual Studio 2.1 新建项目,选择.Net Core [img]http://files.jb51.net/file_images/article/201607/2016070416172044.png[/img] 注意:.Net Core支持最低版本是Framework 4.5。 2.2 选择Console Application [img]http://files.jb51.net/file_images/article/201607/2016070416172045.png[/img] [img]http://files.jb51.net/file_images/article/201607/2016070416172146.png[/img] 项目名称:FirstNetCore 点击“确定”安装进行项目创建。 [img]http://files.jb51.net/file_images/article/201607/2016070416172147.png[/img] 2.3 项目结构 [img]http://files.jb51.net/file_images/article/201607/2016070416172148.png[/img] 可看到正在还原程序包。本过程嘛也要耐心等待……看到以下输出就算完成 log : Writing lock file to disk. Path: c:\users\xxtt\documents\visual studio 2015\Projects\FirstNetCore\src\FirstNetCore\project.lock.json log : c:\users\xxtt\documents\visual studio 2015\Projects\FirstNetCore\src\FirstNetCore\FirstNetCore.xproj log : Restore completed in 124001ms. [b]解决方案:[/b] [url=http://images2015.cnblogs.com/blog/10966/201607/10966-20160702103848093-791951491.png][img]http://files.jb51.net/file_images/article/201607/2016070416172149.png[/img] [/url] Solution Items是全局配置文件目录:global.json,打开文件查看: [url=http://images2015.cnblogs.com/blog/10966/201607/10966-20160702103849249-1989359101.png][img]http://files.jb51.net/file_images/article/201607/2016070416172150.png[/img] [/url] src目录是源文件存放与项目配置文件 [url=http://images2015.cnblogs.com/blog/10966/201607/10966-20160702103850593-1277590009.png][img]http://files.jb51.net/file_images/article/201607/2016070416172151.png[/img] [/url] 2.4 修改Program.cs文件并编译运行 修改Program.cs文件: [url=http://images2015.cnblogs.com/blog/10966/201607/10966-20160702103851859-184342931.png][img]http://files.jb51.net/file_images/article/201607/2016070416172152.png[/img] [/url] 按F5编译运行: [url=http://images2015.cnblogs.com/blog/10966/201607/10966-20160702103853499-1198112264.png][img]http://files.jb51.net/file_images/article/201607/2016070416172153.png[/img] [/url] [url=http://images2015.cnblogs.com/blog/10966/201607/10966-20160702103856062-1333655107.png][img]http://files.jb51.net/file_images/article/201607/2016070416172154.png[/img] [/url] 以下是调试输出结果: “dotnet.exe”(CoreCLR: DefaultDomain): 已加载“C:\Program Files\dotnet\shared\Microsoft.NETCore.App\1.0.0\System.Private.CoreLib.ni.dll”。已跳过加载符号。模块进行了优化,并且调试器选项“仅我的代码”已启用。 “dotnet.exe”(CoreCLR: clrhost): 已加载“c:\users\xxtt\documents\visual studio 2015\Projects\FirstNetCore\src\FirstNetCore\bin\Debug\netcoreapp1.0\FirstNetCore.dll”。已加载符号。 “dotnet.exe”(CoreCLR: clrhost): 已加载“C:\Program Files\dotnet\shared\Microsoft.NETCore.App\1.0.0\System.Runtime.dll”。已跳过加载符号。模块进行了优化,并且调试器选项“仅我的代码”已启用。 “dotnet.exe”(CoreCLR: clrhost): 已加载“C:\Program Files\dotnet\shared\Microsoft.NETCore.App\1.0.0\mscorlib.dll”。无法查找或打开 PDB 文件。 “dotnet.exe”(CoreCLR: clrhost): 已加载“C:\Program Files\dotnet\shared\Microsoft.NETCore.App\1.0.0\System.Console.dll”。已跳过加载符号。模块进行了优化,并且调试器选项“仅我的代码”已启用。 “dotnet.exe”(CoreCLR: clrhost): 已加载“C:\Program Files\dotnet\shared\Microsoft.NETCore.App\1.0.0\System.Threading.dll”。已跳过加载符号。模块进行了优化,并且调试器选项“仅我的代码”已启用。 “dotnet.exe”(CoreCLR: clrhost): 已加载“C:\Program Files\dotnet\shared\Microsoft.NETCore.App\1.0.0\System.IO.dll”。已跳过加载符号。模块进行了优化,并且调试器选项“仅我的代码”已启用。 “dotnet.exe”(CoreCLR: clrhost): 已加载“C:\Program Files\dotnet\shared\Microsoft.NETCore.App\1.0.0\System.IO.FileSystem.Primitives.dll”。已跳过加载符号。模块进行了优化,并且调试器选项“仅我的代码”已启用。 “dotnet.exe”(CoreCLR: clrhost): 已加载“C:\Program Files\dotnet\shared\Microsoft.NETCore.App\1.0.0\System.Text.Encoding.dll”。已跳过加载符号。模块进行了优化,并且调试器选项“仅我的代码”已启用。 “dotnet.exe”(CoreCLR: clrhost): 已加载“C:\Program Files\dotnet\shared\Microsoft.NETCore.App\1.0.0\System.Text.Encoding.Extensions.dll”。已跳过加载符号。模块进行了优化,并且调试器选项“仅我的代码”已启用。 “dotnet.exe”(CoreCLR: clrhost): 已加载“C:\Program Files\dotnet\shared\Microsoft.NETCore.App\1.0.0\System.Threading.Tasks.dll”。已跳过加载符号。模块进行了优化,并且调试器选项“仅我的代码”已启用。 程序“[4392] dotnet.exe: 程序跟踪”已退出,返回值为 0 (0x0)。 程序“[4392] dotnet.exe”已退出,返回值为 -1 (0xffffffff)。 [b]3、使用命令行初始化代码[/b] 打开命令行,输入以下内容:(创建项目目录--转到项目目录--创建项目) mkdir hwapp cd hwapp dotnet new [img]http://files.jb51.net/file_images/article/201607/2016070416172155.png[/img] [img]http://files.jb51.net/file_images/article/201607/2016070416172156.png[/img] [img]http://files.jb51.net/file_images/article/201607/2016070416172157.png[/img] dotnet restore 重置project.json [img]http://files.jb51.net/file_images/article/201607/2016070416172158.png[/img] dotnet run [img]http://files.jb51.net/file_images/article/201607/2016070416172159.png[/img] 按Enter键: [img]http://files.jb51.net/file_images/article/201607/2016070416172160.png[/img] [b]3、参考网站 [/b][url=https://www.microsoft.com/net/core]https://www.microsoft.com/net/core[/url] 以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持编程素材网。
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部