With the latest VS preview (VS 17.3 Preview 3), with both Android and iOS, building my application works the first time I build it, but the second time it fails with
The "XamarinTelemetry" task failed unexpectedly.
Looking at the logs I see this:
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Xamarin\Xamarin.Sdk.targets(138,9): error MSB4018: The "XamarinTelemetry" task failed unexpectedly.
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Xamarin\Xamarin.Sdk.targets(138,9): error MSB4018: System.IO.FileNotFoundException: Could not load file or assembly 'Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified.
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Xamarin\Xamarin.Sdk.targets(138,9): error MSB4018: File name: 'Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Xamarin\Xamarin.Sdk.targets(138,9): error MSB4018: at Microsoft.VisualStudio.Telemetry.TelemetrySessionSettings.GetFaultEventBucketFilterJson(List`1 bucketFilters)
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Xamarin\Xamarin.Sdk.targets(138,9): error MSB4018: at Microsoft.VisualStudio.Telemetry.TelemetrySessionSettings.ToString()
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Xamarin\Xamarin.Sdk.targets(138,9): error MSB4018: at Microsoft.VisualStudio.Telemetry.TelemetrySession.SerializeSettings()
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Xamarin\Xamarin.Sdk.targets(138,9): error MSB4018: at Xamarin.Common.Tasks.Telemetry.GetSession(IBuildEngine4 buildEngine, String vsTelemetrySession) in D:\a\_work\1\s\src\MSBuild\Xamarin.Common.Tasks\Telemetry.cs:line 62
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Xamarin\Xamarin.Sdk.targets(138,9): error MSB4018: at Xamarin.Common.Tasks.XamarinTelemetry.Execute() in D:\a\_work\1\s\src\MSBuild\Xamarin.Common.Tasks\XamarinTelemetry.cs:line 31
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Xamarin\Xamarin.Sdk.targets(138,9): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Xamarin\Xamarin.Sdk.targets(138,9): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Xamarin\Xamarin.Sdk.targets(138,9): error MSB4018:
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Xamarin\Xamarin.Sdk.targets(138,9): error MSB4018: WRN: Assembly binding logging is turned OFF.
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Xamarin\Xamarin.Sdk.targets(138,9): error MSB4018: To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Xamarin\Xamarin.Sdk.targets(138,9): error MSB4018: Note: There is some performance penalty associated with assembly bind failure logging.
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Xamarin\Xamarin.Sdk.targets(138,9): error MSB4018: To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Xamarin\Xamarin.Sdk.targets(138,9): error MSB4018:
The only workaround I've found is to clean the entire solution and rebuild, which succeeds, but then fails again the next time I try to build.
Has anyone found a solution to this?
First off, don't shoot the messenger here..
UPDATE: August 16, 2022
According to Visual Studio v17.3.1's Release Notes, this issue has been resolved. However, if not, there's still the following
As per the workaround thread on Visual Studio's dev community thread:
Open, Xamarin.Sdk.targets in Admin Mode (I use, Notepad++)
C:\Program Files\Microsoft Visual Studio\2022\Preview\Msbuild\Xamarin\Xamarin.Sdk.targets
Comment out the <XamarinTelemetry ... />
Save file and rebuild the solution.
Though it does work in the interim, please forward your official feedback on the official VS Developer Community thread in the link below.
https://developercommunity.visualstudio.com/t/Unexpecter-error-of-task-Xamarin-Teleme/10096527
https://developercommunity.visualstudio.com/t/XamarinTelemetry-task-failed-unexpectedl/10100083
There are several config files in the VS installation which reference 13.0.0.0
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
I replaced these with
<bindingRedirect oldVersion="0.0.0.0-13.0.1.0" newVersion="13.0.1.0" />
and was able to build.
It seems that the 13.0.0.0 is not publicly available as nuget package...
In Visual Studio 17.3.0, I right-clicked on the projects and selected "Clean".
Then I tried again to right-click the project and selected "Build" and it worked, the "The XamarinTelemetry task failed unexpectedly" error did not occur.
This is in a solution that contains a .NET Standard 2.0 library that references Xamarin Forms and the project in question is an ASP.NET Core 3.1 API referencing the library.
There are fixed minor-version editions of VS available, for example "2022 LTSC 17.2".
Install it parallel to your current VS or exclusively.
https://learn.microsoft.com/en-us/visualstudio/releases/2022/release-history#evergreen-bootstrappers
Direct downloads:
Enterprise 2022 - 17.2 LTSC
Professional 2022 - 17.2 LTSC
Community is not available
I prefer this over the modification of your 17.3 installation.
It also appears with a different name, so it's easy to distinguish.
start menu
VS installer
I experienced this today and all I did was rebuild the solution, clicked the "save all", closed the application and opened it again but it did not work. I rebuilt the project but it did not work either. So again, I just repeat the process by closing the visual studio, rebuild and run 2 times (also I went to the error file just viewed it) and it works fine. I don't know what differences it made but it works when you repeat the process.
Edit: The error is still repeating. I just use the Factory Reset when the error occurs.
I had the exact same issue with my Xamarin forms solution, after upgrading from 17.2 to 17.3.
Today I installed 17.3.2. A dozen builds later and it seems that the issue has been addressed.
I'm battling paths in Fsharp and Mono on OSX. I have 2 questions:
Is there any way to make mono follow #I paths in Fsharp?
Is some way that I may include the dll in the exe, such that files compiled on one machine may run on another without having to duplicate installation of packages?
Example of the problem is the following: I've installed MathNet.Numerics in a local directory "packages" one level above my source directory using nugget.exe. Running the example:
#I "../packages/MathNet.Numerics.3.6.0/lib/net40/"
#r "MathNet.Numerics.dll"
open MathNet.Numerics
let v = SpecialFunctions.Gamma(0.5)
printfn "%g" v
followed by ";;" gives
...
1.77245
val v : float = 1.772453851
val it : unit = ()
while, when placed in the file monoIgnoresPaths.fsx, I have to also tell mono, where the dll is:
Solsikke:src sporring$ mono --version
Mono JIT compiler version 3.12.0 ((detached/a813491 Thu Dec 11 12:24:44 EST 2014)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS: normal
SIGSEGV: altstack
Notification: kqueue
Architecture: x86
Disabled: none
Misc: softdebug
LLVM: yes(3.6.0svn-mono-(detached/5486eb2)
GC: sgen
Solsikke:src sporring$ echo $MONO_PATH
Solsikke:src sporring$ fsharpc monoIgnoresPaths.fsx
F# Compiler for F# 3.1 (Open Source Edition)
Freely distributed under the Apache 2.0 Open Source License
Solsikke:src sporring$ mono monoIgnoresPaths.exe
Unhandled Exception:
System.IO.FileNotFoundException: Could not load file or assembly 'MathNet.Numerics, Version=3.6.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
File name: 'MathNet.Numerics, Version=3.6.0.0, Culture=neutral, PublicKeyToken=null'
[ERROR] FATAL UNHANDLED EXCEPTION: System.IO.FileNotFoundException: Could not load file or assembly 'MathNet.Numerics, Version=3.6.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
File name: 'MathNet.Numerics, Version=3.6.0.0, Culture=neutral, PublicKeyToken=null'
Solsikke:src sporring$ export MONO_PATH=`pwd`/../packages/MathNet.Numerics.3.6.0/lib/net40/;
Solsikke:src sporring$ mono monoIgnoresPaths.exe
1.77245
Is this a bug in Mono?
Thanks, Jon
fsharpc ignores #I (by design), the directive is meant to be used only in fsharpi.
For your second question, you can use --standalone to compile all the references into the binary.
All:
For a project, we have to run mstest.exe from Visual Studio prompt commandline:
C:\Program Files\Microsoft Visual Studio 11.0\Common7\IDE\OutDir>"c:\Program Fil
es\Microsoft Visual Studio 10.0\Common7\IDE\MSTest.exe" /testcontainer:"C:\Progr
am Files\Microsoft Visual Studio 11.0\Common7\IDE\OutDir\blahblahCUITChrome.dll"
However, the above statement gives me the following error:
Microsoft (R) Test Execution Command Line Tool Version 10.0.30319.1
Copyright (c) Microsoft Corporation. All rights reserved.
Loading C:\Program Files\Microsoft Visual Studio 11.0\Common7\IDE\OutDir\blahblahC
UITChrome.dll...
C:\Program Files\Microsoft Visual Studio 11.0\Common7\IDE\OutDir\blahblahCUITChrom
e.dll
Unable to find assembly 'Microsoft.VisualStudio.QualityTools.CodedUITestFramewor
k, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
It's so strange, I've already ensured that the Microsoft.VisualStudio.QualityTools.CodedUITestFramework.dll exists in the following directory:
C:\Program Files\Microsoft Visual Studio 11.0\Common7\IDE\OutDir\
How should we rewrite the aforementioned MStest.exe command in such a way that it references the DLL containing the Microsoft.VisualStudio.QualityTools.CodedUITestFramework ?
Update:
I moved the above mstest command into a msbuild csproj file:
I also included the following reference tag:
<Reference Include="Microsoft.VisualStudio.QualityTools.CodedUITestFramework, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>"C:\Program Files\Microsoft Visual Studio 11.0\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.QualityTools.CodedUITestFramework.dll"</HintPath>
</Reference>
However, it still fails.
How should we references the DLL containing the Microsoft.VisualStudio.QualityTools.CodedUITestFramework ?
Thanks in advance
I have just installed Visual C++ 2010 Express on my laptop (running with Windows8) and I have created a new project (Win32 console Application).
VS 10 generates all the files, and when I build the solution I have the following message
1>------ Rebuild All started: Project: toDelete, Configuration: Debug Win32 ------
1> stdafx.cpp
1>c:\users\arthur\documents\visual studio 2010\projects\todelete\todelete\stdafx.h(10): fatal error C1083: Cannot open include file: 'stdio.h': No such file or directory
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
According to what I have read in other forums, I should have the file stdio.h (and others) in the directory
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include
It appears that this directory contains only a file srv.h
If my understanding is correct, Visual C++ Redistributable installs such files in this directory. I have reinstalled it without any change!
Could you please confirm that my understanding is correct, ie that the directory
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include
should contains files such as stdio.h and then do you have any idea how to get them???
Many thanks!
I'm trying to call IronRuby code from a C# Windows Phone application, but when I try to build the project, I get several errors.
All the tutorials are outdated, so I'm doing my best. I installed the Windows Phone SDK, then installed IronRuby, then created a C# application for Windows Phone (there was no IronRuby template).
Visual Studio didn't know where to find the IronRuby DLLs, so I browsed and added them manually. All the tutorials say to use Silverlight, but there is no longer a Silverlight template for Windows Phone Visual Studio 2012, and the Silverlight DLL generates its own spurious errors.
Code
https://github.com/mcandre/ios7crypt/tree/master/WindowsPhone
Trace
Warning 1 Reference to type 'System.Dynamic.IDynamicMetaObjectProvider' claims it is defined in 'c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\Profile\WindowsPhone71\System.Core.dll', but it could not be found c:\Program Files (x86)\IronRuby 1.1\Silverlight\bin\Microsoft.Scripting.dll IOS7Crypt
Warning 2 Reference to type 'System.Dynamic.IDynamicMetaObjectProvider' claims it is defined in 'c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\Profile\WindowsPhone71\System.Core.dll', but it could not be found c:\Program Files (x86)\IronRuby 1.1\Silverlight\bin\Microsoft.Scripting.dll IOS7Crypt
Warning 3 Reference to type 'System.Dynamic.IDynamicMetaObjectProvider' claims it is defined in 'c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\Profile\WindowsPhone71\System.Core.dll', but it could not be found c:\Program Files (x86)\IronRuby 1.1\Silverlight\bin\Microsoft.Scripting.dll IOS7Crypt
Warning 4 Reference to type 'System.Dynamic.IDynamicMetaObjectProvider' claims it is defined in 'c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\Profile\WindowsPhone71\System.Core.dll', but it could not be found c:\Program Files (x86)\IronRuby 1.1\Silverlight\bin\Microsoft.Scripting.dll IOS7Crypt
Warning 5 Reference to type 'System.Dynamic.IDynamicMetaObjectProvider' claims it is defined in 'c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\Profile\WindowsPhone71\System.Core.dll', but it could not be found c:\Program Files (x86)\IronRuby 1.1\Silverlight\bin\Microsoft.Scripting.dll IOS7Crypt
Error 6 Predefined type 'Microsoft.CSharp.RuntimeBinder.Binder' is not defined or imported C:\Users\andrew\Desktop\src\ios7crypt\WindowsPhone\IOS7Crypt\CSC IOS7Crypt
Error 7 Predefined type 'Microsoft.CSharp.RuntimeBinder.Binder' is not defined or imported C:\Users\andrew\Desktop\src\ios7crypt\WindowsPhone\IOS7Crypt\CSC IOS7Crypt
Error 8 Cannot define a class or member that utilizes 'dynamic' because the compiler required type 'System.Runtime.CompilerServices.DynamicAttribute' cannot be found. Are you missing a reference? C:\Users\andrew\Desktop\src\ios7crypt\WindowsPhone\IOS7Crypt\MainPage.xaml.cs 22 25 IOS7Crypt
Error 9 Cannot implicitly convert type 'Microsoft.Scripting.Hosting.ScriptRuntime' to 'Microsoft.Scripting.Hosting.ScriptEngine' C:\Users\andrew\Desktop\src\ios7crypt\WindowsPhone\IOS7Crypt\MainPage.xaml.cs 27 22 IOS7Crypt
Error 10 One or more types required to compile a dynamic expression cannot be found. Are you missing a reference? C:\Users\andrew\Desktop\src\ios7crypt\WindowsPhone\IOS7Crypt\MainPage.xaml.cs 33 27 IOS7Crypt
Error 11 One or more types required to compile a dynamic expression cannot be found. Are you missing a reference? C:\Users\andrew\Desktop\src\ios7crypt\WindowsPhone\IOS7Crypt\MainPage.xaml.cs 39 31 IOS7Crypt
Specs
IronRuby 1.1
Windows Phone Visual Studio 2012
Windows 8 Professional x64
MacBook Pro mid-2009