-
Notifications
You must be signed in to change notification settings - Fork 526
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
Package ... contains libraries, but not for the selected TargetFramework net452 in project ... #1693
Comments
Adding limit framework >= 4.0 will significantly lower the amount of warnings. |
We're getting this issue as well and it's causing a bit of confusion. It's a weird situation really. I've made a reproduction here: https://github.com/Rcomian/paket3dotnetcoreissue It's a very simple repro. We had a secondary issue which was warned correctly and we could resolve it, but was harder to see since the initial reaction is always, oh there's a hundred pointless warnings, ignore all. Adding in framework: >= 4.0 does quiet the warnings. I'm really not sure if that's the thing to do or if it's just hiding the problem in paket. |
that framework limit is fine since you don't use coreclr |
@forki thanks. Buuuuuut I can't help feel that paket might be able to work this out itself. As I say, we have had legitimate warnings in this area that we don't want to quiet. |
there is framework: auto-detect |
There is and it works, but doing so means that now my .net core packages have been removed. If I then switched to .netcore as a build target, we would have to re-run paket install, or maybe just restore. But paket has this wonderful structure of conditionals everywhere so that we've not had to do that before - all packages were available and we could just build for different targets without having to recalculate packages in between. The framework is fine as a workaround, I'm just not sure it's a solution. |
I think this is an underlying issue that's causing other bugs, I've got 2 further build problems based on the same dependency issues:
|
I'm not sure I can follow |
I'll try for a reproduction on that repository |
I've updated https://github.com/Rcomian/paket3dotnetcoreissue Double click paket.update.cmd for the warnings, |
what do you expect it to do differently? |
The paket.update.cmd I would expect to complete without warnings. It does the right thing to the files as far as I can tell, but the warnings are spurious, unnecessary. The build.cmd - there's no reason for that to fail. |
so if the files are ok, then only thing for me to do is to look at the additional warnings and see if we get rid of those!? |
warnings is step 1, for sure. Step 2 would be to get the build.cmd working when we specify an output directory through msbuild. This might be a separate issue, looking at it. |
still don't understand why you think the message is not correct? It has libs for netcore, but not for net45!? |
Ah, ok, no problem. The message is a warning based on the currently selected framework. That's fine as stands - but there's a problem. The direct dependency is AutoMapper. Now AutoMapper can depend on System.Collections, if the framework is .netCore. Paket has had this behaviour since day 1 and I love it. It's really powerful and correct to not have to re-install your nuget packages every time you switch frameworks. So all that works. But then paket looks at System.Collections, sees it only has assemblies for .netcore and not .net452 as currently selected, and prints the warning. I come down hard on warnings in general, warning fatigue hides real problems. So I don't want spurious warnings. But System.Collections isn't even going to be brought in as a dependency when we're building for .net452. So the build would work - because we don't need System.Collections with this configuration, but the warning implies it won't. So that's the warning issue. If that makes sense. I can try to explain another way if you like. Paket now creates an "AfterBuild" build step that copies dependencies to the output. This step is copying System.Collections to the output folder even tho it's not required in the current build. More than that, if you then specify the output folder using /p:OutDir on the msbuild commandline, it fails to copy System.Collections. It looks like the build step builds the path of where it expects the output to be, but because we specify it directly, the build step gets the wrong path and can't find what it's after. Which is messing our builds up :P Now there is a workaround of sorts. Putting in Framework: >4.0 This helps for now. There's another workaround: http://stackoverflow.com/questions/12003475/override-target-framework-from-command-line The commandline version works normally because of the wonderful conditionals that paket adds to the csproj file that ensures that the right assemblies are referenced in the right situations. But if you use So if you change the framework, suddenly there's no assemblies being referenced. There is an additional problem with the .wixproj files which I'm trying to pin down with a reproduction. Effectively it's looking like there are some conditionals being used that are always false, but right now I'm not sure. To sum up. (I've just noticed the latest version of paket doesn't fail the build as I discuss here, it successfully copies the unnecessary dependent assemblies into the wrong folder). |
thanks for clarification. that message should be gone in latest alpha. |
Sorry for the delay. Yes the warning is gone, but is it right to get rid of the warning entirely? I still think it's valid to warn if, for example, I depend on AutoMapper with .net 452 and AutoMapper only supports .netcore ... |
the warning is not gone entirely |
Ok cool :D |
Thank you! |
When I run paket.exe install, I got these warnings:
xunit.assert
andxunit.core
are using dnxcore50 (.Net Core) and referencing all these libraries as Nuget-packages. So of course I use System.Collections and System.Linq in my other projects, but they are not using dnxcore. I don't have direct reference to core libraries via nuget.The text was updated successfully, but these errors were encountered: