I'm compiling the sources in Visual Studio Community 2017 for Mac and I've got the following error:
Building: ServiceLayer.API (Debug)
Error: Build failed. See the build log for details. (ServiceLayer.API)
---------------------- Done ----------------------
Build failed.
Build: 1 error, 0 warnings
In Ide.log log file, I've the following entry:
ERROR [2017-10-08 20:20:45Z]: Inspector does not support this project type
ERROR [2017-10-08 20:20:45Z]: Build failed.
System.Exception: Did not find MSBuild for runtime Mono 4.0.2 (c99aa0c)
at MonoDevelop.Projects.MSBuild.MSBuildProjectService.GetNewestInstalledToolsVersion (MonoDevelop.Core.Assemblies.TargetRuntime runtime, System.Boolean requiresMicrosoftBuild, System.String& binDir) [0x0006e] in /Users/builder/data/lanes/5144/cab57de4/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildProjectService.cs:1087
at MonoDevelop.Projects.MSBuild.MSBuildProjectService+<GetProjectBuilder>d__100.MoveNext () [0x00133] in /Users/builder/data/lanes/5144/cab57de4/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildProjectService.cs:1116
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:151
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00037] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:187
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:156
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:128
at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:357
at MonoDevelop.Projects.Project+<GetProjectBuilder>d__157.MoveNext () [0x001bb] in /Users/builder/data/lanes/5144/cab57de4/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Project.cs:1418
...
ERROR [2017-10-08 20:21:16Z]: An unhandled exception has occured. Terminating Visual Studio? False
Notes: In total like 381 lines on each attempt to build. 'End of stack trace' line is repeated 52 times.
This pointed me to this line in MonoDevelop (see: MSBuildProjectService.cs):
throw new Exception ("Did not find MSBuild for runtime " + runtime.Id);
I've checked and msbuild command exist in the command-line:
$ which msbuild
/Library/Frameworks/Mono.framework/Versions/Current/Commands/msbuild
$ msbuild --version
Microsoft (R) Build Engine version 15.4.0.0 (master/f296e67b Thu Sep 21 19:38:16 EDT 2017) for Mono
$ stat /Library/Frameworks/Mono.framework/Versions/Current
File: /Library/Frameworks/Mono.framework/Versions/Current -> /Library/Frameworks/Mono.framework/Versions/5.4.0
What I've tried so far:
I've tested both channels (Stable and Beta) in Visual Studio Update without success.
I've tried to Clean All and Rebuild All.
I've tried to remove the cache files in ~/Library/Caches/VisualStudio.
Reinstalling VisualStudio.
I've checked in Visual Studio, Preference..., Projects, .NET Runtimes and I've the latest Mono set as Default (to 5.4.x):
However when debugging, it's trying to open msbuild for 4.0.2 instead, e.g.:
$ sudo fs_usage -f pathname VisualStudio | grep -i msbuild
12:34:38 stat64 /Library/Frameworks/Mono.framework/Versions/4.0.2/lib/mono/msbuild>>>>>>>>>>>>>>>>>>>>>> 0.000007 VisualStudio
12:34:38 lstat64 /Library/Frameworks/Mono.framework/Versions/4.0.2/lib/mono/msbuild>>>>>>>>>>>>>>>>>>>>>> 0.000002 VisualStudio
12:34:38 access /Library/Frameworks/Mono.framework/Versions/4.0.2/lib/mono/msbuild>>>>>>>>>>>>>>>>>>>>>> 0.000002 VisualStudio
which doesn't exist.
How should I add a missing MSBuild to my Solution (project) (as per mentioned error)?
Mono 4.0.2 did not have msbuild, it was included in 4.8.0+ . Check where does /Library/Frameworks/Mono.framework/Versions/Current (symlink) point to. It probably points to some mono 5.x.y . Try changing the .NET runtime that VSMac is set to use in Preferences -> Projects -> .NET Runtimes, to the latest one.
For some reason it is still looking it in 4.0.2. I would try to, at least temporarily, remove that 4.0.2 directory and then check. But otherwise I think your installation is broken and I would try to reinstall the whole thing (VSMac, Mono, ..).
Also, check in your Ide.log file for any references to 4.0.2, before that exception.
If you run into the same issue even with a fresh install, then please file a bug at bugzilla.xamarin.com and we can try to debug it there.
Related
I'm working on a Hololens application using Unity 2018.2.20f1. I'm building the application for UWP from Unity without a problem. However, after opening up the generated solution in the VisualStudio 2017 (Community Edition) and trying to build it, the build process fails with the following errors:
Severity Code Description Project File Line Suppression State
Error MSB3073 The command ""D:\Projects\VSProjects\VirtualPrague\Il2CppOutputProject\\IL2CPP\build\il2cpp.exe" --libil2cpp-static --compile-cpp -architecture=x86 -configuration=Release -platform=winrt -outputpath="D:\Projects\VSProjects\VirtualPrague\\build\bin\Win32\Release\GameAssembly.dll" --data-folder="D:\Projects\VSProjects\VirtualPrague\\build\bin\Win32\Release\\" -cachedirectory="D:\Projects\VSProjects\VirtualPrague\\build\obj\il2cppOutputProject\Win32\Release\\" -generatedcppdir="D:\Projects\VSProjects\VirtualPrague\Il2CppOutputProject\\Source" --additional-defines=WINDOWS_UWP --additional-defines=UNITY_UWP --additional-defines=UNITY_WSA_10_0 --additional-defines=UNITY_WSA --additional-defines=UNITY_WINRT --additional-defines=PLATFORM_WINRT -dotnetprofile=unityjit -verbose --map-file-parser="D:\Projects\VSProjects\VirtualPrague\Il2CppOutputProject\\IL2CPP\MapFileParser\MapFileParser.exe"" exited with code -532462766. Il2CppOutputProject C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.MakeFile.Targets 44
and
Severity Code Description Project File Line Suppression State
Error LNK1181 cannot open input file 'D:\Projects\VSProjects\VirtualPrague\build\bin\Win32\Release\GameAssembly.lib' VirtualPrague D:\Projects\VSProjects\VirtualPrague\VirtualPrague\LINK 1
In the output there are multiple exceptions, similar to this one:
1>il2cpp.exe didn't catch exception: System.IO.IOException: The process cannot access the file 'C:\Users\dev\AppData\Local\Temp\tmpDE97.tmp' because it is being used by another process.
1> at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
1> at System.IO.File.InternalDelete(String path, Boolean checkHost)
1> at Unity.IL2CPP.Shell.Execute(ExecuteArgs executeArgs, IExecuteController controller)
1> at Unity.IL2CPP.Building.CppProgramBuilder.PostprocessObjectFiles(HashSet`1 objectFiles, CppToolChainContext toolChainContext)
1> at Unity.IL2CPP.Building.CppProgramBuilder.Build(IBuildStatistics& statistics)
1> at il2cpp.Program.DoRun(String[] args)
1> at il2cpp.Program.Run(String[] args)
1> at il2cpp.Program.Main(String[] args)
The exceptions are the same but were thrown for different files. I tried to reinstall the Visual Studio and managed to get a build. The next day I turned on the PC and this error was back. I stopped all of the VS instances and processed from the task manager, deleted all of the files from the Temp folder and managed to get a build a couple more times. Then this error came back.
From what I can tell, during the build process, Visual Studio creates some *.tmp files and for some reason thinks that another process is using it.
Any idea why this is happening and how can it be solved?
Thanks a lot!
Edit: So here is what I did so far (this is more of a work around rather then a solution)
Uninstall vs and unity
Clear the registry with ccleaner and Advanced Uninstaller Pro
Install vs and Unity
Every time I want to get a build I,
Close all of vs instances
Clear Temp folder (C:\Users\dev\AppData\Local\Temp)
Delete previous vs solution
Build from Unity
Run vs as Administrator
Build and deploy the solution from vs
And it works for the most the time. Also, changing the solution configuration (from debug to release and vice versa) helps sometimes.
I just had to change my HDD. So I installed a version of Windows 10 Education on my computer, and now I'm trying to install Visual studio 2017 community/enterprise ( tried both ). After running the installer which was downloaded from the official website it doesn't start the installation, I just see for a tiny amount of time a small window pop but then it instantly shuts. What could be the reason for this behavior and how to fix this problem?
Edit: I can install other software, I managed to install a few other programs without a problem, I notice this behavior only with Visual studio and additionally .NET Framework installer.
Edit2:
I found this in my temp folder :
[4/20/2017, 11:30:37] === Logging started: 2017/04/20 11:30:37 ===
[4/20/2017, 11:30:37] [4/20/2017, 11:30:38] --- logging level: standard ---
[4/20/2017, 11:30:38] Directory 'C:\Users\2D94~1\AppData\Local\Temp\931f7233a5c56697278d79b1\' has been selected for file extraction
[4/20/2017, 11:30:38] Extracting files to: C:\Users\2D94~1\AppData\Local\Temp\931f7233a5c56697278d79b1\
[4/20/2017, 11:30:38] Error 0x8007002a: Failed to extract all files out of box container #0.
[4/20/2017, 11:30:38] Error 0x8007002a: Failed to extract
[4/20/2017, 11:30:38] Error 0x8007013d: Failed to get error string from error: 0x8007002a
[4/20/2017, 11:30:38] The entire Box execution exiting with result code: 0x8007002a
[4/20/2017, 11:30:38] Launched extracted application exiting with result code: 0x0
[4/20/2017, 11:30:38] === Logging stopped: 2017/04/20 11:30:38 ===
Edit 3: THANKS MICROSOFT you really screwed me up huh.
Edit 4: After full Windows reinstall with the latest version still getting this error.
Edit 5: Changed windows version from education to professional and it works!
Had the same issue. I was running installer from my /Download folder.
Try move the installer to D: drive, it helped me.
Regards
My newly installed Visual studio poped up a dialog box with the message of
An exception has been encountered. This may be caused by an extension.
You can get more information by examining the file 'C:\Users....\AppData\Roaming\Microsoft\VisualStudio\14.0\ActivityLog.xml'.
And I found the following errors in the xml file.
A MEF Component threw an exception at runtime: Microsoft.VisualStudio.Composition.CompositionFailedException: An exception was thrown while initializing part "Microsoft.VisualStudio.IntelliTrace.SourceControl.HistoricalModeHint.HistoricalModeTaggerProvider". ---> System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualStudio.Diagnostics.Utilities, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. at Microsoft.VisualStudio.IntelliTrace.SourceControl.HistoricalModeHint.HistoricalModeTaggerProvider..ctor(SVsServiceProvider serviceProvider, IVsEditorAdaptersFactoryService adapterFactory) --- End of inner exception stack trace --- at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.RuntimePartLifecycleTracker.CreateValue() at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.Create() at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveNext(PartLifecycleState nextState) at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveToState(PartLifecycleState requiredState) at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.GetValueReadyToExpose() at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.<>c__DisplayClass15_0.b__0()
and
Microsoft.VisualStudio.Composition.CompositionFailedException: An exception was thrown while initializing part "Microsoft.VisualStudio.IntelliTrace.SourceControl.HistoricalModeHint.HistoricalModeTaggerProvider". ---> System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualStudio.Diagnostics.Utilities, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. at Microsoft.VisualStudio.IntelliTrace.SourceControl.HistoricalModeHint.HistoricalModeTaggerProvider..ctor(SVsServiceProvider serviceProvider, IVsEditorAdaptersFactoryService adapterFactory) --- End of inner exception stack trace --- at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.RuntimePartLifecycleTracker.CreateValue() at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.Create() at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveNext(PartLifecycleState nextState) at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveToState(PartLifecycleState requiredState) at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.GetValueReadyToExpose() at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.<>c__DisplayClass15_0.b__0() --- End of stack trace from previous location where exception was thrown --- at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.<>c__DisplayClass15_0.b__0() at Microsoft.VisualStudio.Composition.DelegateServices.<>c__DisplayClass2_01.<As>b__0() at System.Lazy1.CreateValue() at System.Lazy1.LazyInitValue() at System.Lazy1.get_Value() at Microsoft.VisualStudio.Text.Tagging.Implementation.TagAggregator`1.GatherTaggers(ITextBuffer textBuffer)
I tried to repair VS but it doesn't help. I also tried to force the cache to be rebuilt:
Delete the contents of the folder at "%LOCALAPPDATA%\Microsoft\VisualStudio\14.0\ComponentModelCache"
Run "DevEnv.exe /setup" (this is under "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE", but should be on your PATH if you open a Developer Command Prompt).
Try to run the VS with safe mode using the command: devenv /safemode, if it works fine, that means the installed extensions caused this issue, you can go to Tools—Extensions and Updates and click ‘Updates’ tab and install all updates, then reopen VS. Or click ‘Installed’ tab and remove/uninstall the installed extensions one by one to find the culprit.
Another thing you can try is to run visual studio as administrator, it can help us to excludes the permission issue.
I am working on an MonoDevelop Addin (using MonoDevelop.AddinMaker) within Tamarin Studio and MonoDevelop and everything was fine, till I needed to access the GTK# Toolbox to fix some existing GUI panels (originally from the CSharpBinding GUIs).
The GTK# Widget that is referenced in those panels are in MonoDevelop.Ide.dll, so I added that to the GTK# ToolBox and the widgets show up. But the build generates invalid partial classes due to missing widget reference (MonoDevelop.Ide) and that reference is not available via the AddinMaker's Addin References system so I added a manual assembly reference to MonoDevelop.Ide.dll.
Now the debugging of the Addin fails with:
ERROR [2015-11-22 11:47:39Z]: Add-in error (MonoDevelop.Ide,5.10): Add-in could not be loaded: The required addin 'MonoDevelop.Core,5.10' is disabled.
Mono.Addins.MissingDependencyException: The required addin 'MonoDevelop.Core,5.10' is disabled.
at Mono.Addins.AddinEngine.ResolveLoadDependencies (System.Collections.ArrayList addins, System.Collections.Stack depCheck, System.String id, Boolean optional) in /Users/builder/data/lanes/2103/7c46a0b7/source/monodevelop/main/external/mono-addins/Mono.Addins/Mono.Addins/AddinEngine.cs:line 597
at Mono.Addins.AddinEngine.ResolveLoadDependencies (System.Collections.ArrayList addins, System.Collections.Stack depCheck, System.String id, Boolean optional) in /Users/builder/data/lanes/2103/7c46a0b7/source/monodevelop/main/external/mono-addins/Mono.Addins/Mono.Addins/AddinEngine.cs:line 612
ERROR [2015-11-22 11:47:39Z]: Add-in error (MonoDevelop.Core,5.10): Disabled add-ins can't be loaded.
Loaded assembly: /Applications/Xamarin Studio.app/Contents/Resources/lib/monodevelop/bin/Mono.Addins.CecilReflector.dll [External]
Thread started: #3
Unloaded assembly: /Applications/Xamarin Studio.app/Contents/Resources/lib/monodevelop/bin/Mono.Addins.CecilReflector.dll
Thread finished: #3
System.InvalidOperationException: Extension node not found in path: /MonoDevelop/Core/WebCredentialProviders
at Mono.Addins.ExtensionContext.GetExtensionObjects[T] (System.String path, Boolean reuseCachedInstance) in /Users/builder/data/lanes/2103/7c46a0b7/source/monodevelop/main/external/mono-addins/Mono.Addins/Mono.Addins/ExtensionContext.cs:line 636
at Mono.Addins.ExtensionContext.GetExtensionObjects[T] (System.String path) in /Users/builder/data/lanes/2103/7c46a0b7/source/monodevelop/main/external/mono-addins/Mono.Addins/Mono.Addins/ExtensionContext.cs:line 607
at Mono.Addins.AddinManager.GetExtensionObjects[T] (System.String path) in /Users/builder/data/lanes/2103/7c46a0b7/source/monodevelop/main/external/mono-addins/Mono.Addins/Mono.Addins/AddinManager.cs:line 630
at MonoDevelop.Core.WebRequestHelper.Initialize () in /Users/builder/data/lanes/2103/7c46a0b7/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Core/WebRequestHelper.cs:line 49
at MonoDevelop.Core.Runtime.Initialize (Boolean updateAddinRegistry) in /Users/builder/data/lanes/2103/7c46a0b7/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Core/Runtime.cs:line 118
Starting Xamarin Studio
FATAL ERROR [2015-11-22 11:47:42Z]: Xamarin Studio failed to start. Some of the assemblies required to run Xamarin Studio (for example gtk-sharp)may not be properly installed in the GAC.
System.InvalidOperationException: Extension node not found in path: /MonoDevelop/Core/PlatformService
at Mono.Addins.ExtensionContext.GetExtensionObjects (System.String path, System.Type arrayElementType, Boolean reuseCachedInstance) in /Users/builder/data/lanes/2103/7c46a0b7/source/monodevelop/main/external/mono-addins/Mono.Addins/Mono.Addins/ExtensionContext.cs:line 669
at Mono.Addins.ExtensionContext.GetExtensionObjects (System.String path) in /Users/builder/data/lanes/2103/7c46a0b7/source/monodevelop/main/external/mono-addins/Mono.Addins/Mono.Addins/ExtensionContext.cs:line 534
at Mono.Addins.AddinManager.GetExtensionObjects (System.String path) in /Users/builder/data/lanes/2103/7c46a0b7/source/monodevelop/main/external/mono-addins/Mono.Addins/Mono.Addins/AddinManager.cs:line 554
at MonoDevelop.Ide.DesktopService.Initialize () in /Users/builder/data/lanes/2103/7c46a0b7/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/DesktopService.cs:line 56
at MonoDevelop.Ide.IdeStartup.Run (MonoDevelop.Ide.MonoDevelopOptions options) in /Users/builder/data/lanes/2103/7c46a0b7/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs:line 175
at MonoDevelop.Ide.IdeStartup.Main (System.String[] args, MonoDevelop.Ide.Extensions.IdeCustomizer customizer) in /Users/builder/data/lanes/2103/7c46a0b7/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs:line 652
I removed the assembly reference, removed the GTK Toolbox MonoDevelop components/widget, etc.. but the problem persists.
MonoDevelop and Xamarin Studio run fine by themselves, so how do I re-enable(?) the MonoDevelop.Core addin in the AddinMaker Project?
I would try deleting the addin-db-002 directory (might be called
something different) which is inside the directory of your addin's
bin/Debug directory. – Matt Ward
That was actually the problem, the addin-db-002 does not cleaned up on a Clean All, nor does it get a complete update on a Build All.
So once you have a 'corrupt' list of addin's within the sub-dir of ./addin-data/1 they do not get re-created unless you manually delete the addin-db-002.
I'm using VS2013, Xamarin.Android 4.12.4.20.
Build is successful.
I'm getting error from title whenever I try to deploy in debug mode or package.
It started to happened today it work fine before.
I've restarted VS, device, PC - none helped.
Stack trace:
Xamarin.AndroidTools.AndroidDeploymentException: InternalError ---> System.ArgumentException: An item with the same key has already been added.
at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at Mono.AndroidTools.Adb.AdbSyncDirectory.Add(AdbSyncItem entry)
at Xamarin.AndroidTools.AndroidDeploySession.InstallAssemblies(String destinationPath, CancellationToken token)
at Xamarin.AndroidTools.AndroidDeploySession.FastDev()
at Xamarin.AndroidTools.AndroidDeploySession.Run(CancellationToken token)
at Xamarin.AndroidTools.AndroidDeploySession.RunLogged(CancellationToken token)
--- End of inner exception stack trace ---
at Xamarin.AndroidTools.AndroidDeploySession.RunLogged(CancellationToken token)
at Xamarin.AndroidTools.AndroidDeploySession.Start(CancellationToken token)
Build output:
3>Build succeeded.
3>Waiting for device..
3>Detecting installed packages
3>Detecting installed packages...
3>
3>Removing previous version of application
3>Removing previous version of application...
3>
3>Installing application on device
3>Copying application to device...
3>
3>Getting installation path...
I've figured it out. Make sure that you don't have different versions of the same dll referenced!!
Let me describe my set up a bit more that will help with explaining why exception happened.
I've got two projects
Domain - library with code shared between all platforms
Android - android specific code
Both have nuget references to the same library. At some point android (only in this project) nuget references have been updated which resulted in two versions of the same library required by the application (Domain project still referenced old nuget).
When I tried to package solution I would get warning like :
Consider app.config remapping of assembly "{Library}" from Version "5.6.0.0" [] to Version "5.6.1.0" [{Path}] to solve conflict and get rid of warning.
Once I've update Domain's nuget everything worked.