mhutch / MonoDevelop.AddinMaker

Extension to make it easier to create Visual Studio for Mac / MonoDevelop extensions
MIT License
50 stars 26 forks source link

Visual Studio Mac - Adding an 'Addin Reference' causes a 'Save Failed' error #42

Closed matthewrdev closed 7 years ago

matthewrdev commented 7 years ago

Description

In Visual Studio for Mac (version details attached), when a developer adds an Addin Reference to an addin/extension project, it fails with the message Save Failed. Upon closing and reopening the addin project, the added reference is not included.

Example: save-failed-issue

This is an issue as addin developers cannot reference other addins. For me, this means that MFractor cannot support Visual Studio for Mac as I cannot reference core addins like MonoDevelop.MonoAndroid, MonoDevelop.Refactoring etc.

Based on the log information, I can see an exception is being thrown by the MSBuild addin:

ERROR [2017-05-11 10:48:20Z]: Save failed.
System.InvalidOperationException: Item doesn't have a name
  at MonoDevelop.Projects.MSBuild.MSBuildProject.AddItem (MonoDevelop.Projects.MSBuild.MSBuildItem it, MonoDevelop.Projects.MSBuild.MSBuildItem beforeItem) [0x00042] in /Users/builder/data/lanes/4693/7553fda2/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildProject.cs:860 
  at MonoDevelop.Projects.MSBuild.MSBuildProject.AddItem (MonoDevelop.Projects.MSBuild.MSBuildItem it) [0x00000] in /Users/builder/data/lanes/4693/7553fda2/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildProject.cs:843 
  at MonoDevelop.Projects.MSBuild.MSBuildProject.AddNewItem (System.String name, System.String include, MonoDevelop.Projects.MSBuild.MSBuildItem beforeItem) [0x00025] in /Users/builder/data/lanes/4693/7553fda2/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildProject.cs:830 
  at MonoDevelop.Projects.MSBuild.MSBuildProject.AddNewItem (System.String name, System.String include) [0x00000] in /Users/builder/data/lanes/4693/7553fda2/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildProject.cs:819 
  at MonoDevelop.Projects.Project.SaveProjectItem (MonoDevelop.Core.ProgressMonitor monitor, MonoDevelop.Projects.MSBuild.MSBuildProject msproject, MonoDevelop.Projects.ProjectItem item, System.Collections.Generic.Dictionary`2[TKey,TValue] expandedItems, System.Collections.Generic.HashSet`1[T] unusedItems, System.Collections.Generic.HashSet`1[T] loadedItems, System.String pathPrefix) [0x00423] in /Users/builder/data/lanes/4693/7553fda2/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Project.cs:3297 
  at MonoDevelop.Projects.Project.SaveProjectItems (MonoDevelop.Core.ProgressMonitor monitor, MonoDevelop.Projects.MSBuild.MSBuildProject msproject, System.Collections.Generic.HashSet`1[T] loadedItems, System.String pathPrefix) [0x00046] in /Users/builder/data/lanes/4693/7553fda2/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Project.cs:3152 
  at MonoDevelop.Projects.Project.OnWriteProject (MonoDevelop.Core.ProgressMonitor monitor, MonoDevelop.Projects.MSBuild.MSBuildProject msproject) [0x00019] in /Users/builder/data/lanes/4693/7553fda2/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Project.cs:2870 
  at MonoDevelop.Projects.DotNetProject.OnWriteProject (MonoDevelop.Core.ProgressMonitor monitor, MonoDevelop.Projects.MSBuild.MSBuildProject msproject) [0x00000] in /Users/builder/data/lanes/4693/7553fda2/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetProject.cs:1819 
  at MonoDevelop.Projects.Project+DefaultMSBuildProjectExtension.OnWriteProject (MonoDevelop.Core.ProgressMonitor monitor, MonoDevelop.Projects.MSBuild.MSBuildProject msproject) [0x00000] in /Users/builder/data/lanes/4693/7553fda2/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Project.cs:3900 
  at MonoDevelop.Projects.ProjectExtension.OnWriteProject (MonoDevelop.Core.ProgressMonitor monitor, MonoDevelop.Projects.MSBuild.MSBuildProject msproject) [0x00000] in /Users/builder/data/lanes/4693/7553fda2/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectExtension.cs:143 
  at MonoDevelop.Projects.ProjectExtension.OnWriteProject (MonoDevelop.Core.ProgressMonitor monitor, MonoDevelop.Projects.MSBuild.MSBuildProject msproject) [0x00000] in /Users/builder/data/lanes/4693/7553fda2/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectExtension.cs:143 
  at MonoDevelop.Projects.ProjectExtension.OnWriteProject (MonoDevelop.Core.ProgressMonitor monitor, MonoDevelop.Projects.MSBuild.MSBuildProject msproject) [0x00000] in /Users/builder/data/lanes/4693/7553fda2/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectExtension.cs:143 
  at MonoDevelop.Projects.SharedAssetsProjects.SharedAssetsProjectMSBuildExtension.OnWriteProject (MonoDevelop.Core.ProgressMonitor monitor, MonoDevelop.Projects.MSBuild.MSBuildProject project) [0x00000] in /Users/builder/data/lanes/4693/7553fda2/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.SharedAssetsProjects/SharedAssetsProjectMSBuildExtension.cs:65 
  at MonoDevelop.Projects.ProjectExtension.OnWriteProject (MonoDevelop.Core.ProgressMonitor monitor, MonoDevelop.Projects.MSBuild.MSBuildProject msproject) [0x00000] in /Users/builder/data/lanes/4693/7553fda2/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectExtension.cs:143 
  at MonoDevelop.PackageManagement.PackageManagementMSBuildExtension.OnWriteProject (MonoDevelop.Core.ProgressMonitor monitor, MonoDevelop.Projects.MSBuild.MSBuildProject msproject) [0x00007] in /Users/builder/data/lanes/4693/7553fda2/source/monodevelop/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementMSBuildExtension.cs:45 
  at MonoDevelop.Projects.ProjectExtension.OnWriteProject (MonoDevelop.Core.ProgressMonitor monitor, MonoDevelop.Projects.MSBuild.MSBuildProject msproject) [0x00000] in /Users/builder/data/lanes/4693/7553fda2/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectExtension.cs:143 
  at MonoDevelop.Projects.ProjectExtension.OnWriteProject (MonoDevelop.Core.ProgressMonitor monitor, MonoDevelop.Projects.MSBuild.MSBuildProject msproject) [0x00000] in /Users/builder/data/lanes/4693/7553fda2/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectExtension.cs:143 
  at MonoDevelop.Projects.ProjectExtension.OnWriteProject (MonoDevelop.Core.ProgressMonitor monitor, MonoDevelop.Projects.MSBuild.MSBuildProject msproject) [0x00000] in /Users/builder/data/lanes/4693/7553fda2/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectExtension.cs:143 
  at MonoDevelop.Projects.ProjectExtension.OnWriteProject (MonoDevelop.Core.ProgressMonitor monitor, MonoDevelop.Projects.MSBuild.MSBuildProject msproject) [0x00000] in /Users/builder/data/lanes/4693/7553fda2/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectExtension.cs:143 
  at MonoDevelop.Projects.ProjectExtension.OnWriteProject (MonoDevelop.Core.ProgressMonitor monitor, MonoDevelop.Projects.MSBuild.MSBuildProject msproject) [0x00000] in /Users/builder/data/lanes/4693/7553fda2/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectExtension.cs:143 
  at MonoDevelop.Packaging.DotNetProjectPackagingExtension.OnWriteProject (MonoDevelop.Core.ProgressMonitor monitor, MonoDevelop.Projects.MSBuild.MSBuildProject msproject) [0x00000] in /Users/builder/data/lanes/4693/7553fda2/source/monodevelop/main/src/addins/MonoDevelop.Packaging/MonoDevelop.Packaging/DotNetProjectPackagingExtension.cs:54 
  at MonoDevelop.Projects.ProjectExtension.OnWriteProject (MonoDevelop.Core.ProgressMonitor monitor, MonoDevelop.Projects.MSBuild.MSBuildProject msproject) [0x00000] in /Users/builder/data/lanes/4693/7553fda2/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectExtension.cs:143 
  at MonoDevelop.Projects.ProjectExtension.OnWriteProject (MonoDevelop.Core.ProgressMonitor monitor, MonoDevelop.Projects.MSBuild.MSBuildProject msproject) [0x00000] in /Users/builder/data/lanes/4693/7553fda2/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectExtension.cs:143 
  at MonoDevelop.Projects.Project.WriteProject (MonoDevelop.Core.ProgressMonitor monitor) [0x0003f] in /Users/builder/data/lanes/4693/7553fda2/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Project.cs:2295 
  at MonoDevelop.Projects.Project+<>c__DisplayClass222_0.<WriteProjectAsync>b__0 () [0x00000] in /Users/builder/data/lanes/4693/7553fda2/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Project.cs:2275 
  at System.Threading.Tasks.Task`1[TResult].InnerInvoke () [0x0000f] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/threading/Tasks/Future.cs:680 
  at System.Threading.Tasks.Task.Execute () [0x00010] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/threading/Tasks/Task.cs:2502 

Steps To Reproduce

  1. Open Visual Studio for Mac
  2. Create a new Addin project
  3. In the new addin project, right click on Addin References and add a reference to any addin
  4. After a short pause, a dialog displaying Save failed displays.
  5. If you then close and re-open the project you'll see the reference was not successfully included.

Expected Result

Upon including an Addin Reference, the save completes successfully and the addin is included into the addin project without issue.

Actual Result

When including an Addin Reference, the save operation fails and the addin is not included into the addin project.

Attachments

visual-studio-mac-version-details.txt ide-log.txt

matthewrdev commented 7 years ago

This issue is also present in the alpha channel version of Visual Studio for Mac.

=== Visual Studio Community 2017 for Mac (Preview) ===

Version 7.1 Preview (7.1 build 582)
Installation UUID: b61f2bec-5e3f-41b4-bb9c-44704b8cfc62
Runtime:
    Mono 5.2.0.104 (2017-04/4a0006f) (64-bit)
    GTK+ 2.24.23 (Raleigh theme)

    Package version: 502000104

=== NuGet ===

Version: 4.0.0.2323

=== .NET Core ===

Runtime: /usr/local/share/dotnet/dotnet
SDK: /usr/local/share/dotnet/sdk/1.0.3/Sdks
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.2.0/lib/mono/msbuild/15.0/bin/Sdks

=== Xamarin.Profiler ===

Version: 1.5.4
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Xamarin.Android ===

Version: 7.3.0.13 (Visual Studio Community)
Android SDK: /Users/matthewrobbins/Library/Developer/Xamarin/android-sdk-macosx
    Supported Android versions:
        2.3    (API level 10)
        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)
        4.4.87 (API level 20)
        5.0    (API level 21)
        5.1    (API level 22)
        6.0    (API level 23)
        7.0    (API level 24)

SDK Tools Version: 25.2.2
SDK Platform Tools Version: 24.0.3
SDK Build Tools Version: 23.0.3

Java SDK: /usr
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)

Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Xamarin Inspector ===

Version: 1.3.0-alpha1
Hash: 0855e01
Branch: master
Build date: Thu, 11 May 2017 04:16:13 GMT

=== Apple Developer Tools ===

Xcode 8.3.2 (12175)
Build 8E2002

=== Xamarin.iOS ===

Version: 10.11.0.126 (Visual Studio Community)
Hash: 7571635e
Branch: master
Build date: 2017-05-09 16:04:54-0400

=== Xamarin.Mac ===

Version: 3.5.0.126 (Visual Studio Community)

=== Build Information ===

Release ID: 701000582
Git revision: 9263c856af081fe1dbfa7bbf9f4856deedfda9d9
Build date: 2017-05-10 16:48:24-04
Xamarin addins: 42029256ac89ded8ed2211aa7bda09debaefab7b
Build lane: monodevelop-lion-d15-3-preview

=== Operating System ===

Mac OS X 10.12.4
Darwin 16.5.0 Darwin Kernel Version 16.5.0
    Fri Mar  3 16:52:33 PST 2017
    root:xnu-3789.51.2~3/RELEASE_X86_64 x86_64

=== Enabled user installed addins ===

Addin Maker 1.3.5
Manifest.addin 0.0.0.0
mhutch commented 7 years ago

Try updating to 1.3.6.

matthewrdev commented 7 years ago

@mhutch Confirmed fixed.

mhutch commented 7 years ago

To my embarrassment, I uploaded it a while ago but forgot to hit "Publish" 😳

Expect 1.3.7 soon!

matthewrdev commented 7 years ago

OMG, that's so easy to do! I frequently publish an mpack, forget to regenerate the *.mreps and then wonder why the newest version isn't visible. :|

And thanks for all your hard work on the Addin Maker Mikayla! 👍

Adam-Langley commented 6 years ago

Hi there mhutch, this issue appears to have regressed:

image

Visual Studio Enterprise 2017 for Mac Version 7.3 (build 797) Installation UUID: 39922d5e-a216-400f-9782-375c75340169 Runtime: Mono 5.4.1.7 (2017-06/e66d9abbb27) (64-bit) GTK+ 2.24.23 (Raleigh theme)

Package version: 504010007

NuGet Version: 4.3.1.4445

.NET Core Runtime: /usr/local/share/dotnet/dotnet Runtime Version: 2.0.0 SDK: /usr/local/share/dotnet/sdk/2.0.0/Sdks SDK Version: 2.0.0 MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.4.1/lib/mono/msbuild/15.0/bin/Sdks

Xamarin.Profiler Version: 1.6.0 Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

Apple Developer Tools Xcode 9.2 (13772) Build 9C40b

Xamarin.iOS Version: 11.4.0.214 (Visual Studio Enterprise) Hash: c4240f3f Branch: d15-5 Build date: 2017-11-08 17:28:18-0500

Xamarin.Android Version: 8.1.0.24 (Visual Studio Enterprise) Android SDK: /Users/alangley/Library/Developer/Xamarin/android-sdk-macosx Supported Android versions: 4.0.3 (API level 15) 4.4 (API level 19) 6.0 (API level 23) 7.1 (API level 25) 8.0 (API level 26)

SDK Tools Version: 25.2.5 SDK Platform Tools Version: 26.0.1 SDK Build Tools Version: 25.0.3

Java SDK: /usr java version "1.8.0_131" Java(TM) SE Runtime Environment (build 1.8.0_131-b11) Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)

Android Designer EPL code available here: https://github.com/xamarin/AndroidDesigner.EPL

Xamarin.Mac Version: 4.0.0.214 (Visual Studio Enterprise)

Xamarin Inspector Version: 1.3.2 Hash: 461f09a Branch: 1.3-release Build date: Tue, 03 Oct 2017 18:26:57 GMT Client compatibility: 1

Build Information Release ID: 703000797 Git revision: ff055b3ecaaeb4229434d0ca871c7d67c62f6388 Build date: 2017-11-30 14:34:51-05 Xamarin addins: 351fc12d4f2367490f8fc2a66b14690d825bb7f1 Build lane: monodevelop-lion-d15-5

Operating System Mac OS X 10.13.1 Darwin 17.2.0 Darwin Kernel Version 17.2.0 Fri Sep 29 18:27:05 PDT 2017 root:xnu-4570.20.62~3/RELEASE_X86_64 x86_64

Enabled user installed addins AddinMaker 1.4.1 Internet of Things (IoT) development (Preview) 7.1