FSharp interactive on CentOS 6.2 with Mono 2.10.2 won't run as non-root - f#

Hopefully this has not been asked/answered before, but I haven't found anything that fits my issue.
I installed mono on CentOS 6.2 as described here using an rpm and then downloaded FSharp-2.0.0.0. I got it all set up and fsi works great (as long as I pass it the option --gui-) while as root. However, when I try to do it as a plain user I get an error telling me something about not being able to access the registry.
Here is a screenshot:
I'm not sure what the issue is (I've never used CentOS before, but a lab I work in does and I want to put FSharp on it for data processing -- thus I have to use CentOS, which I've read can be troublesome with mono). Thanks for any help!

I know little about CentOS, but the error message seems fairly clear, the mono process running fsi.exe does not have access to a file (the file path is given in the message). So it should be just a matter of running as root to give yourself access to the file, or better yet granting the current user access to this file via chmod (or similar tool).

Related

PortSip SDK C#: DllNotFoundException in Docker container while locally\EC2 works well

I have a .NET core application that uses the library of PortSip. So far everything worked fine both locally in my Windows 10 laptop and in an EC2 AWS instance with Windows Server 2019 installed, and now I would like to make this work in a Docker container.
So I used a Dockerfile similar to what's mentioned it this link https://schwabencode.com/blog/2018/08/30/ASP-NET-Core-with-NET-Framework-on-Docker to have a Windows Server Core image with both .NET framework (what PortSip needs) and .NET core (what my app needs) as well as added commands to install C++ Redistributable.
The result is that I'm getting the following error when trying to run my app:
Unhandled exception. System.DllNotFoundException: Unable to load DLL 'portsip_sdk.dll' or one of its dependencies: The specified module could not be
found. (0x8007007E)
The DLLs are there! In addition, when I change them to PortSip's 32-bit DLLs, the error changes to "An attempt was made to load a program with an incorrect format". That means the existence of the DLL is felt, but still, for some reason, cannot be loaded.
Also worth mentioning that with the exact same installations (the .NETs and the C++ redistributable) in a blank EC2 as mentioned above the app works.
What am I missing?
Thanks in adavance
Solved by copying two DLLs, C:\Windows\System32\edputil.dll and C:\Windows\System32\msdmo.dll from my local machine to that docker image.

OAuth error when attempting to start-host for chrome-remote-desktop on GCE

