Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Short name app config fix #255

Merged
merged 2 commits into from
Sep 11, 2019
Merged

Short name app config fix #255

merged 2 commits into from
Sep 11, 2019

Conversation

atruskie
Copy link
Member

Fixes #241

When R executes AP.exe it uses the Sys.which function to resolve the executable
name. This function uses the Windows 8.3 short-name functionality by default which
launches the application as ANALYS~1.exe. Since the application is no longer named
correctly, the AnalysisPrograms.exe.config file cannot be loaded and all of our
application binding redirects are ignored. Subsequently, the fusion assembly loader
throws errors like:

  System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types.
	- Could not load file or assembly 'System.Numerics.Vectors, Version=4.1.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

In addition to the stack overflow post that should how to update the current domain's
App.Config file and settings, I also had to force Fusion to redo its setup. This method
is, to say the least, fragile, and we can expect it to fail in the port to .NET Core.

Additionally added a AP_DEFAULT_LOG_VERBOSITY flag that set the log level verbosity
before the command line is parsed.

Additionally added a few extension method helpers and associated tests

Fixes #241

When R executes AP.exe it uses the `Sys.which` function to resolve the executable
name. This function uses the Windows 8.3 short-name functionality by defualt which
launches the application as ANALYS~1.exe. Since the application is no longer named
correctly, the AnalysisPrograms.exe.config file cannot be loaded and all of our
application binding redirects are ignored. Subsequently the fusion assembly loader
throws errors like:

```
  System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types.
	- Could not load file or assembly 'System.Numerics.Vectors, Version=4.1.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

```

In addition to the stack overflow post that should how to update the current domain's
App.Config file and settings, I also had to force Fusion to redo it's setup. This method,
is to say the least, fragile, and we can expect it to fail in the port to .NET Core.

Additionally added a AP_DEFAULT_LOG_VERBOSITY flag that set the log level verbosity
before the command line is parsed.

Additionally added a few extension method helpers and associated tests
Collapsed two similar files into one, removed a bunch of old (and faulty) "CSV" parsing methods
@atruskie atruskie merged commit 7fcf2bb into master Sep 11, 2019
@atruskie atruskie deleted the short-name-app-config-fix branch February 17, 2020 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ReflectionTypeLoadException when running audio2csv
1 participant