The type initializer for 'LibGit2Sharp.Core.NativeMethods' threw an exception. "Unable to load DLL 'git2-572e4d8': - libgit2sharp

We are also getting the same exception. We are using Azure Function and using v0.26.0 of LibGit2Sharp. This exception arises when we are debugging our azure function using Azure CLI debugger.
We have already tried adding 'AutoGenerateBindingRedirects true AutoGenerateBindingRedirects' to csproj file of the project but still no luck. Though it runs fine in console app but is throwing exception in Azure function.
Here is the stack trace:
at LibGit2Sharp.Core.NativeMethods.git_repository_open(git_repository*& repository, FilePath path)
at LibGit2Sharp.Core.Proxy.git_repository_open(String path)
at LibGit2Sharp.Repository..ctor(String path, RepositoryOptions options, RepositoryRequiredParameter requiredParameter)
at LibGit2Sharp.Repository..ctor(String path)
at GitDeploy.GitRepositoryManager.UpdateRepository()
at CrmSolution.RepositoryHelper.TryPushToRepository(String committerName, String committerEmail, String authorEmail, SolutionFileInfo solutionFile, String solutionFilePath, HashSet`1 hashSet)
at CrmSolution.RepositoryHelper.TryUpdateToRepository(String solutionUniqueName, String committerName, String committerEmail, String authorEmail)

Related

Visual Studio 2017 Error initializing VroomJs.JsEngine

My project uses Reactjs, and I use Visual Studio 2017. Recently I did an software update on VS 2017, but no code/config changes.
However, when I start my project locally in debug mode, I encountered below error:
No JavaScript engines were registered, falling back to a default config! It is recommended that you configure JavaScriptEngineSwitcher in your app. See https://github.com/Taritsyn/JavaScriptEngineSwitcher/wiki/Registration-of-JS-engines for more information.
Error initialising JavaScriptEngineSwitcher.V8.V8JsEngineFactory: JavaScriptEngineSwitcher.Core.JsEngineLoadException: During loading of V8JsEngine error has occurred.
See more details:
Cannot load V8 interface assembly. Load failure information for v8-ia32.dll:
C:\Users\user1\AppData\Local\Temp\Temporary ASP.NET Files\vs\77655ce5\ca0bb6d0\assembly\dl3\300b733a\003cadac_c3f4d201\v8-ia32.dll: The specified module could not be found
C:\Code\project1\branches\apps\src\DotNet\COMP.project1.Web\v8-ia32.dll: The specified module could not be found
C:\Code\project1\branches\apps\src\DotNet\COMP.project1.Web\bin\v8-ia32.dll: The specified module could not be found ---> System.TypeLoadException: Cannot load V8 interface assembly. Load failure information for v8-ia32.dll:
C:\Users\user1\AppData\Local\Temp\Temporary ASP.NET Files\vs\77655ce5\ca0bb6d0\assembly\dl3\300b733a\003cadac_c3f4d201\v8-ia32.dll: The specified module could not be found
C:\Code\project1\branches\apps\src\DotNet\COMP.project1.Web\v8-ia32.dll: The specified module could not be found
C:\Code\project1\branches\apps\src\DotNet\COMP.project1.Web\bin\v8-ia32.dll: The specified module could not be found
at Microsoft.ClearScript.V8.V8Proxy.LoadNativeLibrary()
at Microsoft.ClearScript.V8.V8Proxy.LoadAssembly()
at Microsoft.ClearScript.V8.V8Proxy.GetAssembly()
at Microsoft.ClearScript.V8.V8Proxy.GetImplType(Type type)
at Microsoft.ClearScript.V8.V8Proxy.CreateImpl[T](Object[] args)
at Microsoft.ClearScript.V8.V8IsolateProxy.Create(String name, V8RuntimeConstraints constraints, Boolean enableDebugging, Int32 debugPort)
at Microsoft.ClearScript.V8.V8Runtime..ctor(String name, V8RuntimeConstraints constraints, V8RuntimeFlags flags, Int32 debugPort)
at Microsoft.ClearScript.V8.V8ScriptEngine..ctor(V8Runtime runtime, String name, V8RuntimeConstraints constraints, V8ScriptEngineFlags flags, Int32 debugPort)
at JavaScriptEngineSwitcher.V8.V8JsEngine..ctor(V8Settings settings)
--- End of inner exception stack trace ---
at JavaScriptEngineSwitcher.V8.V8JsEngine..ctor(V8Settings settings)
at JavaScriptEngineSwitcher.V8.V8JsEngineFactory.CreateEngine()
at React.JavaScriptEngineFactory.GetFactory(JsEngineSwitcher jsEngineSwitcher, Boolean allowMsie)
Error initialising React.VroomJsEngine+Factory: JavaScriptEngineSwitcher.Core.JsEngineLoadException: During loading of VroomJs JavaScript engine error has occurred.
See more details:
The type initializer for 'VroomJs.JsEngine' threw an exception. ---> System.TypeInitializationException: The type initializer for 'VroomJs.JsEngine' threw an exception. ---> System.DllNotFoundException: Unable to load DLL 'VroomJsNative': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
at VroomJs.JsEngine.js_set_object_marshal_type(JsObjectMarshalType objectMarshalType)
at VroomJs.JsEngine..cctor()
--- End of inner exception stack trace ---
at VroomJs.JsEngine..ctor(Int32 maxYoungSpace, Int32 maxOldSpace)
at React.VroomJsEngine.<>c.<.cctor>b__23_0()
at System.Lazy`1.CreateValue()
at System.Lazy`1.LazyInitValue()
at System.Lazy`1.get_Value()
at React.VroomJsEngine.get_Engine()
at React.VroomJsEngine..ctor()
--- End of inner exception stack trace ---
at React.VroomJsEngine..ctor()
at React.VroomJsEngine.Factory.CreateEngine()
at React.JavaScriptEngineFactory.GetFactory(JsEngineSwitcher jsEngineSwitcher, Boolean allowMsie)
This error does not block me from running and testing the code.
Like I said, all I did recently was to update the VS 2017 software...I tried to do a wild search in the project for 'v8-ia32' but nothing found.
To fix these errors I did the following:
Make sure you install the JavaScriptEngineSwitcher.V8, JavaScriptEngineSwitcher.V8.Native.win-x86 and JavaScriptEngineSwitcher.V8.Native.win-x64.
(I didn't install JavaScriptEngineSwitcher.V8.Native.win-x86)
According to https://reactjs.net/getting-started/aspnet.html
edit the ReactConfig.cs, basically, I just added this
JsEngineSwitcher.Current.DefaultEngineName = V8JsEngine.EngineName;
JsEngineSwitcher.Current.EngineFactories.AddV8();
Rebuild the project.

Autodesk Forge from zero to hero: cannot connect to the remote server

I follow the step at https://www.youtube.com/watch?v=Uy6Cd6atCjU&t=1259s
However, I received the error:
This is the error when I click continue after successfully upload and translate dwf file
{System.TypeInitializationException: The type initializer for 'Autodesk.Forge.Client.Configuration' threw an exception. ---> System.IO.FileLoadException: Could not load file or assembly 'Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
at Autodesk.Forge.Client.ApiClient..ctor()
at Autodesk.Forge.Client.Configuration.setApiClientUsingDefault(ApiClient apiClient)
at Autodesk.Forge.Client.Configuration..ctor(ApiClient apiClient, Dictionary2 defaultHeader, String username, String password, String accessToken, Dictionary2 apiKey, Dictionary`2 apiKeyPrefix, String tempFolderPath, String dateTimeFormat, Int32 timeout, String userAgent)
at Autodesk.Forge.Client.Configuration..cctor()
--- End of inner exception stack trace ---
at Autodesk.Forge.TwoLeggedApi..ctor(Configuration configuration)
at WebApplication1._default.d__1.MoveNext() in C:\Users\tozhang\Source\Repos\forgebasicsample-82\WebApplication1\WebApplication1\default.aspx.cs:line 33}
If I was not understanding wrong, this happened for not connecting to the remote server.
Actually, when I create an app at Autodesk, I provide https://www.google.co.nz/ as the callback url. Do I need to register a callback url? Or it wont influence my app.
I have check many times to make sure the codes are correct and same as the video teach. But I still donot know whats problem.
Couldu pls help me on this? to check where is the erro from.
Many thanks!

CloudTable.Execute not working in API

I just moved a function from an MVC App to an MVC API App, and for some reason it all works except CloudTable.Execute.
Code:
try
{
CloudStorageAccount storageAccount = new CloudStorageAccount(new Microsoft.WindowsAzure.Storage.Auth.StorageCredentials(
"accountName",
"key"), true);
CloudTableClient cloudTableClient = storageAccount.CreateCloudTableClient();
CloudTable table = cloudTableClient.GetTableReference("SkypeUsers");
table.CreateIfNotExistsAsync();
TableOperation retrieveOperation = TableOperation.Retrieve<WorkUser>("Skype", skypeid);
TableResult retrievedResult = table.Execute(retrieveOperation); //Does not work
retrievedSkypeId = ((WorkUser)retrievedResult.Result).RowKey;
}
catch (Exception ex)
{
}
Error:
Error CS1061 'CloudTable' does not contain a definition for 'Execute' and no
extension method 'Execute' accepting a first argument of type 'CloudTable' could
be found (are you missing a using directive or an assembly reference?)
The reference to Microsoft.WindowsAzure.Storage is the same version I use in my App. Ive tried cleaning and re-building. Not sure what the issue is.
EDIT:
Print of my only Execute-options:
I am targeting .NET Core & using assembly Microsoft.WindowsAzure.Storage, Version=9.2.0.0.
The ExecuteQuery does not exist within CloudTable for this version.
This might be your case as well.
Use:
table.ExecuteQuerySegmentedAsync(query, null).Result;
The ExecuteQuery sync is still available for .NET Framework version however for NET Standard use ExecuteQuerySegmentedAsync instead.
Error CS1061 'CloudTable' does not contain a definition for 'Execute' and no extension method 'Execute' accepting a first argument of type 'CloudTable' could be found (are you missing a using directive or an assembly reference?)
CloudTable.Execute Method (TableOperation, TableRequestOptions, OperationContext) accepts a TableOperation object as the first argument, and according to the code you provide, we could find you indeed pass a TableOperation object to Execute method, it should not return the error. Please try to install the latest version Microsoft Azure Storage Client Library for .NET to your project (the code works fine with WindowsAzure.Storage v8.0.0 on my side) and test if same issue will appear. You could also tell us the version of WindowsAzure.Storage you are using now, and then we will test the code with that version.
Besides, please try to use TableQuery to generate a query and call CloudTable.ExecuteQuery method to retrieve the entity.
TableQuery<WorkUser> query = new TableQuery<WorkUser>().Where(
TableQuery.CombineFilters(
TableQuery.GenerateFilterCondition("PartitionKey", QueryComparisons.Equal, "Skype"),
TableOperators.And,
TableQuery.GenerateFilterCondition("RowKey", QueryComparisons.Equal, skypeid)));
retrievedSkypeId = table.ExecuteQuery(query).FirstOrDefault().RowKey;

Selenium Chrome Driver can't be found

I am trying to use Selenium web driver. I am using asp.net mvc. I have set up a very basic test. I'm basically just trying to open the browser.
Imports NUnit.Framework
Imports OpenQA.Selenium
Imports OpenQA.Selenium.Chrome
Imports OpenQA.Selenium.Firefox
<TestFixture()>
Public Class SeleniumEg
Dim driverFF As IWebDriver
Dim driverGC As IWebDriver
Dim driverPath As String = "c:\chromedriver.exe"
<Test()>
Public Sub OpenBrowser()
driverGC = New ChromeDriver(driverPath)
driverGC.Navigate().GoToUrl("https://www.google.ie/")
End Sub
End Class
But when I run test i am getting this Error Message
Result Message:
OpenQA.Selenium.DriverServiceNotFoundException : The file c:\chromedriver.exe\chromedriver.exe does not exist. The driver can be downloaded at http://chromedriver.storage.googleapis.com/index.html
I have also tried putting the driver in the soloution, but I am still getting driver does not exist. The error message seems to repeat the file name when saying its location:
c:\chromedriver.exe\chromedriver.exe when it should be c:\chromedriver.exe
From the error message, I think the problem should be evident
Result Message: OpenQA.Selenium.DriverServiceNotFoundException : The file c:\chromedriver.exe\chromedriver.exe does not exist. The driver can be downloaded at http://chromedriver.storage.googleapis.com/index.html
The ChromeDriver constructor (pardon me if I am not using the proper .NET terminologies, I am a Java guy) expects the directory in which the chromedriver.exe binary exists and not the actual location of the binary itself. See here
So please change
Dim driverPath As String = "c:\chromedriver.exe"
to
Dim driverPath As String = "c:\"
and see if that helps fix your issue.

LuaInterface error loading module(Lua for Windows is OK)

While I DoFile:
Lua luaVM = new Lua();
luaVM.DoFile("test.lua");
This is the error I got.
An unhandled exception of type 'LuaInterface.LuaException' occurred in LuaInterface.dll
Additional information: error loading module 'mytestlib' from file '.\mytestlib.dll':
%1 is not a valid Win32 application.
The dll is I made, It works when I call this lua from LFW(lua for Windows).
Do I need something like a environment variables? (I added the lua/5.1 folder to EV)

Resources