netstandard project not building
Hi,
I have a project that builds perfectly fine on my dev machine, but not on AppVeyor. It's targeting netstandard 1.0, and that would appear to be the problem.
I assume the VS2015 image includes update 3? Any thoughts on what might be causing this failure?
Thanks,
Kent
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
1 Posted by Ilya Finkelshte... on Aug 18, 2016 @ 08:19 PM
Hi Kent,
Running
nuget restore
before your build.bat enabled the build. I think that it was Microsoft.NETCore.Portable.Compatibility which was missing.However some tests are failing because of some issue with new line character (build of my fork - https://ci.appveyor.com/project/IlyaFinkelshteyn/kbcsv/build/1.0.5)
It does not fail on my machine though. And obviously on your machine ☺
I attached debugger on both build VM and my machine to
write_records_async_writes_records_to_text_writer()
and here are data from immediate window (breakpoint is onAssert.Equal()
statement). On immediate window I am looking onto objects using insideAssert.Equal()
statement.Build VM:
My computer:
As you see
stringWriter
instance has more members on my computer, andexpectedCsv
has\r\n
as a new line on my computer.Something is fundamentally missing on build VM. I will try to understand, but you are obviously more familiar with this solution – do you have an idea what can be wrong?
--ilya.
2 Posted by Ilya Finkelshte... on Aug 18, 2016 @ 09:13 PM
OK, my co-worker advised me to try
git config --global core.autocrlf true
atinit
stage (beforegit clone
) and it works now. Here is working YAML:--ilya.
3 Posted by Kent on Aug 20, 2016 @ 05:47 AM
That's super helpful - thanks Ilya!
The missing dependency kinda makes sense. My build script restores all packages in packages.config files, but I switched to netstandard so am using project.json now. Will have to see whether FAKE supports restoring packages from project.json files...
Cheers,
Kent
4 Posted by antao.almada on Dec 02, 2016 @ 06:22 PM
Hi,
I converted my project from PCL to netstandard and I also can't make it build here.
I already added the nuget restore to my init.
The project is at https://ci.appveyor.com/project/AntaoAlmada/netfabric-angle
Thanks,
Antao
5 Posted by Ilya Finkelshte... on Dec 05, 2016 @ 06:45 PM
@Antao can you please share your configuration in YAML format. This way we can reproduce you issue and help. You can use Settings > Export YAML for this.
--ilya.
6 Posted by antao.almada on Dec 14, 2016 @ 05:51 PM
@ilya Here is the configuration. Thanks
7 Posted by Ilya Finkelshte... on Dec 15, 2016 @ 07:59 AM
Hi Antao,
I wonder if it builds for you locally? For me it started building only if I reverted those this and this line...
--ilya.
8 Posted by antao.almada on Jan 07, 2017 @ 10:07 PM
Hi Ilya,
I'm using VS 2017 RC. Can that be an issue?
Antao
9 Posted by Ilya Finkelshte... on Jan 08, 2017 @ 03:39 AM
Lets verify this theory. Can you please ask to enable experimental VS 2017 build worker image here and try?
--ilya.
10 Posted by antao.almada on Jan 23, 2017 @ 09:50 AM
Hi Ilya,
While working on an unrelated project I run into the same issue and I think I now know its source. When using project.json, MSBuild requires a Microsoft.NuGet.targets extension to get the references to the NuGet packages. This MSBuild extension is located at C:\Program Files (x86)\MSBuild\Microsoft\NuGet and it's imported by C:\Program Files (x86)\MSBuild\14.0\Microsoft.Common.Targets\ImportAfter\Microsoft.NuGet.ImportAfter.targets. These seem to be installed by Visual Studio, not by the framework or NuGet.
This extension is automatically imported by the two last lines of C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets. Notice that it looks for extensions in $(MSBuildExtensionsPath) and $(MSBuildUserExtensionsPath), so I tried a workaround. I added the extension files to my repository and created a MSBuildUserExtensionsPath environment variable pointing to it. Unfortunately it's still not working.
I can't make it work in TeamCity either: https://teamcity-support.jetbrains.com/hc/en-us/community/posts/115...
11 Posted by antao.almada on Jan 23, 2017 @ 01:29 PM
I was using the wrong syntax for the MSBuildUserExtensionsPath environment variable. Now that I set it to %APPVEYOR_BUILD_FOLDER%\tools\MSBuild I get the error message:
C:\projects\netfabric-angle\tools\MSBuild\14.0\Microsoft.Common.targets\ImportAfter\Microsoft.NuGet.ImportAfter.targets(6,3): warning MSB4011: "C:\Program Files (x86)\MSBuild\Microsoft\NuGet\Microsoft.NuGet.targets" cannot be imported again. It was already imported at "C:\Program Files (x86)\MSBuild\14.0\Microsoft.Common.targets\ImportAfter\Microsoft.NuGet.ImportAfter.targets (16,3)". This is most likely a build authoring error. This subsequent import will be ignored. [C:\projects\netfabric-angle\NetFabric.Angle\NetFabric.Angle.csproj]
This means my .targets theory is wrong... :(
12 Posted by antao.almada on Jan 23, 2017 @ 01:56 PM
Returning to the previous state, I noticed that ResolveNuGetPackageAssets is always skipped...
Target "ResolveNuGetPackageAssets" skipped, due to false condition; ('$(ResolveNuGetPackages)' == 'true' and exists('$(ProjectLockFile)')) was evaluated as ('true' == 'true' and exists('project.lock.json')).
13 Posted by Ilya Finkelshte... on Jan 28, 2017 @ 01:08 AM
Could you please provide with instructions/steps you followed to covert from PCL to netstandard? Also does it builds for you locally? And if yes, does it builds with VS or also with
msbuild
command?Ilya Finkelshteyn closed this discussion on Aug 25, 2018 @ 02:14 AM.