zoukankan      html  css  js  c++  java
  • [eShopOnContainers 学习系列]

    [eShopOnContainers 学习系列] - 02 - vs 2017 开发环境配置

    https://github.com/dotnet-architecture/eShopOnContainers/wiki/02.-Setting-eShopOnContainers-in-a-Visual-Studio-2017-environment

    一、 核心步骤

    起始要真的这么简单就好了,坑实在是多,下面开始一个一个排吧

    二、Windows 下其他配套软件配置

    1. Hyper-V
      Windows 10 自带,只需要用 power-Shell 开启就行。装这个还是为了 Docker 的正常运行
    • 使用超管运行 power-shell ,敲入命令:
      Enable-WindowsOptionalFeature -Online -FeatureName:Microsoft-Hyper-V -All
    1. Docker ce for Windows
      直接上官网下载安装

    2. 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

    用 http://localhost:5104

    七、测试微服务 Swagger

    容器运行状态下,使用 http://localhost:5101 进行测试

    八、应用和微服务列表

    九、手机端测试

    可以测试 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.
  • 相关阅读:
    ScheduledExecutorService改为一次性延时任务
    layer弹框倒计时结束后执行
    pom.xml如何使用本地库的jar-jar包上传到远程库-jar包安装到本地库
    Windows+WinRAR 压缩后备份文件夹
    java DES加密
    JAVA RSA加密公私钥
    Microsoft 语音服务异常 java.lang.UnsatisfiedLinkError: com.micros oft.cognitiveservices.speech.internal.carbon_javaJNI.swig_module_init()
    Java 线程池
    jsp页面导入excel文件的步骤及配置
    正则表达式校验时间格式(2018-01-02)
  • 原文地址:https://www.cnblogs.com/chutianshu1981/p/8036955.html
Copyright © 2011-2022 走看看