Mono.Linker.MarkException: Error processing method: 'System.Byte[] - visual-studio

Im getting this error when i compile the project dont know what refers to..
im trying to conver an image to a byte array so i can save it to a database
i've updated the versions and nothing happens
Error Mono.Linker.MarkException: Error processing method: 'System.Byte[] HeavenTaste.NuevaOrden::converterDemo(Xamarin.Forms.Image)' in assembly: 'HeavenTaste.dll' ---> Mono.Cecil.ResolutionException: Failed to resolve System.Void System.Drawing.ImageConverter::.ctor()
at Mono.Linker.Steps.MarkStep.HandleUnresolvedMethod(MethodReference reference)
at Mono.Linker.Steps.MarkStep.MarkMethod(MethodReference reference)
at Mono.Linker.Steps.MarkStep.MarkInstruction(Instruction instruction)
at Mono.Linker.Steps.MarkStep.MarkMethodBody(MethodBody body)
at Mono.Linker.Steps.MarkStep.ProcessMethod(MethodDefinition method)
at Mono.Linker.Steps.MarkStep.ProcessQueue()
--- End of inner exception stack trace ---
at Mono.Linker.Steps.MarkStep.ProcessQueue()
at Mono.Linker.Steps.MarkStep.ProcessPrimaryQueue()
at Mono.Linker.Steps.MarkStep.Process()
at Mono.Linker.Steps.MarkStep.Process(LinkContext context)
at MonoDroid.Tuner.MonoDroidMarkStep.Process(LinkContext context)
at Mono.Linker.Pipeline.ProcessStep(LinkContext context, IStep step)
at Mono.Linker.Pipeline.Process(LinkContext context)
at MonoDroid.Tuner.Linker.Process(LinkerOptions options, ILogger logger, LinkContext& context)
at Xamarin.Android.Tasks.LinkAssemblies.Execute(DirectoryAssemblyResolver res)
at Xamarin.Android.Tasks.LinkAssemblies.RunTask()
at Microsoft.Android.Build.Tasks.AndroidTask.Execute() in /Users/runner/work/1/s/xamarin-android/external/xamarin-android-tools/src/Microsoft.Android.Build.BaseTasks/AndroidTask.cs:line 17 HeavenTaste.Android C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Xamarin\Android\Xamarin.Android.Legacy.targets 648

private async void btnGuardar(object sender, EventArgs e)
{
await DisplayAlert("",converterDemo(Vistaprevia).ToString(),"OK");
}
public byte[] converterDemo(Xamarin.Forms.Image x)
{
ImageConverter _imageConverter = new ImageConverter();
byte[] xByte = (byte[])_imageConverter.ConvertTo(x, typeof(byte[]));
return xByte;
}

Related

Error processing method: shareFileAsync during release buid

I'm having this problem in the compilation on Android.
When I use the method:
await Share.RequestAsync (new ShareFileRequest
{
Title = "Shared File:" + nameFile,
File = new ShareFile (fullPathFile)
});
I get this error
Mono.Linker.MarkException: Error processing method: 'System.Void WorkFlow2.Services.Utility/<shareFileAsync>d__8::MoveNext()' in assembly: 'WorkFlow2.dll' ---> Mono.Cecil.ResolutionException: Failed to resolve System.Void Xamarin.Essentials.ShareRequestBase::set_Title(System.String)
in Mono.Linker.Steps.MarkStep.HandleUnresolvedMethod(MethodReference reference)
in Mono.Linker.Steps.MarkStep.MarkMethod(MethodReference reference)
in Mono.Linker.Steps.MarkStep.MarkInstruction(Instruction instruction)
in Mono.Linker.Steps.MarkStep.MarkMethodBody(MethodBody body)
in Mono.Linker.Steps.MarkStep.ProcessMethod(MethodDefinition method)
in Mono.Linker.Steps.MarkStep.ProcessQueue()
--- Fine della traccia dello stack dell'eccezione interna ---
in Mono.Linker.Steps.MarkStep.ProcessQueue()
in Mono.Linker.Steps.MarkStep.ProcessPrimaryQueue()
in Mono.Linker.Steps.MarkStep.Process()
in Mono.Linker.Steps.MarkStep.Process(LinkContext context)
in MonoDroid.Tuner.MonoDroidMarkStep.Process(LinkContext context)
in Mono.Linker.Pipeline.ProcessStep(LinkContext context, IStep step)
in Mono.Linker.Pipeline.Process(LinkContext context)
in MonoDroid.Tuner.Linker.Process(LinkerOptions options, ILogger logger, LinkContext& context)
in Xamarin.Android.Tasks.LinkAssemblies.Execute(DirectoryAssemblyResolver res)
in Xamarin.Android.Tasks.LinkAssemblies.RunTask()
in Xamarin.Android.Tasks.AndroidTask.Execute() WorkFlow2.Android
This error returns at compile time for the release.
During the "debug" phase it works correctly.

