xamarin IOS: Warning: App failed to install+launch - c#

I am facing the issue below,hope some one will help me out.
I am Using visual studio 2019 to run the xamarin IOS project and paired to MAC succesfully, but the simulator has failed to launch the app and throws the exception below
System.Exception: Failed to launch the simulator: Could not find file
"/Users/user/Library/Caches/Xamarin/mtbs/builds/TigrinyaDictionary.iOS/f5727f6bbdd6a791c1a56d7c269a65ff/bin/iPhoneSimulator/Debug/TigrinyaDictionary.iOS.app/TigrinyaDictionary.iOS"
at Xamarin.Simulator.Core.Protocol.SimulatorClient.d__26.MoveNext()
in
E:\A_work\1703\s\Xamarin.Simulator.Core\Protocol\SimulatorClient.cs:line
293
--- End of stack trace from previous location where exception was thrown --- at
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task
task) at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task) at
System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at Xamarin.Simulator.Windows.App.d__19.MoveNext() in
E:\A_work\1703\s\Xamarin.Simulator.Windows\App.xaml.cs:line 340
ErrorCode: 1008

It sounds like your build wasn't completed successfully (errors) and the produced App bundle is incorrect.
I would check the build logs to see if there are any errors (for issue like this please always give your full verbose build logs).
I would check the App bundle on the Mac: /Users/user/Library/Caches/Xamarin/mtbs/builds/TigrinyaDictionary.iOS. Check for completeness.
You should be able to trace back in the build log where and why that
wasn't generated (built).
I would install the latest bits of Visual Studio and the Xamarin Support, clean your project, rebuild and re-deploy.
If none of that works, you can report a problem directly in the IDE and that will open a feedback ticket with the Xamarin team.
Please add your full build logs (critical for an issue like this), ideally test project to reproduce and all product version information.

Related

MSAL.Desktop.4.36.0.0.MsalServiceException: User canceled authentication 'ErrorCode: authentication_canceled' while running WPF on Windows Server 2016

I am trying to read teams user status from WPF Desktop application. For that, I am using Microsoft.Identity.Client - 4.36.0v, Microsoft.Identity.Client.Desktop-4.36.0v to get token to access MS Graph api's.
My Application works perfectly in local machine which runs on Windows 10. When I moved the sources to VM which runs on Windows server 2016, It gives 'MsalServiceException: User canceled authentication' on the below code. Account picker is blinking and vanishing. I haven't cancel anything.
authResult = await app.AcquireTokenInteractive(scopes) .WithAccount(accounts.FirstOrDefault()) .WithPrompt(Prompt.SelectAccount) .ExecuteAsync();
MSAL.Desktop.4.36.0.0.MsalServiceException:
ErrorCode: authentication_canceled
Microsoft.Identity.Client.MsalServiceException: Broker response returned error: User canceled authentication.
at Microsoft.Identity.Client.Internal.Broker.BrokerInteractiveRequestComponent.ValidateResponseFromBroker(MsalTokenResponse msalTokenResponse)
at Microsoft.Identity.Client.Internal.Broker.BrokerInteractiveRequestComponent.<FetchTokensAsync>d__9.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Identity.Client.Internal.Requests.InteractiveRequest.<FetchTokensFromBrokerAsync>d__10.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Identity.Client.Internal.Requests.InteractiveRequest.<GetTokenResponseAsync>d__11.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Identity.Client.Internal.Requests.InteractiveRequest.<ExecuteAsync>d__8.MoveNext()
Please help me to fix this.
Please Check for these Possible work arounds
Msal exception
If the user closes the process or if they hit the browser back button, MSAL generates an error : authentication_canceled .
You may try inform the user when that happens :Reference
Also see this thread
Error Faulting application name: ....
Reason for this error varies from one scenario to other. check few listed among them below.
Set Enable 32-Bit Applications:
If deploying a 32-bit (x86) app, set the value to True otherwise set it to false if it is 64 bit. reference
CHECK
If You have latest Azure SDK and correct dll references. e.g. Make sure that if you have version 4.0, all references use same version. Remove any unnecessary references from the project.
All references (including packages and own libraries) are enabled with "Copy Local" = True and they are included in the package bin /assemblies.
Try to uninstall and reinstall packages from NuGet for ex: Azure Caching package
Check the connection strings and validity of keys, in case of storage.
Check whether service configuration has correct osFamily (ex :3) and osVersion that you are targeting in ServiceConfiguration.Cloud.cscfg are compatible
Otherwise try intelliTrace.
Temporarily disable "Lazy Initialization" under IntelliTrace Settings -> IntelliTrace Events. Reference

Publish Single File (Release) fails for WPF .NET Core 3.1 application

