I'm trying to get running a docker support with Visual studio 2017 for a .net core 2.0 web app running on linux containers. I'm working on machine with win 7 OS, so I must use a Docker toolbox with Virtual box. I've already checked this question: How to get docker toolbox to work with .net core 2.0 project, but I got stuck in the following problem, when trying to run it with VS:
Volume sharing is not enabled. Enable volume sharing in the docker ce
for windows settings
So far I know that there is a default volume mounted under the C:\Users, so my project files should be copied somewhere under this folder in case I don't want to mount any other volume. So I copied them there.
When I check the settings of my Virtual box, folder seems to be shared:
I can even cd into this folder with command line, but still can't get over this problem. Any ideas about this?
Finally I got this running. Error message comming from VS is very misleading and it has nothing to do with volume sharing. Eventually I realized that problem is in running a debugger, because when I ran solution with Ctrl + F5 everything was ok and container started correctly. Problem occurred only when running with F5 and trying to attach a debugger.
Then I found some clues in console output. VS tries to download some tooling for debugging containers with powershell script named GetVsDbg.ps1. When running this script I could observe errors like:
Add-Type : Cannot add type. The assembly
'System.IO.Compression.FileSystem' could not be found.
Finally I fixed this issue by updating powershell version which was somehow in collision with my .net framework installed on my machine.
Well in my case it turned out that I had changed my windows password and docker wasn't able to get access.
So it was just
uncheck shared drives
Apply
Check again. Enter new password
restart docker
Below setting helped me getting rid of this error. Check the drive you want to share and click apply. This might ask you your network credential just enter in case it pops up.
Docker settings
Thanks,
Rakesh
I fixed it by running following command in Powershell:
docker network create nat
I got same issue attempting to publish an Azure Function App to a Container Registry.
Newer version of Docker Desktop for Windows 2.3, has new interface. I had to got to Resources|File Sharing and add a new Folder. This resolved that issue...
Related
I'm new to Visual Studio, and I just downloaded the Xamarin package over the weekend. The very first time I ran the Android Emulator, it seemed to work fine. (This was simply running the "Hello World" base-script. Then when I opened the emulator again, it began having Deployment errors.
Deploy Failed
Pressing Yes, yields no results. After some research of my own, I believe that the issue may be because Hyper-V is not running. Enabling it should be simple, but i have tried a few different methods and cannot seem to get it to run. One way I tried was via Powershell: Powershell Feature Name Unknown
Having tried that, I tried to enable it manually via settings: Settings
To my understanding, there should be a few different folders here called "Hyper-V" or something to that effect on top of Hypervision Platform folder. Is this why my emulator isn't running, because I don't have access to the Hyper-V folders, or could something be wrong in Vis Studio itself? Like I said, I'm very new to this software and workflow so any trouble shooting ideas would be appreciated.
I am using asp.net core 2.2 and Visual Studio 2019. The containers my application are running on are Debian (one of the official aspnet:2.2 docker images)
So my situation is this. I have an application that consists of 4 microservices running in docker containers and I'm seeing very high cpu usage on the containers nodes when this is under load. What I would like to do is profile the executing code to get an idea where this resource use is happening.
As a starting point I thought I would simply get some profiling running on my local development environment, just to get an idea of what the execution looks like in general. Although in production this runs in Kubernetes I do have a development environment that uses docker compose and I find the Visual Studio Docker tools to be fairly good.
I was hoping to use some of the visual studio profiling tools. I was able to install VSDBG on one of my locally running containers and connect to it with VS BUT in the diagnostic pane I see "the diagnostic tools window does not support the current debugging configuration". I've also tried just running the project from VS using docker compose but I see the same message when I hit a breakpoint. I'm not finding much out there about how to do this.
I also tried getting profiling going using perfcollect but after I generated the trace and opened it with perfviewer I was getting a parsing error when trying to view the cpu stacks . Still not sure what's going on there. I did find an old closed issue on their github describing what I am seeing but there was a fairly recent comment from someone saying they were seeing it with the latest version so maybe it's a regression.
So.. after all this .. my question is this. Are either of the above approaches viable? Is there a better way to achieve this? I'm interested in any way someone has had success viewing some code profiling of a .net core 2.2 application running on a linux docker container. All I really want to do is be able to see where in my code the execution time is going and what resources are being consumed. As I've mentioned I'm not finding much out there when I Google for this and I seem to keep hitting walls. If anyone had any advice or direction on a approach here I would really appreciate it. Thanks much!
Are you open to upgrading to .Net Core 3.0 (.Net Core 2.2 is going out of support in a few days: 12/23/2019)
If you're open to that you can take advantage of the new tool dotnet-trace which supports running in a linux container and can be used with the tools in Visual Studio.
Here are the steps I used to add it to my project:
Change your base image to use the sdk image (needed to install the tool).
Add installing the tool to the image:
RUN dotnet tool install --global dotnet-trace
ENV PATH $PATH:/root/.dotnet/tools
Alternatively if you don’t want to add it in your image you can run the following commands in a running container (as long as it as based on the SDK image):
dotnet tool install --global dotnet-trace
export PATH="$PATH:/root/.dotnet/tools"
Start the project without debugging (Ctrl+F5)
Use the Containers Tool Window to open a terminal window
Run the command:
dotnet-trace collect --process-id $(pidof dotnet) --providers Microsoft-DotNETCore-SampleProfiler
When you are done collecting press enter or Ctrl+C to end the collection
This will crate a file called “trace.nettrace”
By default that /app folder that file would be created in is volume mapped to your project folder. You can open the file from there in VS.
I have created a new DotNetCore 2.0 web project in VisualStudio 2017.
I have docker running in machine with Docker Server Host configured for Windows.
While running solution i'm getting below error,
'The DOCKER_REGISTRY variable is not set. Defaulting to a blank
string.'
Building myfirstdotnetcore Service 'myfirstdotnetcore' failed to
build:
Get https://registry-1.docker.io/v2/: net/http: request canceled while
waiting for connection (Client.Timeout exceeded while awaiting
headers).
I had this issue and has resolved after taken below steps.
Run Visual Studio as Administrator
Your running Docker host should logged-in to your DockerHub account.
This is very important
The main reason for this issue is Visual Studio couldn't download nano server image from docker hub. So always make sure that you logged in to your dockerhub account from running host
I needed to set docker registry Environment Variable. Path needs to be lowercase for some reason.
[Environment]::SetEnvironmentVariable("DOCKER_REGISTRY", "d:\docker\registry\", "Machine")
I found these related issues on github:
https://github.com/Microsoft/DockerTools/issues/130 (this is tracking the fix)
https://github.com/aspnet/Docs/issues/7234
TLDR; This error is misleading, and can mask several internal docker errors which Visual Studio currently swallows (these should be visible in your build output) - this is expected to be fixed in Visual Studio 2017 15.8 but as of 15.8.2 this is still a problem and the bug is still open, so I assume its still on the way.
Until then, the general consensus seems to be that the following step combination should workaround most of the underlying issues. NB! these might need to be repeated after machine restarts.
Run Visual Studio as Administrator
Ensure you are logged in to Docker - e.g. run docker login
Restart Docker for windows (right click in system tray and select restart)
I'm not certain if the order of the above might be important.
In Docker Settings -> Network, I switched the DNS Server setting to "Fixed" as below and it worked for me! Hope that helps
I tried everything mentioned above but nothing worked. The issue for me was simply the fact that I did not have an environment variable named DOCKER_REGISTRY, as it clearly states in the error, so I created a system environment variable named DOCKER_REGISTRY and gave the path C: to it. This answer helped me. Remember to restart your system after creating the variable.
Do you have the detailed error message?
I had a similar problem, turned out that virtualization wasn't enabled on my machine.
run 'systeminfo' in power shell, and make sure that hyper-v is enabled
I did almost like #David Silwal said.
I ran Visual Studio as Admin.
I was already logged-in on my docker hub account, but even like that, it wasn't working.
So I logged-out and logged-in again. Then, it worked!
Just clean the project solution explorer and rebuild the solution.
Run Visual Studio as Administrator
Right click on Docker tray icon -> Restart
Exact error:
Severity Code Description Project File Line Suppression State
Error DEP0001 : Unexpected Error: -1988945906 TestApp
What does it mean? It seems it isn't problem with application, it works OK on PC.
Version of OS: 1511, Windows 10 for phones 10.0.10586.164
I've experienced the same problem after updating Visual Studio community to Update 2. Typing in CMD (under admin rights) the following command solved my issue:
net start IpOverUsbSvc
Thanks to Agrgg for a good tip ;)
This kind of error happens very randomly and usually it means there was an issue during the deployment of the app. Things to check:
Developer mode is correctly enabled on phone
Uninstall the app from phone, rebuild solution and then try debug again
Check that the architecture for all projects is set accordingly (ARM for debugging on real device)
Sometimes the VS debugger hangs up, so closing VS and kill from Task Manager all VS processes that are eventually running and restart VS may also help.
I had the same error with deploying onto Windows Phone 8.1 device. In my case the problem was in Windows Phone IP over USB Transport (IpOverUsbSvc) service, which wasn't running. The deployment error disappeared after I'd started the service manually.
I had the same problem.
"net start IpOverUsbSvc" didn't worked for me (throws Access is denied Exception).
I have followed following steps to fix.
Start Run (Windows+R), Type: services.msc
Start/Restart Windows phone IP over USB Transport.
For the RPi, I have RPi3 with WIOT (build 14376) this error happens after failed deployment. Just restart VS and it'll deploy ok.
After trying some of the answers already provided and nothing worked, I fixed the error by simply restarting the phone.
After that the error was gone for me.
I had the same issue, and found that in my case it was occurring while the phone was downloading system updates in the background.
App updates/installations from the app Store were also prevented from downloading/installing.
After the update had finished, all was back to working again.
As Windows Phone 10 doesn't seem to make it obvious that it's downloading updates, maybe worth checking this out if you hit this problem.
I had the same error, solution is here: https://msdn.microsoft.com/ru-ru/library/windows/apps/jj863509(v=vs.105).aspx
Look at Checking BIOS settings required by Hyper-V for Data Execution Prevention. You must select "Turn on DEP for all programs and services except those i select" and in my case application deploys successfully.
For me, it was as simple as unlocking the phone so that the computer would have access to it.
I had this issue as well. None of the answers helped me. IpOverUsbSvc was up and runing, phone reset, system reboot, nothing...
The issue was fixed after a Visual Studio "repair": control panel -> Programs and features -> select VS2015 -> Repair
I got a similar error.
The reason the error occurred for me was because I forgot to add the new splash images in assets after deleting the old ones.
The solution was to add the images. To get the correct image names and sizes, I used this extension for visual studio.
For Windows 10 (desktop) users
I faced this problem after I uninstalled Windows 10 SDK. It deleted the IpOverUsbSvc service from the system.
Solution
Download the Windows 10 SDK .iso installer
Inside it there is Installers folder.
Find Windows IP Over USB-x86_en-us.msi. Install it. (Don't worry if there is no setup window, it installs fast and silently).
I didn't even have to reboot VS2015, it just worked.
Check if the IpOverUsbSvc service is running
Open a Powershell prompt and type Get-Service -Name *USB*
Or go to the Services window. There you should see the IpOverUsbSvc running.
So, I think I get the trick. After plugged in your Windows Mobile device, Windows App Deploy can see W10M device, but once your device goes to lock screen, WPD can not detect it anymore.
You should to plug out and plugin again, with screen unlocked, to make it detectable. (I'm not a really English speaker).
I am trying to create a dev box for SharePoint 2010 Server utilizing the following:
http://blogs.msdn.com/b/cjohnson/archive/2010/10/28/announcing-sharepoint-easy-setup-for-developers.aspx
So first of all this is new to me. I understand that these are instructions are for dual boot in Windows Native, but I am more interested in using a VHD/image of the OS to run on VMWare.
I have tried creating an image of a running virtual machine with sysprep tool, but hit a dead end with capturing the image to a file that I can reference within the running machine to run the scripts against.
I took a look at Diskpart on TechNet, but as I am new to this, I am not sure this is what I want to do?
I tried installing to the local host (virtual machine that is running) and am getting an error there also; fails at Windows Identity Framework.
It is a clean install of Windows 7 (literally nothing else), and the UAC has been disabled.
Is there any insite, help, or advice anyone can provide me regarding this? I would really appreciate it as I have to get working on the development aspects of SP (workflows, web parts,etc), and need a dev env, and I can't seem to get anywhere with this.
Thanks
Justin