msbuild: dotnet does not generate fsproj.metaproj file, but build process seems to require it

From @colinbowern on June 25, 2017 20:45

Steps to reproduce

  1. Install .NET Core on WSL Bash per the .NET Core Step-by-Step instructions
  2. Run through steps to get started with F# on the CLI through to completing “Writing a Class Library” on the Get started with F# with the .NET CLI documentation
  3. Run “dotnet build”

Expected behavior

Class library compiles

Actual behavior

Failed with error MSB4025: The project file could not be loaded. Could not find file '/mnt/c/Users/colinb/Projects/TestProject/src/Library/Library.fsproj.metaproj

No tooling along the way creates a metaproj file. This file does not exist.

Environment data

dotnet --info output:

.NET Command Line Tools (1.0.4)

Product Information: Version: 1.0.4 Commit SHA-1 hash: af1e6684fd

Runtime Environment: OS Name: ubuntu OS Version: 16.04 OS Platform: Linux RID: ubuntu.16.04-x64 Base Path: /usr/share/dotnet/sdk/1.0.4

Copied from original issue: dotnet/cli#7000

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 22 (8 by maintainers)

Commits related to this issue

Most upvoted comments

I was also having this problem when I noticed that when the project was added to the solution file it got added as hello\hello.fsproj instead of hello/hello.fsproj. After manually changing this I was able to build from the sln.

As above, switched \ to / in my .sln solved this.

I just ran into this and can confirm that switching .sln project references from \ to / fixed it. How bizarre.

Here is my Travis build before: https://travis-ci.org/hedgehogqa/fsharp-hedgehog/builds/338361850 Here it is after: https://travis-ci.org/hedgehogqa/fsharp-hedgehog/builds/338379628

Switch from \ to / in the .sln solved for me, but i try another way and removed ProjectDependencies from .sln file for projects. You can find like this in your .sln file: ProjectSection(ProjectDependencies) = postProject

after this .sln file successfull build with both variant of paths on unix and windows (i think, what \ is more correct variant).

Hmm…something strange just happened. I tried to recreate the .sln file a second time using SDK2 and deleting the obj/ and bin/ folders in the project folder and then doing dotnet restore and dotnet build and now it works. I don’t know why recreating the .sln file did not help the first time.