简体   繁体   中英

Unable to access Asp.Net vNext application hosted in Docker Container in Windows Server 2016 Azure VM

I have created ASP.net vNext application in Visual Studio 2015.

I have used Docker tools for VS 2015. Created the Windows Server 2016 VM and published my asp.net vnext application inside a container.

I have added network security group the NIC of this VM. I have opened up port 80.

When I am trying to access the web application hosted inside the container from my Laptop; I was getting the page cannot be displayed.

On Ubuntu VM: I was successfully hosted the asp.net vnext application inside the container and was able to access it from my laptop in IE browser.

On Windows Server 2016 (Container Preview VM in Azure): I am able to host the application inside the container. But unable to access it from my Laptop using its public IP. Found that I have to do some changes to NAT.


Solved

The problem was with the DNX version. I fixed the code. Now I was able to host the asp.net vnext application inside the docker container in windows server 2016. URL: http://dockersample3vm1.eastus.cloudapp.azure.com:8099/

Issue 1: I did not have dnx-clr-win-x64.1.0.0-beta6 folder under "C:\\Users\\Viswanatha.dnx\\runtimes" folder. So I just created an empty folder and it started compiling. After publishing it could not locate the files. So it started throwing the exception. Yesterday your clue to get into the container and execute web.cmd unearthed that issue.

Issue 2: After fixing the Issue 1. It was throwing another exception which pushing the solution itself. I have added the “'System.Runtime.Serialization.Primitives”: “4.0.10-*” dependency in project.json. System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime.Serialization.Primitives, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. Rest is happy ending ;)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM