[eShopOnContainers 学习系列] - 02 - vs 2017 开发环境配置
一、 核心步骤
- Git clone https://github.com/dotnet-architecture/eShopOnContainers.git
git 克隆 项目 - Open solution eShopOnContainers-ServicesAndWebApps.sln with VS2017
打开指定项目 - Set the VS startup project to the "docker-compose" project
设置启动项目 - Hit F5!
运行项目
起始要真的这么简单就好了,坑实在是多,下面开始一个一个排吧
二、Windows 下其他配套软件配置
- Hyper-V
Windows 10 自带,只需要用 power-Shell 开启就行。装这个还是为了 Docker 的正常运行
- 使用超管运行 power-shell ,敲入命令:
Enable-WindowsOptionalFeature -Online -FeatureName:Microsoft-Hyper-V -All
Docker ce for Windows
直接上官网下载安装Docker 配置
- docker for windows 是使用 Hyper-v 运行了一个 Linux 虚拟,所以 Hyper-v 是必须的。
要注意虚拟机系统互相打架,下面信息我就不翻译了:
IMPORTANT: Check that you don't have any other hypervisor installed that might be not compatible with Hyper-V. For instance, Intel HAXM can be installed by VS 2017 if you chose to install Google's Android emulator which works on top of Intel HAXM. In that case, you'd need to uninstall Google's Android emulator and Intel HAXM. VS 2017 recommends to install the Google Android emulator because it is the only Android emulator with support for Google Play Store, Google Maps, etc. However, take into account that it currently is not compatible with Hyper-V, so you might have incompatibilities with this scenario.
要想此项目中所有的容器运行正常,推荐配置 docker 使用 3 cpu 和 4G 内存
所以,开发机器配置最好是不低于 16G,4核,这是个大坑,一般不玩游戏的程序员,现在用 16G 本子的应该不多吧.... 看来俺的老机器该升级了Shared Drives 这里也是个坑,我编译了3、4 次没通过,就是没有把这块所有硬盘都选中。也有说必须是选中 C 盘。
其实应该没必要全部选中,但我的就是跑不起来,有人也说,把复选框取消,再选中,或者重启可以解决运行项目时的错误,暂时没试Network配置 按默认的就行
开启Windows防火墙指定端口 控制面板 - 防火墙 - 高级设置 - 入站规则
添加 端口 5100-5110
三、 加载项目 运行
最麻烦的还是 docker 这块设置,如果搞定了,机器配置够的话,运行还是很顺的。
- 设置 docker-compose 为启动项目,确保 docker 运行中,运行项目
- 成功后,会看到浏览器中加载 eshop 网站
- 可以在 power-shell 中,运行命令 docker ps 查看正在运行中的 docker 容器
四、Web SAP 应用配置
If you want to run/test the web eShopOnContainers SPA (Single Page Application) client in adition to the regular MVC Web app, you need to install certain dependencies for the client side and build it with "npm build", as the client side of the SPA app is based on ANGULAR 2, TypeScript and other JS frameworks and compilation that needs to happen before building the Docker images. The process is described in detail here: https://github.com/dotnet-architecture/eShopOnContainers/wiki/06.-Setting-the-Web-SPA-application-up
五、多容器中断点调试
和正常调试类似,虽然项目运行在 docker 容器中,但是在 vs 源代码中,添加断点照样可以正常进行调试,比较神奇,这也是 vs 2017 的强大之处吧。
六、测试 SPA web APP
七、测试微服务 Swagger
容器运行状态下,使用 http://localhost:5101 进行测试
八、应用和微服务列表
- Web MVC: http://localhost:5100
测试用户账号
User: demouser@microsoft.com
Password: Pass@word1 - Web Spa: http://localhost:5104 (Important, check how to set up the SPA app and requirements before building the Docker images. Instructions at * https://github.com/dotnet/eShopOnContainers/wiki/06.-Setting-the-Web-SPA-application-up)
- Catalog microservice: http://localhost:5101 (Not secured)
- Ordering microservice: http://localhost:5102 (Requires token for authorization)
- Basket microservice: http://localhost:5103 (Requires token for authorization)
- Identity microservice: http://localhost:5105
- Orders database (SQL Server connection string): Server=tcp:localhost,5432;Database=Microsoft.eShopOnContainers.Services.OrderingDb;User Id=sa;Password=Pass@word;
- Catalog database (SQL Server connection string): Server=tcp:localhost,5434;Database=CatalogDB;User Id=sa;Password=Pass@word
- ASP.NET Identity database (SQL Server connection string): Server=localhost,5433;Database=aspnet-Microsoft.eShopOnContainers;User Id=sa;Password=Pass@word
- Basket data (Redis): listening at localhost:6379
九、手机端测试
可以测试 Xamarin app 在真实的 ios、Android 或 windows 设备上,但如果运行 android 虚拟机的话,不能用 google 的,只能用 vs 的,他们互相冲突,会导致 docker 不能用,系统蓝屏重启
You can deploy the Xamarin app to real iOS, Android or Windows devices. You can also test it on an Android Emulator based on Hyper-V like the Visual Studio Android Emulator (Do NOT install the Google's Android emulator or it will break Docker and Hyper-V, as mentioned above).
步骤(团队暂时用不着,就不翻了):
- Disable mock-services in the Xamarin app by setting the UseMockServices = false in the App.xaml.cs and specify the host IP in BaseEndpoint = "http://10.106.144.28" at the GlobalSettings.cs. Both files in the Xamarin.Forms project (PCL).
- Another alternative is to change that IP through the app UI, by modifying the IP address in the Settings page of the App as shown in the screenshot below.
- In addition, you need to make sure that the used TCP ports of the services are open in the local firewall.
[eShopOnContainers 学习系列] - 02 - vs 2017 开发环境配置的更多相关文章
- Redis学习系列二之.Net开发环境搭建及基础数据结构String字符串
一.简介 Redis有5种基本数据结构,分别是string.list(列表).hash(字典).set(集合).zset(有序集合),这是必须掌握的5种基本数据结构.注意Redis作为一个键值对缓存系 ...
- hibernate学习系列-----(1)开发环境搭建
其实一两个月前就在了解hibernate方面的知识了,但一直以来,都没有好好的总结,而且一直使用的是myeclipse,感觉有些傻瓜式的操作就可以搭建起hibernate的开发环境,但这样一点都不好, ...
- Direct3D11学习:(一)开发环境配置
转载请注明出处:http://www.cnblogs.com/Ray1024 从今天开始,开启一个新的系列:Direct3D11的学习教程. 因为一直对3D方面比较感兴趣,最近决定开始学习D3D知 ...
- 《objective-c基础教程》学习笔记 (一)—— 开发环境配置和简单类型输出
懒惰是富有最大的敌人,再不前进,我们就out了.最近工作比较轻松,不是很忙.于是想晚上下班回家学习点新东西.看着苹果大军的一天天壮大,心里也是痒痒的.于是就想先系统的学习下Objective-C,为之 ...
- go语言学习之路 一:开发环境配置
1. 安装go 1)下载地址:http://www.golangtc.com/download,下载后直接双击msi文件安装,默认安装在c:\go 2)安装完成后默认会在环境变量 Path 后添加 G ...
- [eShopOnContainers 学习系列] - Index - 开篇索引
[资料] 学习资料来源于 eShopOnContainers wiki 以及 微软官方微服务架构指南 [eShopOnContainers 学习系列] - 00 - 开发环境需求 [eShopOnCo ...
- 开发环境配置--Ubuntu+Qt4+OpenCV(一)
同系列的文章 1. 开发环境配置--Ubuntu+Qt4+OpenCV(一) 2. 开发环境配置--Ubuntu+Qt4+OpenCV(二) 3. 开发环境配置--Ubuntu+Qt4+OpenCV( ...
- [eShopOnContainers 学习系列] - 00 - 开发环境需求
开发环境需求 https://github.com/dotnet-architecture/eShopOnContainers/wiki/00.-Dev-machine-requirements 我的 ...
- scrapy爬虫学习系列一:scrapy爬虫环境的准备
系列文章列表: scrapy爬虫学习系列一:scrapy爬虫环境的准备: http://www.cnblogs.com/zhaojiedi1992/p/zhaojiedi_python_00 ...
随机推荐
- Android ViewGroup onInterceptTouchEvent
public boolean onInterceptTouchEvent (MotionEvent ev) Implement this method to intercept all touch s ...
- ViewPager学习及使用(一)
一:基础篇 1.ViewPager的简介和作用ViewPager是android扩展包v4包中的类,这个类可以让用户左右切换当前的view1)ViewPager类直接继承了ViewGroup类,所有它 ...
- OpenERP学习过程1
系统为Win7 32位,下载并安装OpenERP: 1. 下载地址http://nightly.odoo.com/7.0/nightly/exe/ 2. 双击开始安装,由于选择的是all-in-one ...
- C#简单实现动态数据生成Word文档并保存
今天正好有人问我,怎么生成一个报表式的Word文档. 就是文字的样式和位置相对固定不变,只是里面的内容从数据中读取. 我觉得类似这种的一般用第三方报表来做比较简便.但既然要求了Word,只好硬着头皮来 ...
- django的序列化问题
Django中的序列化主要应用在将数据库中检索的数据返回给客户端用户,特别的Ajax请求一般返回的为Json格式 1.serializers from django.core import seria ...
- zookeer安装
解压:tar xf zookeeper-3.4.9.tar.gz进入目录cd /opt/zookeeper-3.4.9/ 编辑配置文件:vim zoo.cfg# The number of milli ...
- TCP/IP三次握手与四次挥手(转)
一.TCP报文格式 TCP/IP协议的详细信息参看<TCP/IP协议详解>三卷本.下面是TCP报文格式图: 图1 TCP报文格式 上图中有几个字段需要重点介绍下: ...
- Delphi 正则表达式之TPerlRegEx 类的属性与方法(1): 查找
Delphi 正则表达式之TPerlRegEx 类的属性与方法(1): 查找 //查找是否存在 var reg: TPerlRegEx; begin reg := TPerlRegEx.Cre ...
- Python Tornado框架(TCP层)
Tornado在TCP层里的工作机制 上一节是关于应用层的协议 HTTP,它依赖于传输层协议 TCP,例如服务器是如何绑定端口的?HTTP 服务器的 handle_stream 是在什么时候被调用的呢 ...
- redis 笔记01 简单动态字符串、链表、字典、跳跃表、整数集合、压缩列表
文中内容摘自<redis设计与实现> 简单动态字符串 1. Redis只会使用C字符串作为字面量,在大多数情况下,Redis使用SDS(Simple Dynamic String,简单动态 ...