dotnet / pinvoke

A library containing all P/Invoke code so you don't have to import it every time. Maintained and updated to support the latest Windows OS.
MIT License
2.12k stars 222 forks source link

Enabling the build script to run on Linux and Windows #319

Closed arlm closed 6 years ago

arlm commented 7 years ago

NOTE: Must have mono, .NET Core and PowerShell properly installed on the machine

This is to start the effort and discussions on how to make it work on Visual Studio for MacOS and Linux command-line.

arlm commented 7 years ago

Right now it cannot use the .NET SDK msbuild scripts:

$ ./build.ps1 -Restore

Restoring NuGet packages...                                                     
Build started 3/15/2017 9:58:41 PM.
  Project "/Volumes/data/git/pinvoke/src/Windows.Core/Windows.Core.csproj" on node 1
(restore target(s)).
  /Volumes/data/git/pinvoke/src/Windows.Core/Windows.Core.csproj : error MSB4019:
 The imported project "/Library/Frameworks/Mono.framework/Versions/4.8.0/lib/mono/msbuild/15.0
/bin/Sdks/Microsoft.NET.Sdk/Sdk/Sdk.props" was not found. Confirm that the path in the <Import>
declaration is correct, and that the file exists on disk.
 Done Building Project "/Volumes/data/git/pinvoke/src/Windows.Core/Windows.Core.csproj"
(restore target(s)) -- FAILED.

Build FAILED.

I guess that I adding reference to the NuGet Microsoft.NET.Sdk package would solve the problem, but when I tried to add it on Windows.Core.csproj:

<ItemGroup>
    <PackageReference Include="Microsoft.NET.Sdk" Version="1.0.0-alpha-20161104-2" />
</ItemGroup>

I started getting this error on nuget restore:

nuget restore Windows.Core/Windows.Core.csproj  -Verbosity detailed
NuGet Version: 3.5.0.1996
Nothing to do. This project does not specify any packages for NuGet to restore.

For the PackageReference tag to work, instead of using package.json, one must use NuGet 4.0 and also wait for the resolution of this bug: NuGet/Home#4532 (got to it through NuGet/Home#4804)

arlm commented 7 years ago

Also Visual Studio for macOS Preview 4 (7.0 build 1566) running on Mono 4.8.0 (mono-4.8.0-branch/e4a3cf3) (64-bit) and Mac OS X 10.12.2 hits null objects when trying to restore the NuGet packages from the project. I opened a bug through the Help > Report a Problem menu stating that and explaining how to reproduce and citing this repository. Let's see how efficient Microsoft macOS Visual Studio team can be, I have no idea on what to expect from this bug.

---> (Inner Exception #0) System.NullReferenceException: Object reference not set to an instance of an object
  at MonoDevelop.PackageManagement.PackageSpecCreator.GetProjectRestoreReference (MonoDevelop.Projects.ProjectReference item, MonoDevelop.PackageManagement.IDotNetProject project) [0x0001f] in /Users/builder/data/lanes/4533/2f11ef3c/source/monodevelop/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageSpecCreator.cs:165 
  at MonoDevelop.PackageManagement.PackageSpecCreator+<AddProjectReferences>c__AnonStorey0.<>m__0 (MonoDevelop.Projects.ProjectReference projectReference) [0x00000] in /Users/builder/data/lanes/4533/2f11ef3c/source/monodevelop/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageSpecCreator.cs:126 
  at System.Linq.Enumerable+WhereSelectEnumerableIterator`2[TSource,TResult].MoveNext () [0x00064] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/System.Core/System/Linq/Enumerable.cs:285 
  at MonoDevelop.PackageManagement.PackageSpecCreator.AddProjectReferences (NuGet.ProjectModel.PackageSpec spec, MonoDevelop.PackageManagement.IDotNetProject project) [0x00151] in /Users/builder/data/lanes/4533/2f11ef3c/source/monodevelop/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageSpecCreator.cs:142 
  at MonoDevelop.PackageManagement.PackageSpecCreator.CreatePackageSpec (MonoDevelop.PackageManagement.IDotNetProject project) [0x00042] in /Users/builder/data/lanes/4533/2f11ef3c/source/monodevelop/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageSpecCreator.cs:50 
  at MonoDevelop.PackageManagement.PackageSpecCreator.CreatePackageSpec (MonoDevelop.Projects.DotNetProject project) [0x00000] in /Users/builder/data/lanes/4533/2f11ef3c/source/monodevelop/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageSpecCreator.cs:39 
  at MonoDevelop.PackageManagement.DotNetCoreNuGetProject.CreateProjectPackageSpec (MonoDevelop.Projects.DotNetProject project) [0x00000] in /Users/builder/data/lanes/4533/2f11ef3c/source/monodevelop/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/DotNetCoreNuGetProject.cs:234 
  at MonoDevelop.PackageManagement.DotNetCoreNuGetProject.<CreateProjectPackageSpec>m__3 () [0x00000] in /Users/builder/data/lanes/4533/2f11ef3c/source/monodevelop/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/DotNetCoreNuGetProject.cs:228 
  at MonoDevelop.Core.Runtime+<RunInMainThread>c__AnonStorey1`1[T].<>m__0 (System.Object ) [0x00000] in /Users/builder/data/lanes/4533/2f11ef3c/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Core/Runtime.cs:356 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:143 
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00047] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:187 
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x0002e] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:156 
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x0000b] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:128 
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:357 
  at MonoDevelop.PackageManagement.DotNetCoreNuGetProject+<CreateProjectPackageSpec>c__async3.MoveNext () [0x00021] in /Users/builder/data/lanes/4533/2f11ef3c/source/monodevelop/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/DotNetCoreNuGetProject.cs:228 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:143 
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00047] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:187 
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x0002e] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:156 
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x0000b] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:128 
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:357 
  at MonoDevelop.PackageManagement.DotNetCoreNuGetProject+<GetPackageSpecsAsync>c__async2.MoveNext () [0x00058] in /Users/builder/data/lanes/4533/2f11ef3c/source/monodevelop/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/DotNetCoreNuGetProject.cs:206 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:143 
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00047] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:187 
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x0002e] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:156 
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x0000b] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:128 
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:357 
  at NuGet.PackageManagement.DependencyGraphRestoreUtility+<GetSolutionRestoreSpec>d__8.MoveNext () [0x0013e] in <672446b5ceaf4ce691b6de54637346a4>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:143 
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00047] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:187 
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x0002e] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:156 
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x0000b] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:128 
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:357 
  at NuGet.PackageManagement.DependencyGraphRestoreUtility+<PreviewRestoreAsync>d__4.MoveNext () [0x00084] in <672446b5ceaf4ce691b6de54637346a4>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:143 
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00047] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:187 
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x0002e] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:156 
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x0000b] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:128 
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:357 
  at NuGet.PackageManagement.DependencyGraphRestoreUtility+<RestoreProjectAsync>d__5.MoveNext () [0x0013c] in <672446b5ceaf4ce691b6de54637346a4>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:143 
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00047] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:187 
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x0002e] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:156 
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x0000b] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:128 
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:357 
  at MonoDevelop.PackageManagement.MonoDevelopBuildIntegratedRestorer+<RestorePackagesInternal>c__async2.MoveNext () [0x00064] in /Users/builder/data/lanes/4533/2f11ef3c/source/monodevelop/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelopBuildIntegratedRestorer.cs:135 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:143 
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00047] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:187 
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x0002e] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:156 
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x0000b] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:128 
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:357 
  at MonoDevelop.PackageManagement.MonoDevelopBuildIntegratedRestorer+<RestorePackages>c__async0.MoveNext () [0x000b8] in /Users/builder/data/lanes/4533/2f11ef3c/source/monodevelop/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelopBuildIntegratedRestorer.cs:88 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:143 
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00047] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:187 
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x0002e] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:156 
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x0000b] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:128 
  at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:113 
  at MonoDevelop.PackageManagement.RestoreNuGetPackagesAction+<ExecuteAsync>c__async0.MoveNext () [0x00116] in /Users/builder/data/lanes/4533/2f11ef3c/source/monodevelop/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RestoreNuGetPackagesAction.cs:131 <---
