Closed AArnott closed 7 years ago
Thanks, will fix
Hmmm...I can't repro it, do you have a branch where I can see this? Did you remember to add <Import Project="$(MSBuildSDKExtrasTargets)" Condition="Exists('$(MSBuildSDKExtrasTargets)')" />
to the end of your csproj file?
I just used your exact TFM and it worked for me...
Peculiar. Anyway, yes here is the commit that can repro it: https://github.com/AArnott/Validation/commit/7f904e6597e67a1cd4ab515b5f209ad83352ff76
Just comment out the extra property group I also added as a workaround and it should repro for you.
Can you try the latest from the MyGet feed? https://www.myget.org/F/msbuildsdkextras/api/v3/index.json it's more robust in the contains searches (though I wasn't able to repro it anyway)
Will try your repo shortly
sure
trying that commit, I get the following error. Restore was successful, build failed on the netstandard1.0 version
Assumes.cs(60,33): error CS1061: 'IEnumerable<T>' does not contain a definition for 'Any' and no extension method 'Any'
accepting a first argument of type 'IEnumerable<T>' could be found (are you missing a using directive or an assembly r
eference?) [C:\dev\Validation\src\Validation\Validation.csproj]
ya, you got further than I got with your 17 build
I'm still seeing a failure on the portable-net40 one on mine, even with your 18 build
I'll try to step through it (mentally at least) with your latest .targets to figure out what's going wrong. Perhaps with a /pp:
step that I can share if I can't figure it out.
What's weird is that if I just leave that TFM in your project, it fails for me too. But if I put that TFM I the TestLibrary that's part of this repo, it builds fine. It also builds/tests fine when part of sdk/pulls/889
I just found this in my Validation.csproj.nuget.g.props file. See anything missing? (I think I do)
<ImportGroup Condition=" '$(TargetFramework)' == '' AND '$(ExcludeRestorePackageImports)' != 'true' ">
<Import Project="$(NuGetPackageRoot)msbuild.sdk.extras\1.0.0-rc4.18\buildMultiTargeting\MSBuild.Sdk.Extras.props" Condition="Exists('$(NuGetPackageRoot)msbuild.sdk.extras\1.0.0-rc4.18\buildMultiTargeting\MSBuild.Sdk.Extras.props')" />
</ImportGroup>
<ImportGroup Condition=" '$(TargetFramework)' == 'net40' AND '$(ExcludeRestorePackageImports)' != 'true' ">
<Import Project="$(NuGetPackageRoot)msbuild.sdk.extras\1.0.0-rc4.18\build\portable-net4+wp7+sl4+win8\MSBuild.Sdk.Extras.props" Condition="Exists('$(NuGetPackageRoot)msbuild.sdk.extras\1.0.0-rc4.18\build\portable-net4+wp7+sl4+win8\MSBuild.Sdk.Extras.props')" />
</ImportGroup>
<ImportGroup Condition=" '$(TargetFramework)' == 'net45' AND '$(ExcludeRestorePackageImports)' != 'true' ">
<Import Project="$(NuGetPackageRoot)msbuild.sdk.extras\1.0.0-rc4.18\build\netstandard1.0\MSBuild.Sdk.Extras.props" Condition="Exists('$(NuGetPackageRoot)msbuild.sdk.extras\1.0.0-rc4.18\build\netstandard1.0\MSBuild.Sdk.Extras.props')" />
</ImportGroup>
<ImportGroup Condition=" '$(TargetFramework)' == 'netstandard1.0' AND '$(ExcludeRestorePackageImports)' != 'true' ">
<Import Project="$(NuGetPackageRoot)msbuild.sdk.extras\1.0.0-rc4.18\build\netstandard1.0\MSBuild.Sdk.Extras.props" Condition="Exists('$(NuGetPackageRoot)msbuild.sdk.extras\1.0.0-rc4.18\build\netstandard1.0\MSBuild.Sdk.Extras.props')" />
</ImportGroup>
<ImportGroup Condition=" '$(TargetFramework)' == 'netstandard1.3' AND '$(ExcludeRestorePackageImports)' != 'true' ">
<Import Project="$(NuGetPackageRoot)msbuild.sdk.extras\1.0.0-rc4.18\build\netstandard1.0\MSBuild.Sdk.Extras.props" Condition="Exists('$(NuGetPackageRoot)msbuild.sdk.extras\1.0.0-rc4.18\build\netstandard1.0\MSBuild.Sdk.Extras.props')" />
</ImportGroup>
<ImportGroup Condition=" '$(TargetFramework)' == 'portable-net45+win8+wpa81+wp8' AND '$(ExcludeRestorePackageImports)' != 'true' ">
<Import Project="$(NuGetPackageRoot)msbuild.sdk.extras\1.0.0-rc4.18\build\netstandard1.0\MSBuild.Sdk.Extras.props" Condition="Exists('$(NuGetPackageRoot)msbuild.sdk.extras\1.0.0-rc4.18\build\netstandard1.0\MSBuild.Sdk.Extras.props')" />
</ImportGroup>
The version that produced this is at tip of fix20 at this point.
Your targets aren't getting imported because there's nothing in the above xml snippet to import portable-net40-*
When I change my net4 TFM to exactly your package's build folder name (portable-net4+wp7+sl4+win8
) it works.
(at least, the .props gets imported)
OK: it's because your folder is missing wpa as a target.
rename your package's build folder from portable-net4+wp7+sl4+win8
to portable-net4+wp7+wpa+sl4+win8
and you've got it made it seems.
good catch
Can you try one thing for me? portable-net4+wp7+sl4+win8+wpa81
isn't really a real TFM, I think... but I think it should work with any
as the folder name as the ultimate fallback. Can you test that out and see if that works? If so, that seems like a better failsafe than an invalid TFM combo.
hold on. wpa doesn't belong in a net40 era, does it? Nor does win8. I thought these new platforms were only available for net45 era PCLs.
I think it should work with any as the folder name as the ultimate fallback. Can you test that out and see if that works?
Tried. It doesn't work.
Profile 328 is sl5, not sl4 that's the difference... but if it works for you and nuget evaluates it correctly, then so be it :)
I wasn't targeting sl4. That just came from your folder name.
yup, that was there because some of the PCL profiles include wp7 and sl4. I just pushed a new build with portable-net4+wp7+sl4+win8+wpa81
, it should be on the MyGet feed in a few min. If you can validate that package, I'll push it to NuGet.
Thanks for finding this! I missed it because my test project doesn't use NuGet as it includes the targets directly.
hold on. wpa doesn't belong in a net40 era, does it?
It does. I just confirmed. So your fix looks good. I'll try your latest CI.
It works. Thanks.
-19 will be on nuget in a few min, thanks!
Per Stephen Mccleary's blog which your readme references, I tried to add
portable-net4+sl50+win8+wpa81+wp8
as a target framework, but I get these build errors when I do so: