I'd like to run an Appium server with default settings from C# like that:
AppiumLocalService appiumLocalService = AppiumLocalService.BuildDefaultService();
appiumLocalService.Start();
I also set the environment variables right before that:
Environment.SetEnvironmentVariable(AppiumServiceConstants.NodeBinaryPath, #"C:\Program Files\nodejs\node.exe");
Environment.SetEnvironmentVariable(AppiumServiceConstants.AppiumBinaryPath,#"C:\Program Files (x86)\Appium\resources\app\node_modules\appium\lib\main.js"
When I am trying to run the code is stopping for 2 minutes, and I get the following exception:
Message: OpenQA.Selenium.Appium.Service.Exceptions.AppiumServerHasNotBeenStartedLocallyException : The local appium server has not been started. The given Node.js executable: C:\Program Files\nodejs\node.exe Arguments: "C:\Program Files (x86)\Appium\resources\app\node_modules\appium\lib\main.js" --port 4723 --address 127.0.0.1.
Time 120000 ms for the service starting has been expired!
I Googled a lot, but I couldn't find the answer for that. I can start Appium manually from console or from Desktop Application without any problem.
Appium Dotnet version: 3.0.0.2
Appium version: 1.11.1
Node.js version: v10.15.1
I appreciate any suggestion/help.
SOLVED:
wrong:
Environment.SetEnvironmentVariable(AppiumServiceConstants.AppiumBinaryPath,#"C:\Program Files (x86)\Appium\resources\app\node_modules\appium\lib\main.js"
Right:
Environment.SetEnvironmentVariable(AppiumServiceConstants.AppiumBinaryPath,#"C:\Program Files (x86)\Appium\resources\app\node_modules\appium\***build***\lib\main.js"
So basicly the last directory is wrong in the path.
I solved my problem as well adding the right path to the PATH variable.
C:\>npm config get prefix
add the prefix to system environment path
Restart
reinstall node.js to the latest version (typical installer)
reinstall appium (by npm install -g appium)
verify appium is able to run with the command: appium
Related
I'm trying to debug a Linux container that runs a C#/.NET 6.0 console application from Visual Studio 2019 (version 16.11.10).
When I use Debug / Attach to Process... to connect to my running container and attach to my process, I get the error:
Failed to launch debug adapter. Additional information may be available in the output window.
Unable to find debugger script at '/home/dockeruser/.vs-debugger'
For company security purposes, I'm running my container workloads as user dockeruser, but I can reproduce this when I adjust my Dockerfile to run as user root. The error message changes into
Unable to find debugger script at '/root/.vs-debugger'
Output shows
Unable to find debugger script at '/home/dockeruser/.vs-debugger'.
Initialization log:
Determining user folder on remote system...
Checking for existing installation of debugging tools...
Downloading debugger launcher...
Creating debugger installation folder: /home/dockeruser/.vs-debugger
Copying debugger launcher to /home/dockeruser/.vs-debugger/GetVsDbg.sh
Failed: Failed to copy files.
Unable to find debugger script at '/home/dockeruser/.vs-debugger'.
Failed: Unable to find debugger script at '/home/dockeruser/.vs-debugger'.
The program '[1] dotnet' has exited with code -1 (0xffffffff).
I can work around this by docker exec'ing a bash session on my container and running GetDbgVs.sh as detailed in https://stackoverflow.com/a/68950674/17273131, but its a pain to do - it feels like something is misconfigured.
I've already verified that my windows identity is a member of the windows docker-users group.
While not the answer I wanted, I've got a 1-liner shell workaround that I execute on my container when I want to debug attach with VS2019, once I know my <CONTAINER_NAME>. This may be useful to others with this problem.
docker exec -u root <CONTAINER_NAME> sh -c "apt-get update && apt-get install wget -y"; docker exec <CONTAINER_NAME> sh -c "mkdir -p ~/.vs-debugger; wget https://aka.ms/getvsdbgsh -O ~/.vs-debugger/GetVsDbg.sh; chmod a+x ~/.vs-debugger/GetVsDbg.sh"
The first command installs wget as root
The second command downloads GetVsDbg.sh to ~/.vs-debugger
I faced with this problem:
The NPM script 'start' exited without indicating that the create-react-app server was listening for requests. The error output was: 'rimraf' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! CallerPanelProject#0.1.0 start: `rimraf ./build && react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the CallerPanelProject#0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
))
TSystem.Threading.Tasks.Task<TResult>.GetResultCore(bool waitCompletionNotification)
I had this problem when made the Node SPA app inside ASP .NET Core and tried to perform start node app in the Production mode. In Development mode everything was OK.
This line in Stratup.cs file caused the problem:
spa.UseReactDevelopmentServer(npmScript: "start");
a source of the problem is: in the production mode Node app has been bundled already, i.e. it has no package.json and other Node related files, so start request is not possible to do.
A good way to fix that is to put start in to the clause:
if (env.IsDevelopment())
{
spa.UseReactDevelopmentServer(npmScript: "start");
}
You might have missed installing the dependencies in your source project. That is why it is unable to start to run your application without references.
Run npm install in your source project would resolve the issue
I ran into this problem, after starting afresh with Visual Studio 2019 after a longer break from it (so prette clean setup). It happened when I just tried to set up the simplest ASP.NET Core app, these are the steps I followed / roughly:
Check logs in "Event Viewer" for your app - there I found
"Could not find 'aspnetcorev2_inprocess.dll'. Exception message:
It was not possible to find any compatible framework version
The framework 'Microsoft.AspNetCore.App', version '2.2.0' was not found."
Went into Visual Studio Installer (Visual Studio | Tools | Get Tools and Features).
Select the "Individual Components" tab.
Check all (applicable) modules under .NET for ".NET Core .."-anything (I took them all).
Hit "Install while loading"
Restart Visual Studio.
Voila: ASP.NET core app started without errors.
I solved my problem by running "npm install rimraf" in the project folder.
A similar error as #JamesPoulose but I had installed npm. The problem was I installed it when Visual Studio was open. Event Viewer therefore showed me this error:
Category: Microsoft.AspNetCore.SpaServices
EventId: 0
'npm' is not recognized as an internal or external command,
A simple restart of Visual Studio fixed it.
In my case, it was a very silly problem. After re-installing my Windows, I missed installing npm altogether and then running npm install.
My colleague, Dave Wilson, fixed this for me. Went to our react project folder and deleted the node_modules. Next went to the command prompt and npm i in the project folder. Checked the output of npm i and saw that Python was not installed when the module fibres has a dependency on it. Installed python and added it to PATH in system variables. The key thing is to check the output of npm i.
I ran into this issue when Selecting HTTPS instead of HTTP. When running it on your localhost. Inside your visual studio project: Properties/launchSettings.json, change "applicationULR" to route to http instead of https(see image)
settings change
trying to get the sonar scanner running from the command line at the moment with just msbuild.exe solution.sln /rebuild it's currently failing on the post-processing step and i can't seem to get beyond that
my java path is set in: C:\Program Files (x86)\Common Files\Oracle\Java\javapath\java.exe. I tried updating my path to a location that didn't have any spaces in it but no luck.
I also tried using dotnet sonar scanner and msbuild sonar scanner. both with the same result
These are the steps i'm executing:
dotnet-sonarscanner begin /k:"key" /d:sonar.host.url="https://my_company_sonarqube.com" /d:sonar.login="token" /d:sonar.verbose=true
MSBuild.exe solution.sln /t:Rebuild /p:Platform="Any CPU"
dotnet-sonarscanner end /d:sonar.login="token"
Everything seems to work fine until i get to the post-processing step:
Executing file C:\Users\userid\.dotnet\tools\.store\dotnet-sonarscanner\4.7.1\dotnet-sonarscanner\4.7.1\tools\netcoreapp2.1\any\sonar-scanner-4.1.0.1829\bin\sonar-scanner.bat
Args: -Dsonar.scanAllFiles=true -Dproject.settings=C:\Users\userid\Documents\project_path\.sonarqube\out\sonar-project.properties --embedded --debug <sensitive data removed>
Working directory: C:\Users\userid\Documents\project_path
Timeout (ms):-1
Process id: 38116
Error: Could not find or load main class
Process returned exit code 1
The SonarQube Scanner did not complete successfully
19:53:44.155 Post-processing failed. Exit code: 1
Using the following JDK
java -version
java version "1.8.0_221"
Java(TM) SE Runtime Environment (build 1.8.0_221-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.221-b11, mixed mode)
ok so i'm not sure why i was getting the main class error. I re-ran everything using the sonarscanner batch script and then with a stripped down java call from the batch script and it seems like my problem was not having my ssl certificates for the sonarqube server.
Starting over and setting SONAR_SCANNER_OPTS seemed to do the trick.
set SONAR_SCANNER_OPTS = "-Djavax.net.ssl.trustStore="C:\path\to\trustStore"
When I tried to create dispatch-Model for my bot., I am getting following error - 'dispatch' is not recognized as an internal or external command, operable program or batch file.Before using dispatch command, I installed botdispatch using npm install -g botdispatch. But still I am getting this error.
Can you check your NPM folder to see if there is anything with dispatch there? Assuming you're on Windows, this is typically in AppData\Roaming\npm.
PowerShell:
dir $home\AppData\Roaming\npm
CMD:
dir %homepath%\AppData\Roaming\npm.
If dispatch (dispatch.cmd) is there, then it might be a pathing issue. Check your path variables to make sure that that path is there:
CMD:
echo %path%
PowerShell:
($env:path).Split(';')
So I was having this same issue, it turns out I needed to add the path of the NPM folder C:\Users\xxxxxx\AppData\Roaming\npm to my path for Powershell7.
$env:Path += ";C:\Users\xxxxxx\AppData\Roaming\npm"
Where xxxxxx is your userid. After adding this command to Powershell the npm modules began to work.
If you do not see this path by running this command below, then you need to add it with the one above.
($env:path).Split(';')
All of these should be ran inside of a PS7 window, I ran them with Administrator rights when I launched the Powershell 7 window.
I am struggling to install .NET Framework 3.5 on docker container. I have 4.5 installed already, but need 3.5 to run one Service. Here is my Dockerfile:
FROM microsoft/windowsservercore
SHELL ["powershell"]
RUN Install-WindowsFeature NET-Framework-45-ASPNET ; \
Install-WindowsFeature Web-Asp-Net45
RUN dism /online /enable-feature /featurename:NetFX3 /all
COPY Startup Startup
COPY Service Service
RUN "C:\Windows\Microsoft.NET\Framework\v4.0.30319\installutil.exe" WCS.WindowsService.exe
RUN mkdir Temp\Logs
ENTRYPOINT C:\Startup\setupBatch.bat
COPY ContainerApi ContainerApi
RUN Remove-WebSite -Name 'Default Web Site'
RUN New-Website -Name 'ContainerApi' -Port 80 \
-PhysicalPath 'C:\ContainerApi' -ApplicationPool '.NET v4.5'
EXPOSE 80
CMD ["ping", "-t", "localhost"]
When I try to build this, it gives me error on line RUN dism
Error: 0x800f081f
The source files could not be found.
Use the "Source" option to specify the location of the files that are required to restore the feature. For more information on specifying a source location, see http://go.microsoft.com/fwlink/?LinkId=243077.
Now, even if I run dism /online /enable-feature /featurename:NetFX3 /all inside the docker (docker exec) it will still give me the same error.
Anyone with any help?
I took the following steps to resolve this issue:
Got hold of the Windows Server 2016 Core ISO file. Mounted the file on local computer.
Extracted the {mount}:/sources/sxs folder into a zip file (sxs.zip). Ensure that the .NET Framework 3.5 cab file (microsoft-windows-netfx3-ondemand-package.cab) is present in the sxs folder. In my case, this was the only file present in the sxs folder.
Copy the sxs.zip file to my container. I copied it using the dockerfile of the image.
Unzip the file to C:\sources\sxs folder in the container.
Used the Install-WindowsFeature powershell command to install the feature.
Install-WindowsFeature -Name NET-Framework-Features -Source C:\sources\sxs -Verbose
Hope this helps. I also found the following blog useful in understanding the on-demand features.
https://blogs.technet.microsoft.com/askcore/2012/05/14/windows-8-and-net-framework-3-5/
For those who are still are in need of .Net3.5 and .Net4.X (4.7.2 for my case) version in one image.
Please note that MSFT is aware of this demand, and have a base image for this scenario.
Use FROM mcr.microsoft.com/dotnet/framework/sdk:3.5-20191008-windowsservercore-ltsc2019 in your dockerfile.
Saved me all the installation hassles.