I am running the vanilla ASP.Net VNext hello world application with dnx. When i perform "dnx . run", it runs just fine. But when i am using "dnu publish" to create the self contained package (as a result of which it creates web.cmd), it fails to run on linux with the errors
root#Xavier:~/Net/HelloWorldCore/bin/output# web.cmd
web.cmd: command not found
i tired doing "chmod 777 web.cmd", it then fails to recognize dnx
root#Xavier:~/Net/HelloWorldCore/bin/output# chmod 777 web.cmd
root#Xavier:~/Net/HelloWorldCore/bin/output# ./web.cmd
./web.cmd: line 1: $'\r': command not found
./web.cmd: line 2: #dnx.exe: command not found
I am using Ubuntu 14.04
root#Xavier:~/dnvm list
Active Version Runtime Arch Location Alias
------ ------- ------- ---- -------- -----
1.0.0-beta4 coreclr x64 ~/.dnx/runtimes
1.0.0-beta5 mono ~/.dnx/runtimes default
1.0.0-beta6-12207 coreclr x64 ~/.dnx/runtimes
1.0.0-beta6-12207 mono ~/.dnx/runtimes
* 1.0.0-beta4 mono ~/.dnx/runtimes
On Linux you don't run the .cmd files. Cmd is just for Windows. Just run the command name, without any extension: ./web.
Related
Environment
WSL2 Ubuntu 20.04 from Windows 10 Home
Linux .Net Core 3.1
Node 12.18.3 + NPM 6.14.6 + Yarn 1.22.5
Problem
I'm following the SAFE Stack quick start but the FAKE build script fails:
$ dotnet fake build --target run
But FAKE cannot find the npm binary:
Target Duration
------ --------
Clean 00:00:00.0053439
InstallClient 00:00:00.1517122 (npm was not found in path. Please install it and make sure it's available from your path. See https://safe-stack.github.io/docs/quickstart/#install-pre-requisites for more info)
Question
By inserting debug messages, it seems that the FAKE build.fsx script resolves the PATH from the hosting Windows, not from the WSL2 Linux environment:
DEBUG: Some "C:\Program Files\Git\usr\bin\ls.EXE"
Sample from the script:
// My Debug
printfn "DEBUG: %A" (ProcessUtils.tryFindFileOnPath "ls")
// The actual script
let npmPath =
match ProcessUtils.tryFindFileOnPath "npm" with
| Some path -> path
| None ->
"npm was not found in path. Please install it and make sure it's available from your path. "
+ "See https://safe-stack.github.io/docs/quickstart/#install-pre-requisites for more info"
|> failwith
=> Is it a bug or I'm missing something here? (I'm quite new to .Net and F#)
OK, that was something quite stupid from my side: In a previous mixed Windows + WSL setup I added to bash_aliases a line with alias dotnet=dotnet.exe. I should have removed it when I installed the Linux .Net Core packages
Case closed
I have a simple Dockerfile:
FROM mcr.microsoft.com/windows:1809
# Install chocolatey
RUN powershell.exe Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
# Install cygwin
RUN choco install -y cygwin --version 3.1.2
RUN refreshenv
CMD [ "powershell" ]
The result is
PS C:\vagrant\delme> docker build . -t localhost/async_windows_service
Sending build context to Docker daemon 2.048kB
Step 1/5 : FROM mcr.microsoft.com/windows:1809
---> 2de0138f1799
Step 2/5 : RUN powershell.exe Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
---> Using cache
---> 7ee59b0c4334
Step 3/5 : RUN choco install -y cygwin --version 3.1.2
---> Running in e6c3d1130a4e
Chocolatey v0.10.15
Installing the following packages:
cygwin
By installing you accept licenses for the packages.
Progress: Downloading chocolatey-core.extension 1.3.5.1... 100%
Progress: Downloading Cygwin 3.1.2... 100%
chocolatey-core.extension v1.3.5.1 [Approved]
chocolatey-core.extension package files install completed. Performing other installation steps.
Installed/updated chocolatey-core extensions.
The install of chocolatey-core.extension was successful.
Software installed to 'C:\ProgramData\chocolatey\extensions\chocolatey-core'
Cygwin v3.1.2 [Approved]
cygwin package files install completed. Performing other installation steps.
Download site: http://mirrors.kernel.org/sourceware/cygwin/
Installing 64-bit Cygwin...
Cygwin has been installed.
Added C:\ProgramData\chocolatey\bin\Cygwin.exe shim pointed to 'c:\tools\cygwin\cygwin.bat'.
Copying cygwin package manager (setup) to C:\tools\cygwin
Environment Vars (like PATH) have changed. Close/reopen your shell to
see the changes (or in powershell/cmd.exe just type `refreshenv`).
ShimGen has successfully created a shim for setup-x86.exe
The install of cygwin was successful.
Software installed to 'C:\tools\cygwin'
Chocolatey installed 2/2 packages.
See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
re-exec error: exit status 1: output: time="2020-06-02T22:03:52+02:00" level=error msg="hcsshim::ImportLayer - failed failed in Win32: The system cannot find the path specified. (0x3)" error="hcsshim::ImportLayer - failed failed in Win32: The system cannot find the path specified. (0x3)" importFolderPath="C:\\ProgramData\\docker\\tmp\\hcs292836507" path="\\\\?\\C:\\ProgramData\\docker\\windowsfilter\\eeae1d5f886b0b035f4466cf124056f7c1924283548cd960e0024a33d1219984"
hcsshim::ImportLayer - failed failed in Win32: The system cannot find the path specified. (0x3)
I tried different version of cygwin, also modified the storage size, as suggested e.g. here.
It is strange. The installation seems to go fine but docker cannot find the file (a layer I suppose) with path="\\\\?\\C:\\ProgramData\\docker\\windowsfilter\\eeae1d5f886b0b035f4466cf124056f7c1924283548cd960e0024a33d1219984"
And indeed, in my C:\ProgramData\docker\windowsfilter directory, there is no folder starting with eeae1d...
Note that only cygwin is causing problems. I can install all kinds of other software.
It seems that it is hardlinks which Cygwin uses a lot are not handled correctly by Docker. And in particular when Docker tries to commit an image it fails with "hcsshim::ImportLayer - cannot find the path" error.
I run in the same problem recently and after I got rid of the hardlinks in Cygwin installation I was able to commit the image without problems.
To get rid of the hardlinks I have zipped and unzipped Cygwin folder.
I am trying to run integration tests for my Rails application in Windows Subsystem for Linux. I have downloaded the chromedriver file for windows from the official site and placed it in Documents/bin folder. I have added the following file in the same folder and saved it as chromedriver:
#!/bin/sh
chromedriver.exe "$#"
So presently Documents/bin folder has these two files: chromedriver.exe and chromedriver. I have added this folder to PATH in windows.
When I type chromedriver -v in Ubuntu terminal in Windows I get the following output:
ChromeDriver 75.0.3770.90 (a6dcaf7e3ec6f70a194cc25e8149475c6590e025-refs/branch-heads/3770#{#1003})
But when I execute any Rails integration test I am getting the following error:
sh: 1: ["/usr/local/sbin", "/usr/local/bin", "/usr/sbin", "/usr/bin", "/sbin", "/bin", "/opt/google/chrome"]: not found
sh: 1: ["/usr/local/sbin", "/usr/local/bin", "/usr/sbin", "/usr/bin", "/sbin", "/bin", "/opt/google/chrome"]: not found
sh: 1: ["/usr/local/sbin", "/usr/local/bin", "/usr/sbin", "/usr/bin", "/sbin", "/bin", "/opt/google/chrome"]: not found
Webdrivers::VersionError: Failed to find Chrome binary or its version.
chrome version in windows: Version 75.0.3770.90 (Official Build) (64-bit)
So linux is able to find chromedriver but not rails. How can I rectify this error? Should I run sudo apt-get install chromium chrome-driver? Or is there another method to make rails know the path to chromedriver binary?
You need to add the path to your chrome.exe to the PATH environment variable in Ubuntu
I am trying create a Docker image to host my asp.net MVC app that has a dependency on Crystal Reports.
My dockerfile looks like this
FROM microsoft/iis
COPY ./bin/Release/Publish/ c:\\inetpub\\wwwroot
RUN ["powershell.exe", "Install-WindowsFeature NET-Framework-45-ASPNET"]
RUN ["powershell.exe", "Install-WindowsFeature Web-Asp-Net45"]
#install Crystal reports runtime
COPY Resources/Files/CRRuntime_64bit_13_0_21.msi .
RUN powershell.exe -Command Start-Process CRRuntime_64bit_13_0_21.msi -ArgumentList '/quiet' -Wait
The installing of the CRRuntime_64bit_13_0_21.msi fails. I logged onto my container and ran the msi install from powershell and produced a log. Its very long but here are 2 things that stand out:
Error 1904. Module C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win64_x64\pageobjectmodel.dll failed to register. HRESULT -2147024770. Contact your support personnel.
Action ended 17:20:50: InstallFinalize. Return value 3.
Action ended 17:23:56: INSTALL. Return value 3.
MSI (s) (3C:54) [17:23:56:467]: Product: SAP Crystal Reports runtime engine for .NET Framework (64-bit) -- Installation operation failed.
MSI (s) (3C:54) [17:23:56:467]: Windows Installer installed the product. Product Name: SAP Crystal Reports runtime engine for .NET Framework (64-bit). Product Version: 13.0.21.2533. Product Language: 1033. Manufacturer: SAP. Installation success or error status: 1603.
The first error does not seem to halt the install.
Any suggestions for troubleshooting this are welcome as are alternative ways of creating the image.
Also, just to confirm. The website loads and runs fine. I just can't use any of the features that require the Crystal Reports dependency.
Using the full Windows 2019 container mcr.microsoft.com\windows:1809 as a base, the installer works, which hints that it's just down to missing OS components.
I don't get the 'Error 1904' logged but maybe I'm on a different host OS.
The installer log shows that a custom action SetASPDotNetDllPath is failing.
If you:
Open the installer MSI (e.g. in Orca)
Locate and extract the action binary, save as dll
Inspect its imports (e.g. with dumpbin)
This shows a dependency on oledlg.dll.
This is its only dependency which isn't available in Server Core.
Its not great, but you can copy this version from the full windows container to fix it:
FROM mcr.microsoft.com/windows:1809 as dll_source
FROM microsoft/iis
#hack in oledlg dll!!
COPY --from=dll_source /windows/system32/oledlg.dll /windows/system32/oledlg.dll
COPY --from=dll_source /windows/syswow64/oledlg.dll /windows/syswow64/oledlg.dll
RUN ["powershell.exe", "Install-WindowsFeature NET-Framework-45-ASPNET"]
RUN ["powershell.exe", "Install-WindowsFeature Web-Asp-Net45"]
WORKDIR c:/temp
COPY CRRuntime_64bit_13_0_21.msi .
RUN powershell.exe -Command Start-Process c:\temp\CRRuntime_64bit_13_0_21.msi -ArgumentList '/l*v c:\temp\install.log' -Wait
I'm going to add an additional answer while Peters answer worked perfectly for installing Crystal Reports, I had an additional issue with missing Fonts when exporting to PDF from Crystal Report.
This is what I've ended up with. The key is the change in the image tag name to be an older version.
#windowsservercore-1803 required as it has the fonts we need in the report in order to export to PDF
FROM microsoft/iis:windowsservercore-1803
#install features we need
RUN ["powershell.exe", "Install-WindowsFeature NET-Framework-45-ASPNET"]
RUN ["powershell.exe", "Install-WindowsFeature Web-Asp-Net45"]
#hack in oledlg dll so that Crystal Runtime will install
COPY Resources/Files/64/oledlg.dll /windows/syswow64/oledlg.dll
COPY Resources/Files/32/oledlg.dll /windows/system32/oledlg.dll
#copy in Crystal MSI and install. Note it's 64bit version
WORKDIR c:/temp
COPY Resources/Files/CRRuntime_64bit_13_0_21.msi .
RUN powershell.exe -Command Start-Process c:\temp\CRRuntime_64bit_13_0_21.msi -ArgumentList '/quiet /l*v c:\temp\install64.log' -Wait
#Add website files
COPY ./bin/Release/Publish/ /inetpub/wwwroot
For some reason Microsoft have dropped lots of fonts from version 1803 to 1809. I can only assume to reduce the OS image size.
OS: Debian 8.1 X64
trying to install eJabberd Community server based on this tutorial
At the end of installation, it pops error message
Error: Error running Post Install Script.
The installation may have not completed correctly
What am I doing wrong?
It looks like /bin/sh is Dash on your system (apparently the default since Debian Squeeze). However, the postinstall.sh script inside the package uses brace expansion, which while widely supported in various shells is not required by the POSIX standard, and thus Dash is not in error by not supporting it. The postinstall.sh script should either specify /bin/bash instead of /bin/sh in its first line, or abstain from using Bash-specific features.
You should be able to get a functioning ejabberd install by explicitly running the postinstall script with Bash:
sudo bash /opt/ejabberd-15.07/bin/postinstall.sh