Bug 20959 - Linking files to shared project makes project unusable
Summary: Linking files to shared project makes project unusable
Status: VERIFIED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Project Model ()
Version: 5.0.1
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: 5.2
Assignee: Lluis Sanchez
URL:
Depends on:
Blocks:
 
Reported: 2014-06-27 16:57 UTC by Jens
Modified: 2014-07-04 12:03 UTC (History)
4 users (show)

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


Attachments
example, which shows the problem (4.39 KB, application/zip)
2014-06-27 16:57 UTC, Jens
Details


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 or GitHub 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 Jens 2014-06-27 16:57:00 UTC
Created attachment 7226 [details]
example, which shows the problem

If you link a file to a shared project and open it again, you get an error message "Error while trying to load the project "xxx.shproj": value

How to reproduce:

please use the attached example file and open it. See that everything just works fine :)

1. go to the shared project "ShowXamarinBug".
2. Make right-click at the project -> Add -> Add Files
3. chose the file TestFile -> Program.cs and click "Open"
4. chose "Add a link to the file"
5. as you can see, everything seems to work fine. You can just go to the linked file and open it.
6. now make File -> Close solution
7. open the project again
8. you get a popup "Error while trying to load the project "xxx.shproj: value"

This makes it very difficult to use Xamarin and should be fixed ASAP :(

More infos:
this might be related to bug 20571

my installed system:

Xamarin Studio
Version 5.0.1 (build 3)
Installation UUID: ef46ec6d-cbfa-4264-bb42-00cdaa25736e
Runtime:
	Mono 3.4.0 ((no/954ed3c)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 304000214

Xamarin.Android
Version: 4.12.5 (Business Edition)
Android SDK: /Users/jens-uwe/Downloads/Programme/android-sdk-macosx
	Supported Android versions:
		2.1   (API level 7)
		2.2   (API level 8)
		2.3   (API level 10)
		3.1   (API level 12)
		4.0   (API level 14)
		4.0.3 (API level 15)
		4.1   (API level 16)
		4.2   (API level 17)
		4.3   (API level 18)
		4.4   (API level 19)
Java SDK: /usr
java version "1.7.0_25"
Java(TM) SE Runtime Environment (build 1.7.0_25-b15)
Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)

Apple Developer Tools
Xcode 5.1.1 (5085)
Build 5B1008

Xamarin.iOS
Version: 7.2.4.4 (Business Edition)
Hash: 5485ac2
Branch: 
Build date: 2014-06-11 13:44:48-0400

Xamarin.Mac
Xamarin.Mac: Not Installed

Build Information
Release ID: 500010003
Git revision: f94ee866936d25105704eb63728ad5a981eda0a4
Build date: 2014-06-04 12:19:12-04
Xamarin addins: 1a6044e8321ea07e03a56b5381951686c82fed8b

Operating System
Mac OS X 10.9.3
Darwin Jens-Uwes-MacBook-Pro-2.local 13.2.0 Darwin Kernel Version 13.2.0
    Thu Apr 17 23:03:13 PDT 2014
    root:xnu-2422.100.13~1/RELEASE_X86_64 x86_64
Comment 1 Matt Crombie 2014-06-27 21:00:12 UTC
I'm getting the same issue with this error -

System.ArgumentException: value
  at MonoDevelop.Projects.ProjectFile.set_Link (FilePath value) [0x00082] in /Users/builder/data/lanes/886/f94ee866/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectFile.cs:278 
  at MonoDevelop.Projects.Formats.MSBuild.MSBuildProjectHandler.ReadProjectFile (MonoDevelop.Core.Serialization.DataSerializer ser, MonoDevelop.Projects.Project project, MonoDevelop.Projects.Formats.MSBuild.MSBuildItem buildItem, System.Type type) [0x001f3] in /Users/builder/data/lanes/886/f94ee866/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildProjectHandler.cs:1881 
  at MonoDevelop.Projects.Formats.MSBuild.MSBuildProjectHandler.ReadItem (MonoDevelop.Projects.Formats.MSBuild.MSBuildSerializer ser, MonoDevelop.Projects.Formats.MSBuild.MSBuildItem buildItem) [0x0035e] in /Users/builder/data/lanes/886/f94ee866/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildProjectHandler.cs:987 
  at MonoDevelop.Projects.Formats.MSBuild.MSBuildProjectHandler.LoadProjectItems (MonoDevelop.Projects.Formats.MSBuild.MSBuildProject msproject, MonoDevelop.Projects.Formats.MSBuild.MSBuildSerializer ser, ProjectItemFlags flags) [0x0001e] in /Users/builder/data/lanes/886/f94ee866/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildProjectHandler.cs:773 
  at MonoDevelop.Projects.SharedAssetsProjects.SharedAssetsProjectMSBuildHandler.LoadProject (IProgressMonitor monitor, MonoDevelop.Projects.Formats.MSBuild.MSBuildProject msproject) [0x0018f] in /Users/builder/data/lanes/886/f94ee866/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.SharedAssetsProjects/SharedAssetsProjectMSBuildHandler.cs:76 
  at MonoDevelop.Projects.Formats.MSBuild.MSBuildProjectHandler.Load (IProgressMonitor monitor, System.String fileName, MonoDevelop.Projects.Formats.MSBuild.MSBuildFileFormat format, System.String language, System.Type itemClass) [0x00217] in /Users/builder/data/lanes/886/f94ee866/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildProjectHandler.cs:394 
  at MonoDevelop.Projects.Extensions.SolutionItemNode.LoadSolutionItem (IProgressMonitor monitor, System.String fileName, MonoDevelop.Projects.Formats.MSBuild.MSBuildFileFormat expectedFormat, System.String itemGuid) [0x00016] in /Users/builder/data/lanes/886/f94ee866/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/SolutionItemNode.cs:54 
  at MonoDevelop.Projects.Formats.MSBuild.MSBuildProjectService.LoadItem (IProgressMonitor monitor, System.String fileName, MonoDevelop.Projects.Formats.MSBuild.MSBuildFileFormat expectedFormat, System.String typeGuid, System.String itemGuid) [0x0002d] in /Users/builder/data/lanes/886/f94ee866/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildProjectService.cs:109 
  at MonoDevelop.Projects.Formats.MSBuild.MSBuildFileFormat.ReadFile (FilePath file, System.Type expectedType, IProgressMonitor monitor) [0x0003b] in /Users/builder/data/lanes/886/f94ee866/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildFileFormat.cs:157 
  at MonoDevelop.Projects.ProjectService.ReadFile (IProgressMonitor monitor, System.String file, System.Type expectedType, MonoDevelop.Projects.FileFormat& format) [0x0003e] in /Users/builder/data/lanes/886/f94ee866/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectService.cs:304 
  at MonoDevelop.Projects.ProjectService+<ReadSolutionItem>c__AnonStorey0.<>m__0 (IProgressMonitor , System.String ) [0x0001f] in /Users/builder/data/lanes/886/f94ee866/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectService.cs:202 
  at MonoDevelop.Projects.DefaultProjectServiceExtension.LoadSolutionItem (IProgressMonitor monitor, System.String fileName, MonoDevelop.Projects.Extensions.ItemLoadCallback callback) [0x00004] in /Users/builder/data/lanes/886/f94ee866/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectService.cs:678 
  at MonoDevelop.Projects.ProjectServiceExtension.LoadSolutionItem (IProgressMonitor monitor, System.String fileName) [0x00019] in /Users/builder/data/lanes/886/f94ee866/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectServiceExtension.cs:111 
  at MonoDevelop.Projects.ProjectServiceExtension.LoadSolutionItem (IProgressMonitor monitor, System.String fileName, MonoDevelop.Projects.Extensions.ItemLoadCallback callback) [0x00011] in /Users/builder/data/lanes/886/f94ee866/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectServiceExtension.cs:102 
  at MonoDevelop.Projects.ProjectServiceExtension.LoadSolutionItem (IProgressMonitor monitor, System.String fileName) [0x00019] in /Users/builder/data/lanes/886/f94ee866/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectServiceExtension.cs:111 
  at MonoDevelop.Projects.ProjectServiceExtension.LoadSolutionItem (IProgressMonitor monitor, System.String fileName, MonoDevelop.Projects.Extensions.ItemLoadCallback callback) [0x00011] in /Users/builder/data/lanes/886/f94ee866/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectServiceExtension.cs:102 
  at MonoDevelop.Projects.ProjectServiceExtension.LoadSolutionItem (IProgressMonitor monitor, System.String fileName) [0x00019] in /Users/builder/data/lanes/886/f94ee866/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectServiceExtension.cs:111 
  at MonoDevelop.Projects.ProjectServiceExtension.LoadSolutionItem (IProgressMonitor monitor, System.String fileName, MonoDevelop.Projects.Extensions.ItemLoadCallback callback) [0x00011] in /Users/builder/data/lanes/886/f94ee866/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectServiceExtension.cs:102 
  at MonoDevelop.Projects.ProjectServiceExtension.LoadSolutionItem (IProgressMonitor monitor, System.String fileName) [0x00019] in /Users/builder/data/lanes/886/f94ee866/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectServiceExtension.cs:111 
  at MonoDevelop.Projects.ProjectServiceExtension.LoadSolutionItem (IProgressMonitor monitor, System.String fileName, MonoDevelop.Projects.Extensions.ItemLoadCallback callback) [0x00011] in /Users/builder/data/lanes/886/f94ee866/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectServiceExtension.cs:102 
  at MonoDevelop.Projects.ProjectServiceExtension.LoadSolutionItem (IProgressMonitor monitor, System.String fileName) [0x00019] in /Users/builder/data/lanes/886/f94ee866/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectServiceExtension.cs:111 
  at MonoDevelop.Projects.ProjectServiceExtension.LoadSolutionItem (IProgressMonitor monitor, System.String fileName, MonoDevelop.Projects.Extensions.ItemLoadCallback callback) [0x00011] in /Users/builder/data/lanes/886/f94ee866/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectServiceExtension.cs:102 
  at MonoDevelop.Projects.ProjectServiceExtension.LoadSolutionItem (IProgressMonitor monitor, System.String fileName) [0x00019] in /Users/builder/data/lanes/886/f94ee866/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectServiceExtension.cs:111 
  at MonoDevelop.Projects.CompiledAssemblyExtension.LoadSolutionItem (IProgressMonitor monitor, System.String fileName) [0x00048] in /Users/builder/data/lanes/886/f94ee866/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/CompiledAssemblyProject.cs:222 
  at MonoDevelop.Projects.ProjectServiceExtension.LoadSolutionItem (IProgressMonitor monitor, System.String fileName, MonoDevelop.Projects.Extensions.ItemLoadCallback callback) [0x00011] in /Users/builder/data/lanes/886/f94ee866/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectServiceExtension.cs:102 
  at MonoDevelop.Projects.ProjectServiceExtension.LoadSolutionItem (IProgressMonitor monitor, System.String fileName) [0x00019] in /Users/builder/data/lanes/886/f94ee866/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectServiceExtension.cs:111 
  at MonoDevelop.Projects.ProjectServiceExtension.LoadSolutionItem (IProgressMonitor monitor, System.String fileName, MonoDevelop.Projects.Extensions.ItemLoadCallback callback) [0x00011] in /Users/builder/data/lanes/886/f94ee866/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectServiceExtension.cs:102 
  at MonoDevelop.Projects.ProjectServiceExtension.LoadSolutionItem (IProgressMonitor monitor, System.String fileName) [0x00019] in /Users/builder/data/lanes/886/f94ee866/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectServiceExtension.cs:111 
  at MonoDevelop.Projects.ProjectServiceExtension.LoadSolutionItem (IProgressMonitor monitor, System.String fileName, MonoDevelop.Projects.Extensions.ItemLoadCallback callback) [0x00011] in /Users/builder/data/lanes/886/f94ee866/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectServiceExtension.cs:102 
  at MonoDevelop.Projects.ProjectService.ReadSolutionItem (IProgressMonitor monitor, System.String file) [0x0007a] in /Users/builder/data/lanes/886/f94ee866/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectService.cs:200 
  at MonoDevelop.Projects.ProjectService.GetWrapperSolution (IProgressMonitor monitor, System.String filename) [0x000bb] in /Users/builder/data/lanes/886/f94ee866/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectService.cs:529 
  at MonoDevelop.Ide.RootWorkspace.BackgroundLoadWorkspace (IProgressMonitor monitor, System.String filename, Boolean loadPreferences, Boolean reloading) [0x00146] in /Users/builder/data/lanes/886/f94ee866/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/RootWorkspace.cs:594
Comment 2 Sadik Ali 2014-06-30 03:21:09 UTC
I have checked this issue with sample application attached in bug description and able to reproduce this. To reproduce this issue I have followed the steps mentioned in bug description.

Screencast : http://screencast.com/t/lD0WAA5TSc1j

Environment Info :

=== Xamarin Studio ===

Version 5.0.1 (build 3)
Installation UUID: 011d70a5-dede-428b-ab04-ef451c2e539d
Runtime:
	Mono 3.4.0 ((no/954ed3c)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 304000214

=== Xamarin.Android ===

Version: 4.12.5 (Enterprise Edition)
Android SDK: /Users/MM/Desktop/android-sdk-macosx
	Supported Android versions:
		2.1   (API level 7)
		2.2   (API level 8)
		2.3   (API level 10)
		3.1   (API level 12)
		3.2   (API level 13)
		4.0   (API level 14)
		4.0.3 (API level 15)
		4.1   (API level 16)
		4.2   (API level 17)
		4.3   (API level 18)
		4.4   (API level 19)
Java SDK: /usr
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)

=== Apple Developer Tools ===

Xcode 5.1 (5084)
Build 5B130a

=== Xamarin.iOS ===

Version: 7.2.4.4 (Enterprise Edition)
Hash: 5485ac2
Branch: 
Build date: 2014-06-11 13:44:48-0400

=== Xamarin.Mac ===

Xamarin.Mac: Not Installed

=== Build Information ===

Release ID: 500010003
Git revision: f94ee866936d25105704eb63728ad5a981eda0a4
Build date: 2014-06-04 12:19:12-04
Xamarin addins: 1a6044e8321ea07e03a56b5381951686c82fed8b

=== Operating System ===

Mac OS X 10.9.2
Darwin MacMini.local 13.1.0 Darwin Kernel Version 13.1.0
    Thu Jan 16 19:40:37 PST 2014
    root:xnu-2422.90.20~2/RELEASE_X86_64 x86_64
Comment 3 Lluis Sanchez 2014-06-30 14:18:18 UTC
Adding linked files to a shared project is not supported. We'll remove the Link option in this case.
Comment 4 Lluis Sanchez 2014-06-30 14:43:47 UTC
Option removed for shared projects in in 5.2.0.126.
Comment 5 narayanp 2014-07-04 12:03:53 UTC
We have checked this issue with XS 5.2 (build 179), as per comment 3,  now 'Add a link to the files' option has been for adding a file to a shared project and now its working fine.

Screencast: http://screencast.com/t/7UElw8EsJ2V9

XS 5.2 (build 179)
Build Information
Release ID: 502000179
Git revision: 3dbcdf64de0826aa76b5f108ae80644511b4e587
Build date: 2014-07-03 17:37:41-04
Xamarin addins: 116ce67c67d933645f95fb370690487b18b8624e

MonoFramework-MDK-3.6.0.37
mono-android-4.14.0-45
monotouch-7.2.6.17

Hence, closing this issue.