A project generated with the .NET Core 2.0 SDK dotnet new console -lang F# won't build under mono's msbuild, instead getting the error:
/usr/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(2646,7): error MSB4057: The target "CreateManifestResourceNames" does not exist in the project.
This worked with the old SDK, so I suspect there is some different behavior with the bundled F# SDK.
Provide the steps required to reproduce the problem
Create a new F# console project: dotnet new console -lang F#
Attempt to restore and build with the mono SDK: msbuild /t:Restore && msbuild /t:Build /p:EnableDefaultCompileItems=false
Example Dockerfile with stage for each of the above steps.
Project restores and builds successfully under mono.
Restore succeeds, but build fails on target CreateManifestResourcesNames:
/usr/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(2701,7): error MSB4057: The target "CreateManifestResourceNames" does not exist in the project. [/build/sample.fsproj]
Done Building Project "/build/sample.fsproj" (Build target(s)) -- FAILED.
None.
Provide any related information
It's working fine with Mono 5.4.0.199/ OSX - https://gist.github.com/nosami/67457807ef29fcce3e41e16ffea2c5a4
@ninjarobot can you confirm that this works for you with Mono 5.4.0.199? I suspect this to be an issue with previous mono based on @nosami's comment
Thanks @cartermp @nosami - to keep you posted:
I'm building 5.4.0.199 from source now, as the latest working packages and Docker image are all 5.2 (the beta Debian package for 5.4.0.199 has dependency issues).
Then I will hopefully get msbuild to install without requiring I also install a mono package.
@nosami I managed to get msbuild installed with the 5.4.0.199 beta packages, but msbuild 15.3 fails with a BadImageFormatException. Gist with Dockerfile on latest beta mono.
Still building mono from source...
I used msbuild 15.4 from this commit https://github.com/mono/msbuild/commit/f296e67b
and fsharp/fsharp 4.1.25 with a couple of patches (see https://github.com/mono/mono/blob/2017-06/packaging/MacSDK/fsharp.py to see how F# is packaged for OSX. Branch 2017-06 corresponds to the 15.4 release). I imagine you would need this patch.
If you don't want to patch, you can probably build fsharp/fsharp from this commit https://github.com/fsharp/fsharp/pull/783/commits/066a39a0ccd98222a0e372a443e59e28182def50
Thanks @nosami I was able to build this newer FSharp and msbuild and can confirm this is working. I can't really convert CI jobs to use this flow, and will hold off until GA releases. Thanks for all the details to where changes were made to get this support.
Any idea when the GA is for mono 5.4 and @dsyme when would another fsharp release be cut with these SDK enhancements? Is it on the order of weeks or months?
I seem to remember @directhex mentioning that Debian/Ubuntu packages need to be built from a tagged release.
We don't have that restriction on OSX.
@nosami @ninjarobot I just tagged 4.1.26 in the fsharp repo
The 4.1.28 release built on beta mono 5.4 still hits the same issue.
@ninjarobot: I would expect that to work. You're probably hitting an msbuild issue now (too old, maybe)
@dsyme, @nosami, and @cartermp, I tested with mono 5.4 and msbuild 15.5 now that it's GA and a .NET Core 2.0 SDK fsproj builds just fine now. I'm closing this issue.
Glad to hear it!
On Thu, Oct 26, 2017, at 11:34 AM, Dave Curylo wrote:
@dsyme[1], @nosami[2], and @cartermp[3], I tested with mono 5.4 and
msbuild 15.5 now that it's GA and a .NET Core 2.0 SDK fsproj builds
just fine now. I'm closing this issue.> — You are receiving this because you were mentioned. Reply to this
email directly, view it on GitHub[4], or mute the thread[5].>
Links:
Most helpful comment
@nosami @ninjarobot I just tagged 4.1.26 in the fsharp repo