Bug 59072 - Template "Blank Forms App (F#)" only builds for new projects, not for existing ones
Summary: Template "Blank Forms App (F#)" only builds for new projects, not for existin...
Status: VERIFIED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: F# Add-in (show other bugs)
Version: 7.1 (d15-3)
Hardware: PC Mac OS
: High normal
Target Milestone: 15.5
Assignee: Jason Imison
URL:
Depends on:
Blocks:
 
Reported: 2017-08-27 11:56 UTC by Andres G. Aragoneses
Modified: 2017-10-17 08:08 UTC (History)
5 users (show)

See Also:
Tags:
Is this bug a regression?: ---
Last known good build:


Attachments

Description Andres G. Aragoneses 2017-08-27 11:56:01 UTC
Using Visual Studio for Mac 7.1 build 1297

Testcase that works:
0. Open VSforMac
1. Click on 'New project...' button
2. Choose Multiplatform -> App -> 'Blank Forms App (F#)' template, click on Next
3. App: foo
4. Shared code: choose "Use Shared Library"
5. Leave "Use XAML for user interface files" enabled
6. Click on Next
7. Project name: Foo
8. Solution name: Foo
9. Leave Location as the proposed text "/Users/username/Projects"
10. Leave the next checkboxes enabled as default.
11. Build the iOS project.
Current results: it builds, no errors.

Testcase that has a bug:
0. Open VSforMac
1. Click on 'New project...' button
2. Choose Other -> .NET -> 'Console Project (F#)' template, click on Next
3. Project name: Foo
4. Solution name: Foo
5. Leave Location as the proposed text "/Users/username/Projects"
6. Leave the next checkboxes enabled as default.
7. Right click in solution item 'Foo' -> Add -> Add new project...
8. Choose Multiplatform -> App -> 'Blank Forms App (F#)' template, click on Next
9. App: foo
10. Shared code: choose "Use Shared Library"
11. Leave "Use XAML for user interface files" enabled
10. Click on Next
11. Project name: FooGui
12. Click Next
13. Build the iOS project.
Current results: solution doesn't build, there is 1 compiler error:

/Users/andres/Projects/Foo/iOS/AppDelegate.fs(35,35): Error FS0039: The namespace or module 'Foo' is not defined. Maybe you want one of the following:   FooGui (FS0039) (FooGui.iOS)

Expected results: project builds, no errors.
Comment 1 Lluis Sanchez 2017-09-27 16:32:07 UTC
Fixed in 15.5.
Comment 2 Gaurav Ganorkar 2017-10-04 14:34:48 UTC
Verified bug on following configuration and unable to build project. Getting build errors.

Version 7.3 Preview (7.3 build 648)
Mono 5.4.0.203 (2017-06/0dd35e9d647) (64-bit)
Xamarin.iOS Version: 11.4.0.67 (Visual Studio Enterprise)
Xamarin.Android Version: 8.1.0.19 (Visual Studio Enterprise)
Xamarin.Mac Version: 4.0.0.67 (Visual Studio Enterprise)
Apple Developer Tools Xcode 9.0 (13247)

Build Taken From:
https://code.internalx.com/Wrench/BuildDetails?buildId=7a9c15e59c6279fb8126a3dfb16a4831

Screencast:
https://www.screencast.com/t/rFyqQw2fJ3

Steps Performed:
0. Open VSforMac
1. Click on 'New project...' button
2. Choose Other -> .NET -> 'Console Project (F#)' template, click on Next
3. Project name: Foo
4. Solution name: Foo
5. Leave Location as the proposed text "/Users/username/Projects"
6. Leave the next checkboxes enabled as default.
7. Right click in solution item 'Foo' -> Add -> Add new project...
8. Choose Multiplatform -> App -> 'Blank Forms App (F#)' template, click on Next
9. App: foo
10. Shared code: choose "Use Shared Library"
11. Leave "Use XAML for user interface files" enabled
10. Click on Next
11. Project name: FooGui
12. Click Next
13. Build the iOS project.

Still Getting build errors while building app. IDE Logs attached for reference.

Build OutPut:
https://gist.github.com/neerajdeshmukh/aeecc4c4d58f0dc9a044869c5f2dc0c3

IDE Logs:
https://gist.github.com/neerajdeshmukh/a665c3303a2bdb52b04adba15d56c1e2

Errors:
https://gist.github.com/neerajdeshmukh/f89b03dff5d1e67e5158311b667f190e

Just to update , I have tried building Fsharp project FormsFSharpXaml from QualityAssurance Repo, it build successfully. Getting build errors with mentioned steps.
Comment 3 Jason Imison 2017-10-05 09:21:10 UTC
Looking at the error log posted above, there were lots of msbuild evaluation issues such as 