I'm running CentOS 7 in a Google Compute Engine VM, and trying to connect to it via Chrome Remote Desktop. When I run the start-host command, it fails with "OAuth error" and no more information.
I accessed the https://remotedesktop.google.com/headless site with Chrome, filled out the choices, and went through the authorization phase. There was not an option for CentOS, so I chose "Debian" and when it gave me the connect command, I replaced the path to start-host with the CentOS one of /usr/lib64/chrome-remote-desktop/start-host, and running the resulting command fails.
I did the likely web searches and found some fairly old and unhelpful information, but nothing useful.
If I can't get Chrome Remote Desktop working, I'd be willing to try another method to run GUI-based applications (in this case, IBM's oneWEX). I can get X11 to sort-of work remotely, but not well enough to run oneWEX.
This is the command I got from the Chrome site, modified to work with CentOS:
DISPLAY= /usr/lib64/chrome-remote-desktop/start-host --code="<code>" --redirect-url="https://remotedesktop.google.com/_/oauthredirect" --name=
The start-host command asked the expected questions of the computer name and PIN, then gave the error:
Couldn't start host: OAuth error.
When you get the code from https://remotedesktop.google.com/headless it is only good for a few minutes, and only one time use.
Just go back to https://remotedesktop.google.com/headless follow the prompts and get a new code for every attempt.
In my case, I got another error when I first ran the command. I tried to resolve it, and reran the same command (with the original code). I kept getting the "Couldn't start host: OAuth error." until I figured out I needed to get a new code from https://remotedesktop.google.com/headless for each attempt.
FYI: The error message is not given right away, but after entering the computer name and double entering the pin.
According to https://bugs.chromium.org/p/chromium/issues/detail?id=1039016, this could apparently also happen if the /usr/lib64/chrome-remote-desktop/start-host binary is not one from the "official" DEBian package built and distributed by Google, but one built from source e.g. by yourself or your Linux distribution (such as the chrome-remote-desktop package built by Fedora; https://bugzilla.redhat.com/show_bug.cgi?id=1788448 aims to clarify how to use that one).
What I can see here is that you previously added some libraries to your CentOS instance, I tried replicating the error myself and inside my CentOS 7 instance (from Compute Engine) I don't seem to have any /usr/lib64/chrome-remote-desktop/ folder.
Or is it from your local machine?
I had the same error and found that refreshing the headless page to get a new code string in the command worked.

.Net Core application fails to publish to GCP App Engine becuase of MVC.Abstractions

This is my first foyer into .Net Core and App Engines, so please forgive me if I sound uninformed.
We have a .Net Core Application that we're trying to get published to a GCP App engine (obviously). when I run dotnet publish -c Release it builds just fine without any errors. When I test the program locally it runs just fine and I'm able to access it. However whenever I try to get it on GCP I get the following error:
Updating service [default] (this may take several minutes)...
.................................................................................................................................................failed.
ERROR: (gcloud.app.deploy) Error Response: [9]
Application startup error:
Error:
An assembly specified in the application dependencies manifest (ApplicationName.deps.json) was not found:
package: 'Microsoft.AspNetCore.Mvc.Abstractions', version: '2.0.2'
path: 'lib/netstandard2.0/Microsoft.AspNetCore.Mvc.Abstractions.dll'
This assembly was expected to be in the local runtime store as the application was published using the following target manifest files:
aspnetcore-store-2.0.5.xml
Failed to deploy project WebApiDotNetCore to App Engine Flex.
We tried removing it from the dependencies JSON, and that just ended up breaking everything, so it is indeed required. It is installed in the project via nuget, so it should be included with dotnet restore. I've looked around and some sources seem to think that it's the installation of the dotnet core sdk, but I've tried it on three computers and always get the same thing.
Lastly, I should say this happens when I try to deploy through command line as well as directly through Visual Studio with the GCP SDK.
Has anyone experienced this error, or something similar? Any advice or guidance is very much appreciated.
Thanks!
-BT
OP REVISION
As an update I was able to get this resolved aside from the fact that I get a 502 error when I try to load the application. Here are the steps I took for anyone else that is looking what to do:
Pre-reqs: Docker for Windows and Google Cloud SDK installed and running. Running turned out to be a pain with Docker for Windows. Many many restarts and reinstallations.
Open the solution and ensure that the startup project is set correctly.
Right click the startup Project, and select Add > Docker Support.
Select Linux in the popup window and allow the files to be created.
When complete, the Dockerfile should appear in the preview window. Do the following:
For me the first line read: FROM microsoft/aspnetcore:2.0 AS base. Change this to FROM microsoft/aspnetcore-build:2.0 AS base.
Additionally, check to make sure that the last line has the correct .dll name. Docker for Windows will put whatever the project name is rather than the class name, so for me my final .dll names were different than the project name.
Lastly, if your project has any dependencies that are required to run but not to build, then you'll need to manually add them. For me we have a couple of XML files that needed to be put in the app folder, so I had to add COPY *.xml /app/ and put those files in the same folder as the solution file is in.
If there's anything else you need to do to the Dockerfile I highly recommend this page. It's a how-to on all Dockerfile commands written in ENGLISH! (that was my biggest problem with all of this - I have little experience with Linux and even less with Docker and everything was written in Greek for me).
Create an app.yaml file. I just used the standard:
runtime: custom
env: flex
Copy the Dockerfile found in the startup project's folder into the folder with the solution.
Initialize gcloud to the right project, then navigate to the solution folder. The type gcloud app deploy app.yaml, and follow the onscreen guide.
for me it takes about 15 minutes to deploy the GCP, so depending on the complexity of your project it may take longer, though this one is rather complex.
Now I'm trying to figure out my 502 error... I've tried what seems like everything - changing the listening port in the application, exposing the listening port on the dockerfile, trying to get GCP to open that port, and trying half a dozen different ports. It's slow-going since it's such a chore to deploy each time.
Hope this helps anyone that was like me a couple weeks ago and had never even heard of Docker!
Which version of .NET Core is this? Also, have you tried to run in Cloud Shell? Maybe that will provide more clues on what might be wrong.
It looks that you don't have the Microsoft.AspNetCore.Mvc.Abstractions library installed in your system. Using the .NET CLI, type the following command:
dotnet add package Microsoft.AspNetCore.Mvc.Abstractions --version 2.0.2
After that, to ensure the library is included, run the following:
dotnet restore
dotnet build
Try running it locally (it should work), and then use the dotnet publish -c Release command again.

Wireshark Disscetor Error on Windows Platform

I am trying to build a dissector for Wireshark on Windows platform. But, I am getting an error.
I followed this link to install Wireshark from the source on windows, and I was able to build and run the software successfully.
Then using the README.plugins, I added a plugin, and did all the changes, mentioned in the file.
With the plugin, it built successfully, but whenever I tried running it, a dialog box appears stating The plugin 'ABC.dll' has neither a register routine, a register_tap_listener or a register_wtap_module or a register_codec_module routine.. Though wireshark is running fine, but my plugin is not included in it.
Linux Environment: I tried compiling and running on linux platform, and it worked fine, with the plugin included.Can anybody tell me, where I might be going wrong on the windows platform. Thanks.
There's a bit of magic which happens when building plugins on Windows so that certain symbols in the DLL are declared as exported so they can be found in the DLL at run-time. (I haven't recently dug into all the details, but the mechanism is different on *nix and so the results on each platform might be different).
What version of Wireshark are you building ? (How are you getting the Wireshark sources ?).
The specific error message you re getting suggests you might be building a version of WWireshark 1.10. (The message has changed in the Wireshark development version (1.11)).
In any case, something is not quite right (obviously) as to how the DLL is being built on Windows.
My suggestion as a starting point:
You might be able get an idea as to what's wrong by
comparing the plugin.c file (which is generated at build time) in your plugin directory on Windows with a plugin.c from one of the other Wireshark Windows plugin directories.
The magic occurs in that file.
Things like:
WS_DLL_PUBLIC_NOEXTERN void
plugin_reg_handoff(void)
{
{extern void proto_reg_handoff_unistim (void); proto_reg_handoff_unistim ();}
}

Cannot Open Devcon

I installed WinDDK 7600 in my Windows XP operating system.Now,when I double click the devcon.exe(Location- D:\WinDDK\7600.16385.1\tools\devcon\i386),the command prompt is just showing up and suddenly disappears.Can anyone resolve this issue.
As far as I'm aware devcon is a command-line only program. You have to run it from a command window (cmd.exe) with the appropriate parameters. Once you know the parameters you want to use, you can write a batch file to easily recreate the command you want.
I ran across this post because Win7 has a similar problem even when running in cmd.exe.
There is a solution found on Microsofts website here:
http://answers.microsoft.com/en-us/windows/forum/windows_7-hardware/devcon-not-working-correctly-in-windows-7/9abcc12c-d7db-4249-aec4-fc4ff0ea6ee8
I have not been able to verify it yet.
The same (a windows open and automatically close) happens even if using a normal command prompt. However opening the command prompt with administrator rights and then run devcon works.

Resources