I'm trying to publish a WPF Application (to a folder) targeting .NET Core 3.1, using Publish Single File, targeting win-x86. The application publishes fine for Debug, but fails for Release. If I deselect Produce Single File, the publish works fine. I'm using Visual Studio 2019 (16.4.1 and preview 16.5.1)
I get this generic error when I publish:
Publish has encountered an error. Publish has encountered an error. We
were unable to determine the cause of the error. Check the output log
for more details.
A diagnostic log has been written to the following location:
"C:\Users\username\AppData\Local\Temp\tmpD176.tmp"
Plus a not-so-helpful log file:
System.AggregateException: One or more errors occurred. ---> System.Exception: Publish has encountered an error. We were unable to determine the cause of the error. Check the output log for more details.
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at Microsoft.Publish.Framework.Model.DefaultPublishSteps.<>c__DisplayClass26_0.<IsBuildCompletedSuccessfully>b__2()
at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Publish.Framework.Model.DefaultPublishSteps.<DefaultCorePublishStep>d__23.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Publish.Framework.ViewModel.ProfileSelectorViewModel.<RunPublishTaskAsync>d__156.MoveNext()
---> (Inner Exception #0) System.Exception: Publish has encountered an error. We were unable to determine the cause of the error. Check the output log for more details. <---
System.Exception: Publish has encountered an error. We were unable to determine the cause of the error. Check the output log for more details.
I found this question that suggests that it might be an issue with Visual Studio timing out, though that issue is related to Azure. I also found this Github issue that showed a similar when I tried publishing with ReadyToRun.
We published with success a few weeks ago, with minimal changes. Could this be an issue with Visual Studio? I realize that this may be an issue with references and NuGet packages, but I don't really know where to start to get to the core of this issue... publishing doesn't provide any helpful information on what might be causing the issue. Any ideas?
I had the same problem with a WPF application :
VS2019 16.3 and dotnet Core 3.0 - publish worked fine.
Updated to VS2019 16.4.1 and dotnet Core 3.1 - publish failed as described.
Only difference is I am targeting X64.
After multiple attempts editing the publish FolderProfile (none of which fixed the problem), I deleted the FolderProfile completely and created a new one targeting a different folder.
Publish works again.
Hope this helps.
I am getting the same issue, but I think mine is related to the project not even being able to build when I set "PublishSingleFile".
I added a comment to their github issue post, assuming that it's a bug on their end since .net core 3.0 is publishing for me fine.
For me the error has to do with custom nuget sources, like Azure DevOps Artifacts.
Sometimes the build script tries to restore nugets from Azure DevOps and fails with a (Unauthorized) error, which produces the error in the post.
Temporarily disabling the custom nuget sources, makes publish work again regardless of the options used like single file.
i have a same problem, in my case the solution is delete some dll of X86 system from .csproj file :
<ItemGroup>
<Reference Include="System.Management">
<HintPath>..\..\..\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\System.Management.dll</HintPath>
</Reference>
</ItemGroup>
It is worth checking your Internet connection. I had a problem publishing self-contained deployment, because I was behind corporate firewall. Same error as yours:
Publish has encountered an error. We were unable to determine the
cause of the error. Check the output log for more details.
And nothing more informative in that log file. After I disconnected VPN app was published with no errors.
I had this same issue when i publish my application also. And the weird thing is it solved when i added this to my package reference in .csproj file
<PackageReference Include="EFCore.BulkExtensions" Version="5.2.8" />
After adding this package reference, when i rebuild and publish, it is working.

ASP.NET Core 2.1 App succeeds in Building and Running Locally but fails to Publish to IIS via Web Deploy

I have a .NET Core 2.1 App that I want to publish on IIS8 via WebDeploy. When I publish, this is the error I get:
Severity Code Description Project File Line Suppression State
Error Web deployment task failed. ((1/15/2019 2:18:40 PM) An error occurred when the request was processed on the remote computer.)
(1/15/2019 2:18:40 PM) An error occurred when the request was
processed on the remote computer. The server experienced an issue
processing the request. Contact the server administrator for more
information. ManagementStudio C:\Program
Files\dotnet\sdk\2.1.503\Sdks\Microsoft.NET.Sdk.Publish\build\netstandard1.0\PublishTargets\Microsoft.NET.Sdk.Publish.MSDeploy.targets 139
I tried looking around and found this in the temp file
1/15/2019 3:01:59 PM System.AggregateException: One or more errors
occurred. ---> System.Exception: Build failed. Check the Output window
for more details. --- End of inner exception stack trace --- at
System.Threading.Tasks.Task.ThrowIfExceptional(Boolean
includeTaskCanceledExceptions) at
System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout,
CancellationToken cancellationToken) at
Microsoft.VisualStudio.Web.Publish.PublishService.VsWebProjectPublish.<>c__DisplayClass43_0.b__2()
at System.Threading.Tasks.Task`1.InnerInvoke() at
System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown --- at
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task
task) at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task) at
Microsoft.VisualStudio.ApplicationCapabilities.Publish.ViewModel.ProfileSelectorViewModel.d__127.MoveNext()
---> (Inner Exception #0) System.Exception: Build failed. Check the Output window for more details.<---
===================
I'm not sure what I'm doing wrong? I can run it locally but am I missing something? I've looked around and it seems like this error doesn't happen often?
I solved this problem just by updating the "TypeScript SDK for Visual Studio 2017" from
https://www.microsoft.com/en-us/download/details.aspx?id=55258

Xamarin.Forms Errors (ADB0000:Value Cannot be null)

What does this even mean? I had my program running and deploying fine and then the next day this error popped up?
Severity Code Description Project File Line Suppression State Tool
Error ADB0000: Value cannot be null. Parameter name: path2 at
System.IO.Path.Combine(String path1, String path2, String path3) at
Xamarin.AndroidTools.PlatformPackage.GetVersionInfo(String
frameworkVersion) at
Xamarin.AndroidTools.PlatformPackage.GetPlatformPackageVersion(Int32
apiLevel, String& packageName) at
AndroidDeviceExtensions.d__33.MoveNext()
--- End of stack trace from previous location where exception was thrown --- at
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task
task) at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task) at AndroidDeviceExtensions.d__27.MoveNext()
--- End of stack trace from previous location where exception was thrown --- at
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task
task) at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task) at
Xamarin.AndroidTools.AndroidDeploySession.d__101.MoveNext()
--- End of stack trace from previous location where exception was thrown --- at
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task
task) at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task) at
Xamarin.AndroidTools.AndroidDeploySession.d__99.MoveNext()
0
I was trying to follow an online YouTube tutorial (https://www.youtube.com/watch?v=eAZ4kPf5eTc) and it worked fine until I got this error?
I just had the same issue. The fix for me was:
In Android emulator hold the app icon and move it to uninstall. Rebuild, deploy and run from VS 2017.
Updating nuget fixed my problem. For me root cause was Xamarin forms was not working due to the older versions of xamarin dlls. I updated all the dlls and worked.
I had the same issue, Here is how i fix this error
1-Delete bin and obj folder from all projects.
2-clean and rebuild whole project.
3- Uninstall the app from emulator (device).
Run the project.
Go to developer settings and disable verify apps via USB. Then you can install .apk without any problem.
Close VS
Delete bin directory
clean solution
Rebuild Solution

Is it possible to use visual studio performance profiling with service fabric?

Hopefully this is simple...
I want to performance profile my service fabric cluster.
So far I:
- Go to Start Diagnostics tools without debugging.
- Go through the wizard selecting my service fabric project as the startup project.
- Then it asks which projects to include, so I include my service exe
- Then I select instrumentation (I want method level timing)
Then I hit start and immediately my exe crashes. I assume this is because visual studio is trying to run my "service" outside of the service fabric context as a standalone exe.
Not sure what to do about that though...
The stack trace is:
DEBUG: Activating options
Unhandled Exception: System.Fabric.FabricConnectionDeniedException: Not authorized to connect ---> System.Runtime.InteropServices.COMException: Exception from HRESULT: 0x80071C43
at System.Fabric.Interop.NativeRuntime.FabricEndGetNodeContext(IFabricAsyncOperationContext context)
at System.Fabric.FabricRuntime.NativeFabricRuntimeFactory.GetNodeContextEndWrapper(IFabricAsyncOperationContext context)
at System.Fabric.Interop.AsyncCallOutAdapter2`1.Finish(IFabricAsyncOperationContext context, Boolean expectedCompletedSynchronously)
--- End of inner exception stack trace ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.ServiceFabric.Services.Runtime.RuntimeContext.d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.ServiceFabric.Services.Runtime.ServiceRuntime.d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
Thanks for the help in advance!
What you're seeing is Visual Studio attempting to start your service host process on its own outside of the Service Fabric runtime. Normally, when you run a service through Visual Studio, you deploy the application project, which goes through the process of registering and instantiating your services on your local Service Fabric cluster.
Instrumentation currently doesn't work out-of-the-box with Service Fabric projects for this reason. We're looking at ways to make this possible in the future.
You can still do Sampling profiling, which allows you to attach the profiler to a running EXE. In that case, you'd deploy your application normally first, then attach the profiler to your service EXEs.
See https://msdn.microsoft.com/en-us/library/dd255414.aspx?f=255&MSPPError=-2147217396
If needed, initialize the profiling environment variables with a variant of VSPerfClrEnv {/globalsamplegc | /globalsamplegclife}[/samplelineoff], then reboot.
Start the profiler to collect data with a variant of:
VSPerfCmd
/START:{COVERAGE|SAMPLE|CONCURRENCY|TRACE}
/OUTPUT:file
/ATTACH:(pid|name)[,(pid|name)]*
[/USER:[domain\]username]
The /USER:[domain\]username is needed if the service or process is running under a different user account.
A .vspx or .vsp file extension is added to the /OUPUT:file specification. Then you can open the .vspx or .vsp file in Visual Studio to view the profiling report.
Run VSPerfCmd /? for more explanation and to see the full list of profiling options.

Categories