-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VS2017 Docker-Compose Project breaks build on command line #8019
Comments
This is an SDK that ships only with VS. It is not supported in the CLI. |
Right, completely understand that. By adding the docker-compose project feature to a solution completely breaks running The microsoft/aspnetcore-build:1.0-1.1 docker image has "fixed" this by adding the SDK in the dotnet path. Howerver, I hope this is a temporary workaround.
|
There is a PR out right now add this SDK to the CLI, which should address this issue. |
Great! Thanks for the quick turn around |
It appears this issue was closed since dotnet/cli#6180 is supposed to resolve it. Then dotnet/cli#6180 was closed because it requires the Microsoft.Docker.SDK to be open sourced before it can be merged. So how are users supposed to resolve this issue going forward? |
@jgreene In the short term, you just need to copy the appropriate files from the VS 2017 installation (C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Sdks\Microsoft.Docker.Sdk) to where |
@livarcocc I propose that this issue be re-opened since there is no fix currently in place except for manually copying SDK files. |
@philcontrolf1 thank you for the solution, this worked for me |
Manually copying the files also worked for me, but I also suggest to reopen this issue, as it is indeed an issue until the files are distributed with the CLI. |
With vague apologies for the self-promotion, having put together a whole pipeline of .NET Core 1.1, Visual Studio 2017 and Docker on TeamCity, I wrote a blog post for work on it - hopefully it will help anyone else trying to do this. |
I also ran into this today. Copying the files is non-ideal as we run |
@khayes Our build agent bootstrapper copies the files on - see my blog post for details. |
In the community edition the sdk is: ... and for 2.0.0-preview1-005977 on OSX you need to put the files here: |
Since these extensions are installed to VS's copy of msbuild but not |
@rainersigwald Not on my Linux CI build agents I can't :-) |
Reopening this issue since it hasn't been resolved yet. I think not being able to build a solution that contains a dcproj without hacks is a significant blocker. @dazhao-msft - any updates on dotnet/cli#6180 |
@srivatsn thank you for re-opening |
The fix (copying VS Docker SDK to dotnet sdk) does not seem to work for 2.0.0-preview2. I get this error: Any solutions for this? |
@dmitry606 Seems to work for me:
Have you got exactly the same SDK files in exactly the same location?
( |
@philcontrolf1 Yes, it's exactly the same location `c:\repo\HelloWorld>cd C:\Program Files\dotnet\sdk\2.0.0-preview2-006497\Sdks\Microsoft.Docker.Sdk\Sdk C:\Program Files\dotnet\sdk\2.0.0-preview2-006497\Sdks\Microsoft.Docker.Sdk\Sdk>dir Directory of C:\Program Files\dotnet\sdk\2.0.0-preview2-006497\Sdks\Microsoft.Docker.Sdk\Sdk 07/31/2017 03:59 PM .07/31/2017 03:59 PM .. 07/28/2017 06:50 PM 1,927 Sdk.props 07/28/2017 06:50 PM 1,220 Sdk.targets 2 File(s) 3,147 bytes ` |
@dmitry606 You've definitely got different files though - my |
@philcontrolf1 Yep.. looks like that. I copied the SDK from VS 2017 Preview 2. Probably they broke the SDK in preview2. For now I decided to use Visual Studio for build, hope it will be fixed soon.. |
@dmitry606 It looks like that you copied the Microsoft.Docker.Sdk folder from VS 15.3 Preview, under which there are 3 folders: build, Sdk, tools. Please delete build and tools and only keep Sdk. |
@dazhao-msft It worked! Thanks!! |
now Linux .net core 2.0 sdk doesn't support docker? I got |
@milla Have you copied the appropriate SDK as listed in this thread? If so, exactly which files did you copy, where did you copy them from, and where did you copy them to? A number of us have this working under Preview 2, so it's definitely not completely broken. |
@philcontrolf1 thanks for checking. It's confirmed that this is a mistake, I built some vsts build agents for different purposes of testing, some of them don't have docker installed. and the agent I used and occurred this problem just doesn't have. Now everything is working perfectly. |
Any ETA on fix? |
So no fix? |
ping @richlander ? |
I open Docker CLI as an administrator and just move to the project directory and run following set of commands and it works for me. Also make sure kitematics is running if you are on windows 8.
|
Is this going to get fixed with .net core 2.1? |
Yes.For me, it's working for .net core 2.0 and 2.1 |
@zunair-ch Yes, it will work in the project directory because then all you're building is the one project. What happens if you build the solution - e.g. |
For all the watchers here: dotnet/cli#8416 should fix this one. I've just bumped it to see if there's anything blocking it. |
This a good to hear. Thanks for fixing! |
Thanks all.
…On 10 Feb 2018 4:24 am, "Bill Pratt" ***@***.***> wrote:
This a good to hear. Thanks for fixing!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<https://github.com/dotnet/cli/issues/6178#issuecomment-364598176>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ARNoP8UM8gxIaBy9-ch9WV3DH_Yt8sXvks5tTNOxgaJpZM4MsBSr>
.
|
It was blocking solution-level restore from working (dotnet/cli#6178) and didn't work to launch Docker containers from VS anyhow (microsoft/DockerTools#54)
* Remove the docker-compose project from the sln * It was blocking solution-level restore from working (dotnet/cli#6178) and didn't work to launch Docker containers from VS anyhow (microsoft/DockerTools#54) * Remove .dcproj since it's not currently used
I'm currently facing the same problem - solution with docker-compose.dcproj (added by VS after adding enabling docker support) cannot be built or restored with dotnet CLI. Looking at the comments above I think it should be working, however it doesn't (at least for me). Am I missing something? Below is dotnet --info output:
|
Same problem here with SDK 2.2.101. 😞 |
The latest Docker support for ASP.NET Core projects doesn't use |
@joergjo I tried; that only works if a single <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<UserSecretsId>f3532c1f-c8ec-4713-8e86-0fc6ebc385c8</UserSecretsId>
<DockerComposeProjectPath>..\docker-compose.dcproj</DockerComposeProjectPath>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.0.2105168" />
</ItemGroup>
</Project> ... and the command-line build fails again:
There is a newer version available on NuGet, compared to what was generated by the right-click experience, of Microsoft.VisualStudio.Azure.Containers.Tools.Targets, but that doesn't help. I don't know the details, but it seems to me that we're still blocked on the (Note: Although I did the above quick & dirty build on Windows, my requirements are to be able to also do the above build on Linux for CI/CD on a build server, ultimately in a Docker container, and with that in mind I think I see another problem that |
I hadn't even noticed that feature! I always use the "basic" Docker support (i.e. no If I want to debug a containerized app with its dependencies running in Docker as well (which rarely happens), I start all dependencies using |
|
@vchirikov how is it broken for you? |
@livarcocc you can read about it here microsoft/DockerTools#209 |
Looking at the issue you referenced, the CLI team will not enable building this dcprojs in the command line. Though, there is now an SDK that should at least skip doing anything for it. What seems like a bug to me is the failure to use dotnet sln add for dcprojs. If that's the case, I would suggest filling a brand new issue just for dotnet sln add. |
@livarcocc Which SDK should skip dcprojs while building? I've just tested with 3.1.100-preview1-014459 and I'm unable to run dotnet build or dotnet test on solution containing dcproj file. The error is: C:\Program Files\dotnet\sdk\3.1.100-preview1-014459\NuGet.targets(123,5): error : Invalid restore input. Invalid target framework 'unsupported'. And I have a workaround. Adding |
Can you please file a separate and new issue for this? So that we can start fresh?! @dsplaisted wonder if this is due to the framework composition work we did. Could you take a look? |
Unfortunately I can't reproduce it with solution created from scratch with VS2017, VS2019 and different project types. Issue occurs only in my old and big repository, which I can't share. Maybe there is a corner case that I have run into, but I can't really tell exactly what it is. |
@livarcocc repro here |
How is this issue closed? dotnet restore is still broken for me with a dcproj file in the solution. Just for any others needing a workaround in their linux CI agents: |
@SeWieland - I also have the same problem. As this one is closed I have opened issue #35134 |
Steps to reproduce
In Visual Studio 2017: File->New Project->ASP.NET Core Web Application
Choose either Web API or Web Application
Check "Enable Docker Support"
Go to command line and run
Expected behavior
Restore and build work when a Docker-Compose project (.dcproj) is in the solution.
Should work across all platforms that
dotnet
is supportedActual behavior
error MSB4019: The imported project "C:\Program Files\dotnet\sdk\1.0.0\Sdks\Microsoft.Docker.Sdk\Sdk\Sdk.props" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.
Environment data
dotnet --info
output:.NET Command Line Tools (1.0.1)
Product Information:
Version: 1.0.1
Commit SHA-1 hash: 005db40
Runtime Environment:
OS Name: Windows
OS Version: 10.0.14393
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\1.0.1
The text was updated successfully, but these errors were encountered: