LibGit2Sharp TypeInitializationException in Web project - asp.net

I use VS 2012. My solution contains one web-site project and one project library .
I installed the nuget package on my project Library only.
In my Library I created a simple class "GitRepo" to test git access. In the constructor, I want to access the repository :
public GitRepo(string repoPathName)
{
m_Repo = new Repository(repoPathName);
}
In the code behind of my web page, I try to instantiate a GitRepo object :
GitRepo repo = new GitRepo(repoPathName);
And I get the TypeInitializationException with no more details. And yes, dll and native libraries structure seems correct in the file tree (installed by nuget package).
I have a simple console program's solution where I added my previous library (add existing object). In the "main" function, I instantiate a "GitRepo" object... and it works fine.
Some help would be greatly appreciated.
Here the full exception :
System.TypeInitializationException was unhandled by user code
HResult=-2146233036
Message=Une exception a été levée par l'initialiseur de type pour 'LibGit2Sharp.Core.NativeMethods'.
Source=LibGit2Sharp
TypeName=LibGit2Sharp.Core.NativeMethods
StackTrace:
à LibGit2Sharp.Core.NativeMethods.git_repository_open(RepositorySafeHandle& repository, FilePath path)
à LibGit2Sharp.Core.Proxy.git_repository_open(String path)
à LibGit2Sharp.Repository..ctor(String path, RepositoryOptions options)
à CDM.ESD1_WSGINSTALL.Business.GitRepo..ctor(String repoPathName) dans c:\PRIV\Projects\ESD1\ESD1_WSGINSTALL\ESD1_WSGINSTALL.Business\GitRepo.cs:ligne 39
à CDM.ESD1WSGINSTALL.Commands.CharteView.DoBuildRPM(String id) dans c:\PRIV\Projects\ESD1\ESD1_WSGINSTALL\ESD1_WSGINSTALL\App_Code\Commands\CharteViewActivity\CharteView.cs:ligne 262
InnerException: System.DllNotFoundException
HResult=-2146233052
Message=Impossible de charger la DLL 'git2-e0902fb': Le module spécifié est introuvable. (Exception de HRESULT : 0x8007007E)
Source=LibGit2Sharp
TypeName=""
StackTrace:
à LibGit2Sharp.Core.NativeMethods.git_libgit2_init()
à LibGit2Sharp.Core.NativeMethods.LibraryLifetimeObject..ctor()
à LibGit2Sharp.Core.NativeMethods..cctor()
InnerException:

nulltoken, thank you for your help.I've started a new console project and added my library located in another folder. When I instanciate my "GitRepo" object (from my library) there's no exception. So I checked the directory tree of the solution and I saw that LibGit2Sharp.dll and NativeBinaries folder were added automatically under bin/debug of the program's folder.
Thus I checked the bin folder of my web project and I saw there was not the "NativeBinaries" folder. I add it manually and now there's no more exception.

Related

Error references objectHydrator in xamarin forms

i´m working with xamarin forms and have a error with ObjectHydrator , please helpme
> Gravedad Código Descripción Proyecto Archivo Línea Estado suprimido
Error Can not resolve reference: `Foundation.ObjectHydrator`, referenced by `XamarinListasDemo`. Please add a NuGet package or assembly reference for `Foundation.ObjectHydrator`, or remove the reference to `XamarinListasDemo`. XamarinListasDemo.Android
enter image description here
in the image are all the erros
Have a try with follow steps :
Right click your solution
Select Manage Nuget Packages for Soltions...
In Browser view serch ObjectHydrator
Install above selected Nuget Package to check whether it works .
Official document about installing Nuget package : https://learn.microsoft.com/en-us/nuget/quickstart/install-and-use-a-package-in-visual-studio

MissingMethodException: Void System.Data.Entity.Infrastructure.LocalDbConnectionFactory..ctor() after upgrading EF6

I upgraded EF6 from 6.2.0 to 6.3.0 and now I'm getting this error on the server (not in Visual Studio):
Méthode introuvable : 'Void System.Data.Entity.Infrastructure.LocalDbConnectionFactory..ctor()'.
Description : Une exception non gérée s'est produite au moment de l'exécution de la requête Web actuelle. Contrôlez la trace de la pile pour plus d'informations sur l'erreur et son origine dans le code.
Détails de l'exception: System.MissingMethodException: Méthode introuvable : 'Void System.Data.Entity.Infrastructure.LocalDbConnectionFactory..ctor()'.
I even tried to publish the old version of the website (using EF 6.2.0) and I'm still getting the same error.
The server is Windows Server 2012 with asp.net framework 4.8. The website is made with WebForms.
I tried restarting IIS and the server itself, without success.
I was able to fix the problem by publishing with the option to "delete existing files".
I guess it was different versions of the EntityFramework DLL that were conflicting on the server.
For anyone who has same problem during development, not deploying:
Probably, your project reads EntityFramework.dll from different place than your project bin folder. You can check this in Modules window (for open it start debugging and choose Debug -> Windows -> Modules). Now, just find there an entry for EntityFramework.dll and check out the path value. In my case it pointed out an old version from GAC_MSIL directory. After deletion these trash from GAC and re-running my project, file EntityFrmaework.dll was loaded from my project folder and the error was gone.

NuGet Package RProvider crashes build in F# by failing to link to RProvider.dll in JetBrains Rider

