Mysql with version higher than the project (C# WPF) - c#

I picked up an old project to use my kinnect, but I need MySql for this application, so I tried to insert MySql.dll into this project, but I am getting this error.
Gravidade Código Descrição Projeto Arquivo Linha Estado de Supressão
Aviso Não foi possível resolver a referência primária "MySql.Data, Version=8.0.25.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL" porque ela tem uma dependência indireta no assembly de estrutura "System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", que não pôde ser resolvida na estrutura de destino atual. ".NETFramework,Version=v4.0,Profile=Client". Para resolver o problema, remova a referência "MySql.Data, Version=8.0.25.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL" ou redirecione o aplicativo para uma versão de estrutura que contenha "System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a". ShapeGame
Gravidade Código Descrição Projeto Arquivo Linha Estado de Supressão
Aviso A referência primária "MySql.Data, Version=8.0.25.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL" não pôde ser resolvida porque foi compilada com base na estrutura ".NETFramework,Version=v4.5.2". Esta versão é superior à da estrutura de destino ".NETFramework,Version=v4.0,Profile=Client". ShapeGame
I can use MySql in this version of NET? I believe if I change other libraries does not work

You appear to be targeting the .NET 4.0 Client Profile. This is very old (over ten years), so for compatibility you'll also need to use a very old version of MySql.Data.
It looks like MySql.Data 6.9.12 should be compatible with .NET 4.0, although it still may not work with the Client Profile. (The Client Profile is targeted at desktop client applications, but MySQL is typically used by server-side applications.)
If it doesn't work, try an even older version of MySql.Data.
If you want to use the latest MySql.Data, you will also need to use a much more recent version of the .NET Framework.

Related

Can't deploy to FTP with port 22 in Visual Studio

I am trying to publish a project in Visual Studio 2019, pointing to port 22 (since I will use a linux environment later)
I followed the steps of:
https://es.stackoverflow.com/questions/239559/error-al-compilar-proyecto-aspx-en-visual-studio and
https://www.a2hosting.com/kb/a2-hosting-products/windows-hosting/publish-a-site-from-visual-studio-using-ftps
So to summarize:
start in administrator mode
enable the FTP and IIS options
I put in front of my URL both ftps and 990
I ping the IP and it is active and without problems
but I still get the same error that I can't connect to the server
Attached the error log
11/12/2020 13:36:22
System.AggregateException: Se han producido uno o varios errores. ---> System.Exception: Error de compilación. Compruebe la ventana de salida para obtener más detalles.
--- Fin del seguimiento de la pila de la excepción interna ---
en System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
en System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
en Microsoft.WebTools.Publish.PublishService.VsWebProjectPublish.<>c__DisplayClass43_0.<PublishAsync>b__3()
en System.Threading.Tasks.Task`1.InnerInvoke()
en System.Threading.Tasks.Task.Execute()
--- Fin del seguimiento de la pila de la ubicación anterior donde se produjo la excepción ---
en System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
en System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
en Microsoft.Publish.Framework.ViewModel.ProfileSelectorViewModel.<RunPublishTaskAsync>d__213.MoveNext()
---> (Nº de excepción interna 0) System.Exception: Error de compilación. Compruebe la ventana de salida para obtener más detalles.<---
System.Exception: Error de compilación. Compruebe la ventana de salida para obtener más detalles.
Port 22 is SFTP, not FTP(S). The FTPS and SFTP are two completely different protocols. You cannot use the FTP protocol to connect to an SFTP server.
I believe that Visual Studio does not support the SFTP.
See Visual Studio Publish Website Using SCP/SFTP

Error in Xamarin.Forms Release with Lottie/CacheStrategy

I am getting an error, when I try to deploy my android apk xamarin forms or when I compile release. it has to do with the library lottie cachestrategy
error follows.
Mono.Linker.MarkException: Error processing method: 'System.Void >XF.Material.Droid.Renderers.MaterialCircularLoadingViewRenderer::OnElementChanged>(Xamarin.Forms.Platform.Android.ElementChangedEventArgs`1)' in assembly: 'XF.Material.Droid.dll' ---> >Mono.Cecil.ResolutionException: Failed to resolve Com.Airbnb.Lottie.LottieAnimationView/CacheStrategy >Com.Airbnb.Lottie.LottieAnimationView/CacheStrategy::get_Strong()
en Mono.Linker.Steps.MarkStep.HandleUnresolvedMethod(MethodReference reference)
en Mono.Linker.Steps.MarkStep.MarkMethod(MethodReference reference)
en Mono.Linker.Steps.MarkStep.MarkInstruction(Instruction instruction)
en Mono.Linker.Steps.MarkStep.MarkMethodBody(MethodBody body)
en Mono.Linker.Steps.MarkStep.ProcessMethod(MethodDefinition method)
en Mono.Linker.Steps.MarkStep.ProcessQueue()
--- Fin del seguimiento de la pila de la excepción interna ---
en Mono.Linker.Steps.MarkStep.ProcessQueue()
en Mono.Linker.Steps.MarkStep.ProcessPrimaryQueue()
en Mono.Linker.Steps.MarkStep.Process()
en MonoDroid.Tuner.MonoDroidMarkStep.Process(LinkContext context)
en Mono.Linker.Pipeline.Process(LinkContext context)
en MonoDroid.Tuner.Linker.Process(LinkerOptions options, ILogger logger, LinkContext& context)
en Xamarin.Android.Tasks.LinkAssemblies.Execute(DirectoryAssemblyResolver res)
en Xamarin.Android.Tasks.LinkAssemblies.Execute()
en Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
en Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext() Amis.Reportes.Android
and option Linking is "Link SDK assemblies only"

