Bug 27373 - [iOS] F# Project Template issues - UIWindow and Entitlements.plist
Summary: [iOS] F# Project Template issues - UIWindow and Entitlements.plist
Status: RESOLVED ANSWERED
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: Templates ()
Version: 3.9
Hardware: PC Mac OS
: Normal normal
Target Milestone: 15.6
Assignee: Pierce Boggan [MSFT]
URL:
Depends on:
Blocks:
 
Reported: 2015-02-24 13:52 UTC by Jon Douglas [MSFT]
Modified: 2017-11-03 16:42 UTC (History)
9 users (show)

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

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED ANSWERED

Description Jon Douglas [MSFT] 2015-02-24 13:52:07 UTC
*Description

1. The "new UIWindow(UIScreen.MainScreen.Bounds) call must be in
FinishedLaunching() and not in the AppDelegate's constructor. If it's
done in the constructor, the app does not correctly process device
rotations when it starts in landscape mode.

NOTE: See expected vs. actual below

2. The Entitlements.plist file is missing, but is referred in the fsproj
file: 
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
That causes build errors, as soon a project is compiled for the device.
Simulator just works fine without it.

*Version 
VS 3.9.302

*Expected

namespace Test

open System
open UIKit
open Foundation

[<Register ("AppDelegate")>]
type AppDelegate () =
    inherit UIApplicationDelegate ()

    override val Window = null with get, set

    // This method is invoked when the application is ready to run.
    override this.FinishedLaunching (app, options) =
        this.Window <- new UIWindow (UIScreen.MainScreen.Bounds)
        // If you have defined a root view controller, set it here:
        // this.Window.RootViewController <- new MyViewController ()
        this.Window.MakeKeyAndVisible ()
        true

module Main =
    [<EntryPoint>]
    let main args =
        UIApplication.Main (args, null, "AppDelegate")
        0

*Actual

namespace Test

open System
open UIKit
open Foundation

[<Register ("AppDelegate")>]
type AppDelegate () =
    inherit UIApplicationDelegate ()

    let window = new UIWindow (UIScreen.MainScreen.Bounds)

    // This method is invoked when the application is ready to run.
    override this.FinishedLaunching (app, options) =
        // If you have defined a root view controller, set it here:
        // window.RootViewController <- new MyViewController ()
        window.MakeKeyAndVisible ()
        true

module Main =
    [<EntryPoint>]
    let main args =
        UIApplication.Main (args, null, "AppDelegate")
        0
Comment 1 Jon Douglas [MSFT] 2015-02-24 13:53:47 UTC
*Addendum

The Expected vs. Actual are coming from the latest XS template(Expected) and the VS template(Actual)
Comment 2 Jatin 2015-03-05 00:24:31 UTC
I have reproduced this issue at my end using the latest builds, and have observed that on creating the F# >> iOS Template application the code is appearing as it is mentioned above under the actual. Moreover, the Entitlements.plist file is missing because of which the application is giving build error when try to deploy on the device.

Below is the screencast for the same:
http://www.screencast.com/t/CGFFhqhve0u6

VS Logs: https://gist.github.com/saurabh360/1a8a3c1b7591077fbe2a

Build information:
Microsoft Visual Studio Professional 2013
Version 12.0.31101.00 Update 4
Microsoft .NET Framework
Version 4.5.50938

Installed Version: Professional

LightSwitch for Visual Studio 2013   06177-004-0446016-02538
Microsoft LightSwitch for Visual Studio 2013

Team Explorer for Visual Studio 2013   06177-004-0446016-02538
Microsoft Team Explorer for Visual Studio 2013

Visual Basic 2013   06177-004-0446016-02538
Microsoft Visual Basic 2013

Visual C# 2013   06177-004-0446016-02538
Microsoft Visual C# 2013

Visual C++ 2013   06177-004-0446016-02538
Microsoft Visual C++ 2013

Visual F# 2013   06177-004-0446016-02538
Microsoft Visual F# 2013

Visual Studio 2013 Code Analysis Spell Checker   06177-004-0446016-02538
Microsoft® Visual Studio® 2013 Code Analysis Spell Checker

Portions of International CorrectSpell™ spelling correction system © 1993 by Lernout & Hauspie Speech Products N.V. All rights reserved.

The American Heritage® Dictionary of the English Language, Third Edition Copyright © 1992 Houghton Mifflin Company. Electronic version licensed from Lernout & Hauspie Speech Products N.V. All rights reserved.

Application Insights Tools for Visual Studio Package   1.0
Application Insights Tools for Visual Studio

ASP.NET and Web Tools   12.4.51016.0
Microsoft Web Developer Tools contains the following components:
Support for creating and opening ASP.NET web projects
Browser Link: A communication channel between Visual Studio and browsers
Editor extensions for HTML, CSS, and JavaScript
Page Inspector: Inspection tool for ASP.NET web projects
Scaffolding: A framework for building and running code generators
Server Explorer extensions for Microsoft Azure Websites
Web publishing: Extensions for publishing ASP.NET web projects to hosting providers, on-premises servers, or Microsoft Azure

ASP.NET Web Frameworks and Tools 2012.2   4.1.21001.0
For additional information, visit http://go.microsoft.com/fwlink/?LinkID=309563

ASP.NET Web Frameworks and Tools 2013   5.2.21010.0
For additional information, visit http://www.asp.net/

Common Azure Tools   1.3
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

Microsoft Azure Mobile Services Tools   1.3
Microsoft Azure Mobile Services Tools

NuGet Package Manager   2.8.50926.663
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