Visual Studio Docker HTTPS setup fails

I am trying to get a project running with the new visual studio 2019 on mac.
However, I am getting the following error.
Application startup exception: Autofac.Core.DependencyResolutionException: An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = KestrelServer (ReflectionActivator), Services = [Microsoft.AspNetCore.Hosting.Server.IServer], Lifetime = Autofac.Core.Lifetime.RootScopeLifetime, Sharing = Shared, Ownership = OwnedByLifetimeScope ---> An exception was thrown while invoking the constructor 'Void .ctor(Microsoft.Extensions.Options.IOptions`1[Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerOptions], Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions.Internal.ITransportFactory, Microsoft.Extensions.Logging.ILoggerFactory)' on type 'KestrelServer'. ---> error:2006D080:BIO routines:BIO_new_file:no such file (See inner exception for details.) (See inner exception for details.) ---> Autofac.Core.DependencyResolutionException: An exception was thrown while invoking the constructor 'Void .ctor(Microsoft.Extensions.Options.IOptions`1[Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerOptions], Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions.Internal.ITransportFactory, Microsoft.Extensions.Logging.ILoggerFactory)' on type 'KestrelServer'. ---> error:2006D080:BIO routines:BIO_new_file:no such file (See inner exception for details.) ---> Interop+Crypto+OpenSslCryptographicException: error:2006D080:BIO routines:BIO_new_file:no such file
at Interop.Crypto.CheckValidOpenSslHandle(SafeHandle handle)
at Internal.Cryptography.Pal.CertificatePal.FromFile(String fileName, SafePasswordHandle password, X509KeyStorageFlags keyStorageFlags)
at System.Security.Cryptography.X509Certificates.X509Certificate..ctor(String fileName, String password, X509KeyStorageFlags keyStorageFlags)
at Microsoft.AspNetCore.Hosting.ListenOptionsHttpsExtensions.UseHttps(ListenOptions listenOptions, String fileName, String password)
at Identity.API.Program.<>c.<BuildWebHost>b__1_3(ListenOptions listenOptions) in /Users/pp/www/amritaDEV/appraisals/Amrita/src/Services/Identity/Identity/Program.cs:line 56
at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerOptions.Listen(IPEndPoint endPoint, Action`1 configure)
at Identity.API.Program.<>c.<BuildWebHost>b__1_0(KestrelServerOptions options) in /Users/pp/www/amritaDEV/appraisals/Amrita/src/Services/Identity/Identity/Program.cs:line 54
at Microsoft.Extensions.Options.OptionsFactory`1.Create(String name)
at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
at System.Lazy`1.CreateValue()
at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServer.CreateServiceContext(IOptions`1 options, ILoggerFactory loggerFactory)
at lambda_method(Closure , Object[] )
at Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate()
--- End of inner exception stack trace ---
at Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate()
at Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters)
at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters)
--- End of inner exception stack trace ---
at Autofac.Core.Lifetime.LifetimeScope.GetOrCreateAndShare(Guid id, Func`1 creator)
at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters)
at Autofac.Core.Resolving.InstanceLookup.Execute()
at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable`1 parameters)
at Autofac.Core.Resolving.ResolveOperation.Execute(IComponentRegistration registration, IEnumerable`1 parameters)
at Autofac.ResolutionExtensions.TryResolveService(IComponentContext context, Service service, IEnumerable`1 parameters, Object& instance)
at Autofac.ResolutionExtensions.ResolveService(IComponentContext context, Service service, IEnumerable`1 parameters)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
at Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureServer()
at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()
crit: Microsoft.AspNetCore.Hosting.Internal.WebHost[6]
Application startup exception
I have been doing: https://github.com/aspnet/AspNetCore.Docs/issues/6199
and i completed the steps but got the following error. Something with the certificates, names or places maybe?
I am on Visual Studio 8. Visual Studio 7 didn't have HTTPS problem for localhost

My Xamarin.Android app can't be started anymore via intent

A few months ago my app was working fine when it gets started by an intent from another app.
Now when my app gets started via intent I get the error:
03-21 12:00:43.096 Google Pixel 3 XL Info 1234 ActivityManager Showing crash dialog for package com.comp.myapp u0
03-21 12:00:43.085 Google Pixel 3 XL Error 5860 AndroidRuntime --- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__6_0 (System.Object state) [0x00000] in <c282b05120ba4b698b1a1e9d68af4131>:0
at Android.App.SyncContext+<>c__DisplayClass2_0.<Post>b__0 () [0x00000] in <e2a51596e3434d12a5bd106b9a0f0644>:0
at Java.Lang.Thread+RunnableImplementor.Run () [0x00008] in <e2a51596e3434d12a5bd106b9a0f0644>:0
at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) [0x00009] in <e2a51596e3434d12a5bd106b9a0f0644>:0
at (wrapper dynamic-method) System.Object.6(intptr,intptr)
at mono.java.lang.RunnableImplementor.n_run(Native Method)
at mono.java.lang.RunnableImplementor.run(RunnableImplementor.java:30)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6718)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Force finishing activity com.comp.myapp/md5ac266b5641403f314bbc23831457c9e5.MainActivity
This crash seems to happen before my app runs the OnCreate() method as I don't find what I log via Log.Debug() in LogCat.
My app works without problems, when I start it directly. In that state it also has no problems taking intents from other apps and processing them appropriately.
It turned out that my OnCreate method wasn't started because it was:
async public override void OnCreate(Bundle savedInstanceState, PersistableBundle persistentState)
{
instead of
async protected override void OnCreate(Bundle savedInstanceState)
{

Xamarin Android crashing with Xamarin.Auth

I'm using Xamarin.Auth to log into Facebook. I created a separate Renderer for iOS and Android.
In the auth.Completed I call a method AfterLogin(UserInfo) in the PCL class of the custom renderer. This does some additional work and then calls
App.Current.MainPage = new NavigationPage(new MainPage());
It looks like the page is constructed correctly and all methods return correctly until an Exception Unhandled gets thrown. The only text is "An unhandled exception occured."
In iOS, everything works fine. It calls the exact same PCL code.
I have no idea what view it is referring to.
Edit
Stack trace from ADB
I/MonoDroid(11638): UNHANDLED EXCEPTION:
I/MonoDroid(11638): Java.Lang.IllegalArgumentException: No view found for id 0x4 (unknown) for fragment FragmentContainer{436fa3e8 #0 id=0x4}
I/MonoDroid(11638): at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <d18287e1d683419a8ec3216fd78947b9>:0
I/MonoDroid(11638): at Java.Interop.JniEnvironment+InstanceMethods.CallBooleanMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniMethodInfo method) [0x00068] in <5716a943049b49ca928a3a1c8d2386f4>:0
I/MonoDroid(11638): at Android.Runtime.JNIEnv.CallBooleanMethod (System.IntPtr jobject, System.IntPtr jmethod) [0x0000e] in <33e6e739ac344166b157e323586f11a1>:0
I/MonoDroid(11638): at Android.Support.V4.App.FragmentManagerInvoker.ExecutePendingTransactions () [0x00033] in <7e083afc7c9045f59e01d9c14931060d>:0
I/MonoDroid(11638): at Xamarin.Forms.Platform.Android.AppCompat.NavigationPageRenderer.Dispose (System.Boolean disposing) [0x00083] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\AppCompat\NavigationPageRenderer.cs:135
I/MonoDroid(11638): at Java.Lang.Object.Dispose () [0x00000] in <33e6e739ac344166b157e323586f11a1>:0
I/MonoDroid(11638): at Xamarin.Forms.Platform.Android.AppCompat.Platform.SetPage (Xamarin.Forms.Page newRoot) [0x0003f] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\AppCompat\Platform.cs:226
I/MonoDroid(11638): at Xamarin.Forms.Platform.Android.FormsAppCompatActivity.InternalSetPage (Xamarin.Forms.Page page) [0x0001a] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\AppCompat\FormsAppCompatActivity.cs:370
I/MonoDroid(11638): at Xamarin.Forms.Platform.Android.FormsAppCompatActivity.AppOnPropertyChanged (System.Object sender, System.ComponentModel.PropertyChangedEventArgs args) [0x00012] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\AppCompat\FormsAppCompatActivity.cs:321
I/MonoDroid(11638): at Xamarin.Forms.BindableObject.OnPropertyChanged (System.String propertyName) [0x0000a] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Core\BindableObject.cs:136
I/MonoDroid(11638): at Xamarin.Forms.Element.OnPropertyChanged (System.String propertyName) [0x00000] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Core\Element.cs:380
I/MonoDroid(11638): at Xamarin.Forms.Application.set_MainPage (Xamarin.Forms.Page value) [0x0008b] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Core\Application.cs:90
I/MonoDroid(11638): at App.App.Instance_DataIsReady (System.Object sender, App.EventArguments.DataIsReadyEventArgs e) [0x0004d] in <9b95d86146df403c82b64e5a8ab6a9cf>:0
I/MonoDroid(11638): at (wrapper delegate-invoke) <Module>:invoke_void_object_DataIsReadyEventArgs (object,App.EventArguments.DataIsReadyEventArgs)
I/MonoDroid(11638): at App.DataCache.OnDataIsReady (App.EventArguments.DataIsReadyStates state) [0x0001b] in <9b95d86146df403c82b64e5a8ab6a9cf>:0
I/MonoDroid(11638): at App.DataCache.set_PlayerWinnings (System.Collections.Generic.IEnumerable`1[T] value) [0x00012] in <9b95d86146df403c82b64e5a8ab6a9cf>:0
I/MonoDroid(11638): at App.DataCache+<RefreshData>d__37.MoveNext () [0x00351] in <9b95d86146df403c82b64e5a8ab6a9cf>:0
I/MonoDroid(11638): --- End of stack trace from previous location where exception was thrown ---
Which version of Xamarin.Auth?
Why implementing Xamarin.Forms support if it is already in the library itself since version 1.5.0?
And for more help we'll need more info from your side (and your code)...
The issue turned out to be that MainPage was being assigned to twice. It wasn't related to Auth.

Webdeploy System.Runtime.Serialization.SerializationException: Member 'ClassName' was not found

When im doing a webdeploy at visual studio 2012 and select the option update database I get the following error at my server log:
User:
Client IP: xxxx
Content-Type: application/msdeploy
Version: 9.0.0.0
MSDeploy.VersionMin: 7.1.600.0
MSDeploy.VersionMax: 9.0.1631.0
MSDeploy.Method: Sync
MSDeploy.RequestId: 36abe7a7-87e3-4ffb-a46f-b5918da1e651
MSDeploy.RequestCulture: nl-NL
MSDeploy.RequestUICulture: en-US
ServerVersion: 9.0.1631.0
Skip: objectName="^configProtectedData$"
Provider: auto, Path:
A tracing deployment agent exception occurred that was propagated to the client. Request ID '36abe7a7-87e3-4ffb-a46f-b5918da1e651'. Request Timestamp: '1-10-2012 17:39:41'. Error Details:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.Serialization.SerializationException: Member 'ClassName' was not found.
at System.Runtime.Serialization.SerializationInfo.GetElement(String name, Type& foundType)
at System.Runtime.Serialization.SerializationInfo.GetString(String name)
at System.Exception..ctor(SerializationInfo info, StreamingContext context)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle._SerializationInvoke(Object target, SignatureStruct& declaringTypeSig, SerializationInfo info, StreamingContext context)
at System.Runtime.Serialization.ObjectManager.CompleteISerializableObject(Object obj, SerializationInfo info, StreamingContext context)
at System.Runtime.Serialization.ObjectManager.FixupSpecialObject(ObjectHolder holder)
at System.Runtime.Serialization.ObjectManager.DoFixups()
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, IMethodCallMessage methodCallMessage)
at Microsoft.Web.Deployment.Base64EncodingHelper.DeserializeHelper(BinaryFormatter formatter, Byte[] buffer)
at Microsoft.Web.Deployment.Base64EncodingHelper.Deserialize(String str, Exception& handledException)
at Microsoft.Web.Deployment.SerializationHelper.Deserialize(String str)
at Microsoft.Web.Deployment.SqlDacPacProvider.ProcessExeOutput()
at Microsoft.Web.Deployment.SqlDacPacProvider.RunExecutableAsync(String exeName, String arguments, Int32 waitInterval, Int32 retryAttempts)
at Microsoft.Web.Deployment.SqlDacPacProvider.Add(DeploymentObject source, Boolean whatIf)
at Microsoft.Web.Deployment.DeploymentObject.Add(DeploymentObject source, DeploymentSyncContext syncContext)
at Microsoft.Web.Deployment.DeploymentSyncContext.HandleAdd(DeploymentObject destObject, DeploymentObject sourceObject)
at Microsoft.Web.Deployment.DeploymentSyncContext.SyncChildren(DeploymentObject dest, DeploymentObject source)
at Microsoft.Web.Deployment.DeploymentSyncContext.SyncChildrenOrder(DeploymentObject dest, DeploymentObject source)
at Microsoft.Web.Deployment.DeploymentSyncContext.ProcessSync(DeploymentObject destinationObject, DeploymentObject sourceObject)
at Microsoft.Web.Deployment.DeploymentObject.SyncToInternal(DeploymentObject destObject, DeploymentSyncOptions syncOptions, PayloadTable payloadTable, ContentRootTable contentRootTable, Nullable`1 syncPassId)
at Microsoft.Web.Deployment.DeploymentAgent.HandleSync(DeploymentAgentAsyncData asyncData, Nullable`1 passId)
at Microsoft.Web.Deployment.DeploymentAgent.HandleRequestWorker(DeploymentAgentAsyncData asyncData)
at Microsoft.Web.Deployment.DeploymentAgent.HandleRequest(DeploymentAgentAsyncData asyncData)
What might be causing this issue?
The error Visual studio gives me is:
Error 2 Web deployment task failed. ((1-10-2012 18:54:34) An error occurred when the request was processed on the remote computer.)
(1-10-2012 18:54:34) 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. 0 0 Database
--FIX--
For some reason my installation of Webdeploy 3 did not work well (tried reinstalling too) with ms authentication, created a sql auth connectionstring and it resolved the issue.

Resources