-
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
Dependency conflict when project.json references csproj #6229
Comments
This is the problem that happens when we don't read the packages.config as part of the dependency walk. |
Please fix this asap. I think it is a very important bug and the workaround as described by @Eilon in aspnet/Mvc#4680 (comment) is a little bit messy especially when it involves large projects. I think 99% of the existing projects out there use .csproj class libraries. So there should be a way of smooth transition to asp.net core. I already saw a lot of people complaining about incompatibilities between .csproj and .xproj. Thanks. |
Yes, please, fix this asap. This bug is blocking us all |
You should be able to move your class library to use project.json to define dependencies while still maintaining the csproj file, this should unblock you (and give you other goodness). See: Get Outlook for Androidhttps://aka.ms/ghei36 On Tue, May 24, 2016 at 7:33 AM -0700, "nemenos" <[email protected]mailto:[email protected]> wrote: Yes, please, fix this asap. This bug is blocking us all You are receiving this because you were mentioned. |
You can also define the dependencies just like you would do in any asp.net 4 web application you would build |
+1 it is blocking issue for us as well (I can do it in VS, but build server crashes) and no - the wrapper kinda work (didn't for dll, does for project /shrug). Going to try @yishaigalatzer suggestion now. |
+1 Blocker for me |
This is blocking us as well. New application xproj wants to consume three csproj-based libraries which are not maintained by us as they live in our code-base as git submodules. So where changing the dependency lib projects is not an option, the new project system is off the table? First: dotnet restore fails Then: dotnet run/build fails fails All this is happening in CLI. From VS, the whole solution compiles and project runs. |
+1 Would like fix. The work-around is working for me, except I don't get any intellisense for my project references. o.O |
+1 Blocker |
Tracking as NuGet issue. |
@rrelyea what's the NuGet issue? |
@dmikov moving to project.json next to the csproj doesn't move you to xproj. It is only used to define the nuget package dependencies. If you can share your project here (or |
@yishaigalatzer, we are using libraries as submodule which we don't own. So getting every upstream repo owner to agree on having This seems very much like a dotnet cli bug or one of its constituents. |
Are there any non- We have a simple ASP.NET Core RC1 web application (with I'm on Windows, so any workaround requiring |
Any solution for this problem? I'm using the latest and still cannot do a dotnet restore with csproj based projects. |
Hitting this too. Any news? |
I wouldn't expect progress on this until we make the move to msbuild |
+1 Seems like a pretty fundamental requirement! |
+1 This is a blocking issue for us too. |
+1 this is a blocking issue for use... any workaround ?? |
I have no work around at this time. This is a blocking issue and has been since we upgrade to 1.0.0 in June. I have no way to get my CI server running. Russ From: mat4oppia [mailto:[email protected]] +1 this is a blocking issue for use... any workaround ?? — |
Have a look at Scott Hanselman's blog. Maybe this can help you. |
My solution builds in Visual studio just fine. It does not build on the my tfs 2015 build server using a new build agent. I am using the Visual Studio build task and it fails saying it cannot resolve the csproj projects. See attached image. The Server.API is my xproj whil the unresolved projects are the csproj. [cid:[email protected]] Russ From: Ingbert Palm [mailto:[email protected]] Have a look at Scott Hanselman's bloghttp://www.hanselman.com/blog/HowToReferenceAnExistingNETFrameworkProjectInAnASPNETCore10WebApp.aspx. Maybe this can help you. — |
Don't use the Visual Studio build task. Use the msbuild task. |
We have the 3.5 version of nuget downloaded. I have a dedicated new task in place running that version of nuget. I will try changing my build task. Russ From: Ingbert Palm [mailto:[email protected]] Don't use the Visual Studio build task. Use the msbuild task. — |
I am not sure if my input will be helpfull or not, but we also strugled with getting our build server to build a solution with xprojs referencing csprojs in the same solution. From what we gathered on the internet there was a solution of installing visual studio on the build machine which we didn't want to do. We use TeamCity, but i suppose the core of the issue is the same. Hope this helps |
I have to run a dotnet restore via a powershell command after the nuget restore as my xproj do not get a project.lock.json file and my msbuild errors out with an error suggesting to run the dotnet restore. the problem is, the dotnet restore does not resolve the csproj files and the build does not resolve the csproj types. |
For all struggling with the
Running msbuild afterwards should succeed. You should not need to run Simply running We have this simple sequence running on CI server just fine. Using nuget 3.5.0.1737 (aka 3.5.0-rc.1) + ASP.NET Core 1.0.1, targeting .NET 4.6.1. Our xproj references several csproj. Not sure if it works if you have a more complicated case like xproj -> csproj -> xproj. It's extremely confusing that there seems to be no place that explains this carefully. Hope it helps. |
Hello pgatilov... thanks for the advice I will try that on my build server today and check that my nuget version is ok. Here is the script if someone need that: `$content = gc -Path "./build/project.fragment.lock.json.token" dotnet restore restore.dg We add a directory in the .net core web site which contain that script and a project.fragment.lock.json.token which is a copy of the projet.fragment.lock.json augmented with a BUILDCONFIGURATION token. Hope it helps... |
Hello I've just finished my test... IT COMPILE :) thanks an lot pgatilov |
Do I have to get rid of all package.config files or can I have my csproj using package.config and my xproj using project.json. I thought that last time I ran just a nuget.exe restore (my sln file) that I did not get project.lock.json files in my xproj folders. Russ From: Pavel Gatilov [mailto:[email protected]] For all struggling with the Unable to resolve 'csproj-based-project-name' for '.NETFramework, Version=vX.X' issue, please make sure
Running msbuild afterwards should succeed. You should not need to run dotnet restore, because nuget should write correct project.lock.json. Simply running nuget restore in a xproj file folder does not work, because it tries to restore packages for the project only and does not see other projects. Seems like a different command is triggered. We have this simple sequence running on CI server just fine. Using nuget 3.5.0.1737 (aka 3.5.0-rc.1) + ASP.NET Core 1.0.1, targeting .NET 4.6.1. Our xproj references several csproj. Not sure if it works if you have a more complicated case like xproj -> csproj -> xproj. It's extremely confusing that there seems to be no place that explains this carefully. Hope it helps. — |
Our xproj uses project.json, csproj use package.config. No issues. |
Well I have made some progress. I found that the nuget restore task provided in the build process task list does not specify which nuget.exe to use. We have the 3.5 nuget.exe in our .nuget folder in our solution but the build task was not using. In digging through the logs I found the task was using a nuget.exe that was downloaded with my build agent. In the build agent folder (..)\Agent\Worker\Tools there was a nuget.exe that was version 3.2.2 which does not use the project.json files. After updating this nuget.exe my xproj project.json are now building project.lock.json. Now my projects referencing my csproj files are now working and building. I still have an issue with a xproj that needs to run a gulp task post build is not doing so. Need to research that now. Thanks everyone for your help. |
Hello All, Has this issue been resolved? It is very hard to understand what steps we need to implement to just get a Hello World style ASP.Net Core app to reference a .Net Framework 4.x assembly. If possible, could someone confirm resolution and/or give use a concise list of steps? Thanks again. |
It'll be fixed when we move the project files back to csproj. |
rashadrivera,
|
We get stuck with the same issue. Our ASP.NET Core app (Web API) references csproj (shared library that used by client). I know about this bug NuGet/Home#2865, but don't quite understand: is it closed ? These days restoring via msbuild is working for me. It deprecated (as I found somewhere), but it works for me. |
@Alezis you should run See https://github.com/dotnet/cli/issues/3205#issuecomment-254406995 |
@pgatilov. Sorry, I new on github. Due to formatting my comment missed [My Solution file.sln]. Fixed. |
Just tried NuGet 3.4.4 and 3.5.0 against my sln file. Same result. My ASP.NET Core API includes these csproj files as follows:
|
@Alezis, that's weird, it should work. Does the sln file contain those referenced projects? Does your xproj contain them? Ours has
(names replaced). So, the referenced projects are present both in project.json, and in .xproj. Might be important. I would recommend using Add Reference dialog in VS to correctly reference projects. |
@pgatilov, I checked and didn't find all those references in my xproj files. I added it manually and NuGet 3.5 restored everything without errors. Thanks for help. We are using only VS 2015 (c 14.0.254431.01 Update3) to manage project files. |
I got another issue. Interesting thing. I have following project graph
xproj1 - are unit tests for our asp.net core (xproj2). As suggested @pgatilov I have edited xproj2 and added references to csproj1 and csproj2. Now when I run |
Yes, we do that same thing. in our solution. We have xunit tests that reference our xproj which in tern references csproj. Couple of things to make sure.
|
I had the same problem moving from project.packages to project.json. Solved it with the help of pgatilov comment above. Removed the project from the solution then re-added it. Thanks alot! |
Moved from aspnet/Mvc#4680
By @pantonis
Steps to reproduce
Use the app from https://github.com/pantonis/AspNetRC2EFCore
It is a simple web app (project.json) that references a class library (csproj + packages.config) using this syntax:
Expected behavior
Everything should compile and run.
Actual behavior
Environment data
dotnet --info
output:The text was updated successfully, but these errors were encountered: