Bug 10540 - Visual Studio crash when opening project
Summary: Visual Studio crash when opening project
Status: VERIFIED FIXED
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: iOS ()
Version: 0.x Insider Preview
Hardware: PC Mac OS
: Normal normal
Target Milestone: 1.2.x
Assignee: Dominique Louis
URL:
Depends on:
Blocks:
 
Reported: 2013-02-21 11:57 UTC by Allie Miller
Modified: 2013-06-24 22:58 UTC (History)
8 users (show)

Tags:
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:
VERIFIED FIXED

Description Allie Miller 2013-02-21 11:57:07 UTC
I update Mono for Android Pro and Monotouch Pro to Xamarin Windows.

I try to use Xamarin.iOS for Visual Studio.
But Visual Studio crash at Open Solutionfile.

For example,
I create new project from "Empty Project" iOS Template.
When it create, it seem run correctly.
(it can build and run remote Mac and iPhone emulater)

But close the solution and open it again,
VisualStuio tell me "wrong Framework Version and set it Ver.1.0."
and repeat project re-open and crash.

I open .csproj file directly by TextEditor,
it seem append follow line everytime
<TargetFrameworkVersion>v1.0</TargetFrameworkVersion>
<TargetFrameworkProfile />

Windows 7 Ultimate SP1 (64bit)
Visual Studio 2010 Professional SP1
Xamarin for Windows
(VSMonoTouch1.0)
Mac mini 2GB(MacOS 10.7.5)
Xamarin for Mac
Xcode 4.6
Comment 2 Dominique Louis 2013-06-03 16:37:52 UTC
Should be fixed in latest master.
Comment 3 Dominique Louis 2013-06-03 16:38:30 UTC
Should be fixed in latest master.
Comment 4 Atin 2013-06-04 06:55:46 UTC
Today , we have checked this issue with following:

All windows
VS 2010/2012
MTVS 1.2.109
MT 6.2.6.6

Now it is working fine ,Visual studio does not get crashed after running existing Empty ios project. Hence marking this as Verified Fixed.
Comment 5 Dave Morris 2013-06-23 11:26:02 UTC
I am still experiencing this issue, and I am on the latest Beta of Xamarin Android and iOS. What can I do to fix this?
Comment 6 Dave Morris 2013-06-23 23:12:19 UTC
To elaborate on my issue a bit more. I know for sure that this crash is caused by opening Xamarin.iOS .csproj files, and more specifically, if I clear out EVERYTHING from the csproj file except for the top PropertyGroup node, it still crashes. Here is what that node looks like. Notice the TargetFrameworkProfile is empty, and there is not TargetFrameworkVersion node. Visual Studio 2012 adds this as it is opening the file, and then it crashes. Subsequent attempts to open VS2012 also cause it to crash, even when there is nothing else in the project file.

<PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">iPhoneSimulator</Platform>
    <ProductVersion>10.0.0</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{2C82D06B-7B3C-46ED-8E00-4E053773E2FC}</ProjectGuid>
    <ProjectTypeGuids>{6BC8ED88-2882-458C-8E55-DFD12B67127B};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
    <OutputType>Exe</OutputType>
    <RootNamespace>BBP.iOS</RootNamespace>
    <IPhoneResourcePrefix>Resources</IPhoneResourcePrefix>
    <AssemblyName>BBPiOS</AssemblyName>
    <ReleaseVersion>1.0</ReleaseVersion>
    <TargetFrameworkProfile />
</PropertyGroup>
Comment 7 PJ 2013-06-24 11:03:44 UTC
Hey Dave,

In a private comment on this bug, a developer noted that this behavior may have been caused by having an older third party VS for MonoTouch extension installed, in this case VSMonoTouch.

Any chance you have one of those installed?
Comment 8 Dave Morris 2013-06-24 11:43:04 UTC
I looked through the registry and found an instance of VSMonoTouch. Once I removed it from the file system and from the registry and restarted VS2012, the project opens without crashing.

However, VS2012 now does not recognize the iOS project as a valid project. Any ideas why that might be happening? It says that it's incompatible.
Comment 9 PJ 2013-06-24 11:51:38 UTC
So I have to say as the first thing that I can't of course recommend any sort of registry editing, and to always make a backup before editing anything there. It's possible you may have still been able to uninstall the VSMonoTouch extension from VS 'Extensions and Updates' or from Windows' 'Add and Remove Programs'. 

That being said,  you may also want to try uninstalling and re-installing the Xamarin iOS extension, as the project types get registered during installation. 

If that does not work, I would restore your registry to the backup you took (hopefully) and uninstall through the regular channels, then try installing our VS extension again.

Hopefully we can get you up and running!  If all else fails I would also send a mail over to support@xamarin.com and they will be able to do a more in-depth look at what might still be the problem after the steps described above.
Comment 10 Marek Habersack 2013-06-24 16:10:21 UTC
It might also be necessary to open the Visual Studio 2012 prompt as administrator and run:

devenv /setup

after removing the add-in. It is also recommended that you reinstall both Xamarin extensions after the above step is completed.
Comment 11 Dave Morris 2013-06-24 22:58:35 UTC
Thanks, that seems to have worked for me! Thank you so much for the help!!