AArnott commented 7 years ago

For the PackageReference tag to work, instead of using package.json, one must use NuGet 4.0

package.json is an NPM package file. Did you mean project.json which we don't use any more?

AArnott commented 7 years ago

I take it you don't mean for this PR to be completed yet, as it's a work in progress. Is that right?

Also, have you tried using the dotnet CLI? It won't find all the packages (for net20 for example), but if you use the -f switch you may be able to build the netstandard1.1 profile.

arlm commented 7 years ago

Yes, I meant project.json. I know we don't use anymore, but unfortunately NuGet still requires the old formats. I don't know on Windows, but NuGet 4.0 is not ready for macOS yet.

I intended to get out and working on VS for macOS, but it seems there are things to wait on other projects in order to be able to compile on this platform.

I'll try the dotnet CLI tomorrow.

I take it you don't mean for this PR to be completed yet, as it's a work in progress. Is that right?

Yes, let's use it to track the necessary changes to have it compiling on non-Windows platforms.

AArnott commented 7 years ago

As far as the goal of building on non-Windows, I can see two benefits here:

  1. developers can contribute to the library who don't use Windows
  2. We could eventually support p/invoke libraries for non-Windows binaries.

What I don't see ever happening is us shipping what we build on non-Windows because I don't think non-Windows platforms will ever support building the full package including net20 (unless mono eventually supports that).

AArnott commented 7 years ago

BTW, I don't know that any version of nuget.exe will work with the new PackageReference items, if that's what you're hoping for. The new references are fairly deeply built into msbuild now. And xbuild isn't seeing much investment from what I gather. So I think your best bet is Msbuild Core (which works for this) via the dotnet CLI.

arlm commented 7 years ago

As far as I know xbuild is not used anymore. Mono 4.x+ uses msbuild and has been running swiftly. About the NuGet, I understood from NuGet/Home#4532 that the 4.0 version has this support or may have it...

arlm commented 7 years ago

Look here:

@rrleya: Need to review with RoslynProjectSystem team, but great fix for 4.0.1

and here:

@zhili1208: this fix didn't make the release, VS will not pickup the fix when nuget 4.0.1 release, but next VS will release with nuget 4.0.1, VS release will pick up this fix.

arlm commented 7 years ago

Well, @mward, from Microsoft, took time to review my report and stated two things:

  1. Visual Studio for Mac does not support multi targeting right now. I already went to uservoice and filed a request for this feature, if any of you guys can vote there, it would be great.
  2. Visual Studio for Mac is case sensible, so file names and path names on references should be exactly as it it on git. He has opened our project and used our solution, so he has sent me a patch, which I applied on this branch.

After @mward patch now I could restore the NuGet packages on Visual Studio and he stated that the null pointer error fix will be deployed on the next version!

Right now, Visual Studio for Mac, when using this branch, simply closes when our solution is loaded. I'll see how can I file another report and reproduce it do go further on this journey. Using MSBuild, PowerShell and .NET Core on macOS still throws for me the .NET SDK not found error. I'll try to identify if the problem is on MSBuild or .NET Core to file a bug report.

AArnott commented 6 years ago

Closing due to inactivity.