Office Developer Tools for Visual Studio 2013 ENU   12.0.30626
Microsoft Office Developer Tools for Visual Studio 2013 ENU

PowerShell Tools   1.3
Provides file classification services using PowerShell

PreEmptive Analytics Visualizer   1.2
Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.

SQL Server Data Tools   12.0.41012.0
Microsoft SQL Server Data Tools

Windows Phone 8.1 SDK Integration   1.0
This package integrates the tools for the Windows Phone 8.1 SDK into the menus and controls of Visual Studio.

Workflow Manager Tools 1.0   1.0
This package contains the necessary Visual Studio integration components for Workflow Manager.

Xamarin   3.9.351.0 (be93f4b)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android   4.20.0.36 (f80d57ea1306ad57646e681a84eb62c5190bcd5f)
Visual Studio plugin to enable development for Xamarin.Android.

Xamarin.iOS   8.6.3.0 (34c31b63e38657488a33b08ea52c233a42570955)
Visual Studio extension to enable development for Xamarin.iOS.

Xamarin.iOS Unified Migration   1.0
Automated migration for Xamarin iOS Classic projects to Unified
Comment 4 Prashant [MSFT] 2017-07-24 10:02:31 UTC
I can confirm using the latest Visual Studio 2017 Preview version 15.3 I am able to reproduce this issue. Marking this report as CONFIRMED. 

Microsoft Visual Studio Enterprise 2017 Preview (15.3)
Version 15.3.0 Preview 4.0
VisualStudio.15.Preview/15.3.0-pre.4.0+26711.1
Microsoft .NET Framework
Version 4.7.02046

Installed Version: Enterprise

Visual Basic 2017   00369-60000-00001-AA051
Microsoft Visual Basic 2017

Visual C# 2017   00369-60000-00001-AA051
Microsoft Visual C# 2017

Visual F# 4.1   00369-60000-00001-AA051
Microsoft Visual F# 4.1

Application Insights Tools for Visual Studio Package   8.8.00629.1
Application Insights Tools for Visual Studio

ASP.NET and Web Tools 2017   15.0.30629.0
ASP.NET and Web Tools 2017

ASP.NET Core Razor Language Services   1.0
Provides languages services for ASP.NET Core Razor.

ASP.NET Template Engine 2017   15.0.30629.0
ASP.NET Template Engine 2017

ASP.NET Web Frameworks and Tools 2017   5.2.50601.0
For additional information, visit https://www.asp.net/

Azure App Service Tools v3.0.0   15.0.30623.0
Azure App Service Tools v3.0.0

Azure Data Lake Node   1.0
This package contains the Data Lake integration nodes for Server Explorer.

Azure Data Lake Tools for Visual Studio   2.2.9000.0
Microsoft Azure Data Lake Tools for Visual Studio

Azure Data Lake Tools for Visual Studio   2.2.9000.0
Microsoft Azure Data Lake Tools for Visual Studio

Common Azure Tools   1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

Fabric.DiagnosticEvents   1.0
Fabric Diagnostic Events

JavaScript Language Service   2.0
JavaScript Language Service

Merq   1.1.17-rc (cba4571)
Command Bus, Event Stream and Async Manager for Visual Studio extensions.

Microsoft Azure HDInsight Azure Node   2.2.9000.0
HDInsight Node under Azure Node

Microsoft Azure Hive Query Language Service   2.2.9000.0
Language service for Hive query

Microsoft Azure Stream Analytics Language Service   2.2.9000.0
Language service for Azure Stream Analytics

Microsoft Azure Stream Analytics Node   1.0
Azure Stream Analytics Node under Azure Node

Microsoft Azure Tools   2.9
Microsoft Azure Tools for Microsoft Visual Studio 2017 - v2.9.50628.2

Microsoft Continuous Delivery Tools for Visual Studio   0.3
Simplifying the configuration of continuous build integration and continuous build delivery from within the Visual Studio IDE.

Microsoft JVM Debugger   1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Microsoft MI-Based Debugger   1.0
Provides support for connecting Visual Studio to MI compatible debuggers

Mono Debugging for Visual Studio   4.6.8-pre (ec7034f)
Support for debugging Mono processes with Visual Studio.

NuGet Package Manager   4.3.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

SQL Server Data Tools   15.1.61702.140
Microsoft SQL Server Data Tools

ToolWindowHostedEditor   1.0
Hosting json editor into a tool window

TypeScript   2.3.4.0
TypeScript tools for Visual Studio

Visual Studio Code Debug Adapter Host Package   1.0
Interop layer for hosting Visual Studio Code debug adapters in Visual Studio

WebJobs Tools v1.0.0   __RESXID_PRODUCTVERSION__
WebJobs Tools v1.0.0

Xamarin   4.6.0.289 (9b1a9b2)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android SDK   7.4.0.15 (a93c6f4)
Xamarin.Android Reference Assemblies and MSBuild support.

Xamarin.iOS and Xamarin.Mac SDK   10.12.0.14 (bf350ba)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.
Comment 5 Pierce Boggan [MSFT] 2017-11-03 16:42:00 UTC
Hey Jon!

I've moved this issue over to VSTS for further tracking:
https://devdiv.visualstudio.com/DevDiv/_workitems/edit/519626

If you're interested in continuing to follow the status of this issue, please click the 'Follow' button on the bug in VSTS. In the future, please feel free to file bugs via aka.ms/xvs-bug, which feeds into our new bug tracker in VSTS.

Thanks again for reporting this issue! <3

Pierce Boggan