Including the package "RProvider 1.1.20" in F# project throws a rather cryptic error:
Use build tool: C:\Program Files\dotnet\sdk\2.1.402\MSBuild.dll
0>------- Project started: OP 2 - rebuilt in Rider
0>FSC(0,0): Error FS3053: Der Typanbieter 'RProvider.RProvider' hat einen Fehler gemeldet: Der Typanbieterkonstruktor hat eine Ausnahme ausgelöst: Exception has been thrown by the target of an invocation.
0>FSC(0,0): Warning FS3005: Die referenzierte Assembly 'C:\Users\Wolfgang\.nuget\packages\rprovider\1.1.20\lib\net40\RProvider.dll' verfügt über das Attribut 'Microsoft.FSharp.Core.CompilerServices.TypeProviderAssemblyAttribute' auf Assemblyebene, es wurden jedoch keine öffentlichen Typanbieterklassen gefunden.
0>------- Project finished: OP 2 - rebuilt in Rider. Succeeded: False. Errors: 1. Warnings: 1
In English:
The referenced assembly "...RProvider.dll" has the attribute
'Microsoft.FSharp.Core.CompilerServices.TypeProviderAssemblyAttribute'
on assembly level, but no public type provider classes were found.
And the shorthand error message is translated:
The type provider 'RProvider.RProvider' has reported an error: The
type provider constructor has thrown an exception: Exception has been
thrown by the target of an invocation.
Now that's pretty cryptic, no?
Tried these to alleviate, but nothing worked:
Installed R as standalone application.
Used newest version of RProvider (1.1.21), but the error still remains, and moreover, it causes version conflicts with other packages (I don't list them cause I believe they contribute nothing to the problem)
Isolated the problem by creating a project with only the RProvider reference in, error remains the same.
It did work, however, when I was using Visual Studio (which just doesn't work right now on this machine). The problem came in JetBrains Rider.
Thank you very much for your help!

Harmon.ie error when upload file

After completing instalation of Harmo.ie for Outlook 2010, I tried to upload file into a custom document Library. For info, the document library used custom content type and has item receiver attached to it (ItemAdded and ItemUpdated). Sometime, harmon.ie display a error which say "Could not upload file... into the selected Library."
After debugging, the error occured before item receivers. Is anybody have information about the issue ? I did'nt find anything in ULS logs and i tried to isolate bug but no luck !!
here the stack trace of harmo.ie :
!ENTRY com.mainsoft.sharepoint.sidebar.SideBarViewPart 4 0 2015-03-16 14:42:25.892
!MESSAGE Impossible de télécharger ...' vers la bibliothèque sélectionnée.
Le téléchargement du fichier ...' n'a pas pu être terminé.
!STACK 0
com.mainsoft.sharepoint.sidebar.services.UploadOperationFailedException: Le téléchargement du fichier'...' n'a pas pu être terminé.
at com.mainsoft.sharepoint.sidebar.services.UpdateMetadata.onAfterUpload(UpdateMetadata.java:74)
at com.mainsoft.sharepoint.sidebar.services.FilesUploader.uploadNextDocument(FilesUploader.java:169)
at com.mainsoft.sharepoint.sidebar.services.FilesUploader.upload(FilesUploader.java:126)
at com.mainsoft.sharepoint.sidebar.services.FilesUploader.upload(FilesUploader.java:107)
at com.mainsoft.sharepoint.sidebar.operations.BaseFilesUploadOperation.run(BaseFilesUploadOperation.java:157)
at com.mainsoft.common.OperationBase.run(OperationBase.java:94)
at com.mainsoft.common.OperationBase$1.run(OperationBase.java:33)
at com.mainsoft.common.Job$SecondJob.run(Job.java:191)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
at java.lang.Thread.threadProc(Thread.java:2297)
at java.lang.Thread$1.Invoke(Thread.java:797)
at cli.System.Threading.ThreadHelper.ThreadStart_Context(Unknown Source)
at cli.System.Threading.ExecutionContext.Run(Unknown Source)
at cli.System.Threading.ThreadHelper.ThreadStart(Unknown Source)
Run Fiddler to trace requests sent from harmon.ie to SharePoint - the trace details may give you some insight. Also try the same operation against a library that doesn't have any event handlers.

Error while Embedding Excel sheet into VB.Net Form using Microsoft office spread sheet

I am using Visual studio 2012 & creating a VB.Net Windows Forms Application whereas i am trying to embed an excel sheet data into the form.
I have installed, Office web components 11. while dragging and dropping the Microsoft office spread sheet Item it says following error
Failed to import ActiveX control. Please ensure it is properly registered.
PFB snapshot.
*Build console:)*
------ Build started: Project: WindowsApplication7, Configuration: Debug Any CPU ------
COM Reference 'OWC11' is the interop assembly for ActiveX control 'AxOWC11' but was marked to be linked by the compiler with the /link flag. This COM reference will be treated as a reference and will not be linked.
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(2015,5): warning MSB3284: Cannot get the file path for type library "7c0ffab0-cd84-11d0-949a-00a0c91110ed" version 1.0. Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED))
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(2015,5): error MSB3303: Could not resolve COM reference "0002e558-0000-0000-c000-000000000046" version 1.0. Object reference not set to an instance of an object.
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(2015,5): warning MSB3284: Cannot get the file path for type library "7c0ffab0-cd84-11d0-949a-00a0c91110ed" version 1.0. Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED))
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(2015,5): error MSB3303: Could not resolve COM reference "0002e558-0000-0000-c000-000000000046" version 1.0. Object reference not set to an instance of an object.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Note: I am able to embed the excel sheet using VBA form in my system.
I am using Microsoft 2010.
It looks like you may be able to do your drag/drop, click ok, then rebuild and try to drag/drop again.
If that doesn't work then you may check out this guide from MS Here

Resources