```
ERROR: System.Exception: MSBuild operation failed ---> System.InvalidOperationException: An equivalent project (a project with the same global properties and tools version) is already present in the project collection, with the path "/Users/globallogic/Projects/foo/iOS/FooGui.iOS.fsproj". To load an equivalent into this project collection, unload this project first.
  at Microsoft.Build.Shared.ErrorUtilities.ThrowInvalidOperation (System.String resourceName, System.Object[] args) [0x00007] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/msbuild-15.4/src/Shared/ErrorUtilities.cs:304 
  at Microsoft.Build.Evaluation.ProjectCollection+LoadedProjectCollection.AddProject (Microsoft.Build.Evaluation.Project project) [0x00066] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/msbuild-15.4/src/Build/Definition/ProjectCollection.cs:2415 
  at Microsoft.Build.Evaluation.ProjectCollection.AfterUpdateLoadedProjectGlobalProperties (Microsoft.Build.Evaluation.Project project) [0x00048] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/msbuild-15.4/src/Build/Definition/ProjectCollection.cs:1497 
  at Microsoft.Build.Evaluation.Project.SetGlobalProperty (System.String name, System.String escapedValue) [0x00068] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/msbuild-15.4/src/Build/Definition/Project.cs:1699 
  at MonoDevelop.Projects.MSBuild.ProjectBuilder.ConfigureProject (System.String file, System.String configuration, System.String platform, System.String slnConfigContents) [0x00171] in /Users/builder/data/lanes/5531/4277500c/source/monodevelop/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/ProjectBuilder.v4.0.cs:207 
  at MonoDevelop.Projects.MSBuild.ProjectBuilder.SetupProject (MonoDevelop.Projects.MSBuild.ProjectConfigurationInfo[] configurations) [0x0001a] in /Users/builder/data/lanes/5531/4277500c/source/monodevelop/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/ProjectBuilder.v4.0.cs:148 
  at MonoDevelop.Projects.MSBuild.ProjectBuilder+<>c__DisplayClass4_0.<Run>b__0 () [0x00006] in /Users/builder/data/lanes/5531/4277500c/source/monodevelop/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/ProjectBuilder.v4.0.cs:68 
  at MonoDevelop.Projects.MSBuild.BuildEngine.STARunner () [0x0001c] in /Users/builder/data/lanes/5531/4277500c/source/monodevelop/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.MSBuild.Shared/BuildEngine.Shared.cs:320 
   --- End of inner exception stack trace ---
  at MonoDevelop.Projects.MSBuild.BuildEngine.RunSTA (System.Int32 taskId, System.Threading.ThreadStart ts) [0x00140] in /Users/builder/data/lanes/5531/4277500c/source/monodevelop/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.MSBuild.Shared/BuildEngine.Shared.cs:307 
  at MonoDevelop.Projects.MSBuild.ProjectBuilder.Run (MonoDevelop.Projects.MSBuild.ProjectConfigurationInfo[] configurations, MonoDevelop.Projects.MSBuild.IEngineLogWriter logWriter, MonoDevelop.Projects.MSBuild.MSBuildVerbosity verbosity, System.String[] runTargets, System.String[] evaluateItems, System.String[] evaluateProperties, System.Collections.Generic.Dictionary`2[TKey,TValue] globalProperties, System.Int32 taskId) [0x0006e] in /Users/builder/data/lanes/5531/4277500c/source/monodevelop/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/ProjectBuilder.v4.0.cs:64 
  at MonoDevelop.Projects.MSBuild.BuildEngine.RunProject (MonoDevelop.Projects.MSBuild.RunProjectRequest msg) [0x00041] in /Users/builder/data/lanes/5531/4277500c/source/monodevelop/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.MSBuild.Shared/BuildEngine.Shared.cs:212 
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00032] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/corlib/System.Reflection/MonoMethod.cs:305 
```

This is an unrelated issue. I repeated the steps above 3 times without problem.
Comment 4 Neeraj Deshmukh 2017-10-05 11:58:10 UTC
Verified issue with mentioned steps at comment  1 and it worked fine now
Screencast: https://www.screencast.com/t/8CxFhyOx5
Build Info: https://gist.github.com/neerajdeshmukh/d283ad931b648bf2d6d9b741df24ef46

Hence marking as Issue as Resolved - Fixed again. 
Will be marking as Verified after verifying again at release branch for 15.5.
Comment 5 Neeraj Deshmukh 2017-10-17 08:08:11 UTC
Verified with following build configuration
Visual Studio Community 2017 for Mac (Preview)
Version 7.3 Preview (7.3 build 710)
Installation UUID: 8f724ef7-6cbf-40ca-8af8-b7d44b08e9c6
Runtime:
	Mono 5.4.1.4 (2017-06/c6605763a36) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

Complete Build Info:
https://gist.github.com/neerajdeshmukh/7bb4027a654665aff2f1b34f1f5cb985

Working fine as per comment 2, hence marking as Verified.

Note You need to log in before you can comment on or make changes to this bug.