System.IO.FileNotFoundException when trying to use/load Microsoft.Practices.EnterpriseLibrary.Common not found even when is included in references

I have a project that references the Microsoft.Practices.EnterpriseLibrary.Common assembly like this:
But when I try to run the project I amd getting and error on this line
The error that I am getting is:
Se produjo una excepción de tipo 'System.IO.FileNotFoundException' en
Sitefinity.DAO.dll pero no se controló en el código del usuario
Información adicional: No se puede cargar el archivo o ensamblado
'Microsoft.Practices.EnterpriseLibrary.Common, Version=5.0.414.0,
Culture=neutral, PublicKeyToken=null' ni una de sus dependencias. El
sistema no puede encontrar el archivo especificado.
What have I tried:
I have removed and added the reference again
I have checked that the Microsoft.Practices.EnterpriseLibrary.Common.dll is in the same folder as the Sitefinity.DAO.dll
How can I solve this ?

Can't run mvc 5 project locally in VS13 after system crash?

As the title says I can't run my project in debugging mode locally in vs13 (MVC 5).
I was playing around with an overclock on my stationary comp, which turned out not to be stable (despire stress testing) and my pc bluescreened and rebooted while I was running the project (I've reverted back to a stable OC again). Now I get the same error everytime I run this particular project.
The weird thing is I tried uninstalling vs13 completely (with the force feature) and reinstalling it after a reboot and still this particular project will not run locally at all. The same project works fine on my coworkers comps and on my own laptop, but somehow it refuses to run on my stationary pc and apparently a reinstall hasn't fixed anything?
The error message you can see here
Anyone got any clues or expert advice that could help me without me having to format my entire computer and reinstalling windows?
EDIT: Apparently you can't read the error lines properly so here is a snippet of most of it:
" Filen eller assemblyen 'Microsoft.Owin.Security' eller en af dens afhængigheder kunne ikke indlæses. Forkert parameter. (Undtagelse fra HRESULT: 0x80070057 (E_INVALIDARG))
Beskrivelse: Der opstod en undtagelse, der ikke blev behandlet, under udførelse af den aktuelle webanmodning. Se staksporingen for at få flere oplysninger om fejlen, og hvor den kom fra i koden.
Detaljer om undtagelse: System.IO.FileLoadException: Filen eller assemblyen 'Microsoft.Owin.Security' eller en af dens afhængigheder kunne ikke indlæses. Forkert parameter. (Undtagelse fra HRESULT: 0x80070057 (E_INVALIDARG))
Kildefejl:
Der blev oprettet en undtagelse, der ikke blev behandlet, under kørsel af den aktuelle webanmodning. Du kan finde oplysninger om undtagelsens oprindelse og placering ved hjælp af nedenstående staksporing af undtagelser.
Belastningssporing af assembly: Følgende oplysninger kan være nyttige, når det skal afgøres, hvorfor assemblyen 'Microsoft.Owin.Security' ikke kunne indlæses.
=== Tilstandsoplysninger om forudbinding ===
LOG: DisplayName = Microsoft.Owin.Security
(Partial)
WRN: Der blev leveret oplysninger om en delvis binding for en assembly:
WRN: Assemblynavn: Microsoft.Owin.Security | Domæne-id: 2
WRN: En delvis binding opstår, når der kun opgives en del af assemblyens viste navn.
WRN: Dette kan medføre, at binderen indlæser en forkert assembly.
WRN: Det anbefales at opgive fuldt specificeret tekst-id for assemblyen,
WRN: bestående af det simple navn, versionen, kulturen og token til offentlig nøgle.
WRN: Du kan få flere oplysninger om og almindelige løsninger til dette problem i hvidbogen http://go.microsoft.com/fwlink/?LinkId=109270.
LOG: Appbase = file:///C:/Users/Giuseppe/Desktop/ASP.NET/MEV3/MEV3/
LOG: Første PrivatePath = C:\Users\Giuseppe\Desktop\ASP.NET\MEV3\MEV3\bin
Kalder assembly: (Unknown).
===
LOG: Denne binding starter i indlæsningskonteksten default.
LOG: Bruger programkonfigurationsfilen: C:\Users\Giuseppe\Desktop\ASP.NET\MEV3\MEV3\web.config
LOG: Bruger værtskonfigurationsfilen: C:\Users\Giuseppe\Documents\IISExpress\config\aspnet.config
LOG: Bruger maskinkonfigurationsfil fra C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Politikken anvendes ikke på referencen på nuværende tidspunkt (privat, brugerdefineret, delvis eller placeringsbaseret assemblybinding).
LOG: Forsøger at hente nye URL-adresser file:///C:/Users/Giuseppe/AppData/Local/Temp/Temporary ASP.NET Files/root/6691a5d9/25f50715/Microsoft.Owin.Security.DLL.
LOG: Forsøger at hente nye URL-adresser file:///C:/Users/Giuseppe/AppData/Local/Temp/Temporary ASP.NET Files/root/6691a5d9/25f50715/Microsoft.Owin.Security/Microsoft.Owin.Security.DLL.
LOG: Forsøger at hente nye URL-adresser file:///C:/Users/Giuseppe/Desktop/ASP.NET/MEV3/MEV3/bin/Microsoft.Owin.Security.DLL.
LOG: Bruger programkonfigurationsfilen: C:\Users\Giuseppe\Desktop\ASP.NET\MEV3\MEV3\web.config
LOG: Bruger værtskonfigurationsfilen: C:\Users\Giuseppe\Documents\IISExpress\config\aspnet.config
LOG: Bruger maskinkonfigurationsfil fra C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Postpolitikreference: Microsoft.Owin.Security, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
ERR: Konfigurationen af assemblyen mislykkedes (hr = 0x80070057). Testen afsluttedes.
"

WCF WebService cannot get PrivateKey from certificate

I already created a WCF Service that is hosted in IIS, I've created an CA makecert and one certificate for autenticating the service using HTTPS. With this certificate I have make work it. Now I'm trying to use the Message Security in the service.
In the web.configI have the next code:
<serviceCredentials>
<serviceCertificate findValue="192.168.1.230" storeLocation="LocalMachine" storeName="My" x509FindType="FindBySubjectName" />
<clientCertificate>
<authentication certificateValidationMode="ChainTrust" />
</clientCertificate>
</serviceCredentials>
When I try to view the Web Service through an explorer like Chrome, I'm receiving the next error System.Security.Cryptography.CryptographicException: KeySet does not exists. I check the inner exception and this is what I see
[CryptographicException: El conjunto de claves no existe]
System.Security.Cryptography.Utils.CreateProvHandle(CspParameters parameters, Boolean randomKeyContainer) +5368074
System.Security.Cryptography.Utils.GetKeyPairHelper(CspAlgorithmType keyType, CspParameters parameters, Boolean randomKeyContainer, Int32 dwKeySize, SafeProvHandle& safeProvHandle, SafeKeyHandle& safeKeyHandle) +138
System.Security.Cryptography.RSACryptoServiceProvider.GetKeyPair() +221
System.Security.Cryptography.X509Certificates.X509Certificate2.get_PrivateKey() +516
System.ServiceModel.Security.SecurityUtils.GetKeyContainerInfo(X509Certificate2 certificate) +45
System.ServiceModel.Security.SecurityUtils.EnsureCertificateCanDoKeyExchange(X509Certificate2 certificate) +76
[ArgumentException: Puede que el certificado 'CN=192.168.1.230' no tenga un clave privada capaz de intercambiar claves, o que el proceso no tenga permisos de acceso a la clave privada. Vea la excepción interna para obtener información detallada.]
System.ServiceModel.Security.SecurityUtils.EnsureCertificateCanDoKeyExchange(X509Certificate2 certificate) +16947147
System.ServiceModel.Security.ServiceCredentialsSecurityTokenManager.CreateLocalSecurityTokenProvider(RecipientServiceModelSecurityTokenRequirement recipientRequirement) +190
System.ServiceModel.Security.ServiceCredentialsSecurityTokenManager.CreateSecurityTokenProvider(SecurityTokenRequirement requirement) +50
System.ServiceModel.Security.AsymmetricSecurityProtocolFactory.OnOpen(TimeSpan timeout) +930
System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) +740
System.ServiceModel.Security.SecurityListenerSettingsLifetimeManager.Open(TimeSpan timeout) +79
System.ServiceModel.Channels.SecurityChannelListener`1.OnOpen(TimeSpan timeout) +397
System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) +740
System.ServiceModel.Dispatcher.ChannelDispatcher.OnOpen(TimeSpan timeout) +375
System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) +740
System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout) +249
System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) +740
System.ServiceModel.HostingManager.ActivateService(ServiceActivationInfo serviceActivationInfo, EventTraceActivity eventTraceActivity) +125
System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath, EventTraceActivity eventTraceActivity) +901
[ServiceActivationException: El servicio '/WebFrontITAS.svc' no se puede activar debido a una excepción durante la compilación. El mensaje de la excepción es: Puede que el certificado 'CN=192.168.1.230' no tenga un clave privada capaz de intercambiar claves, o que el proceso no tenga permisos de acceso a la clave privada. Vea la excepción interna para obtener información detallada..]
System.Runtime.AsyncResult.End(IAsyncResult result) +622882
System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +196075
System.Web.CallHandlerExecutionStep.OnAsyncHandlerCompletion(IAsyncResult ar) +282
I googled a lot about this, but I have not found anything usefull. When I try to get the private key using FindPrivateKey.exe it fails and give me the next error No certificates with key '192.168.1.230' found in the store.
I'm not sure if the problem is with the cert or with the configuration of WCF.
Besides changing the user another way to solve this issue is give the App Pool the WCF service is running under permissions to read the private key.
Open the certificate store for your system and find your certificate, from there choose Manage Private Keys
Inside the security setting add the app pool your WCF service is running under by adding the name IIS AppPool\App_Pool_Name_Here (if you are on a domain be sure the location is set to the computer not the domain)
Then check the box for Read permissions and your app should start being able to read your certificate.
NOTE: I have encountered a bug where depending on how you imported your certificate the program will still not work correctly, I have found this usually happens if you used IIS to import the certificate. If you remove the certificate and re-add it from inside the Certificates manager using the wizard built in to the manager it will often fix the issue.
I already solved this issue, the problem was the autentication of the AppPool of IIS, It was using a network credential that does not have permission to access the cert store, When I change the Autentification to a LocalUser, the problem was solved.

Categories

Resources