ASP5 deploy to windows 7 server - continuous-integration

I'm developing web api in .NET 4.5.1. It is build on TeamCity CI server, but I would like to deploy it to the Windows 7 machine in the local network after every successful build.
I wanted to use dnu publish command, but I have no idea how to use it in this case and how to prepare Windows 7 machine to be ready to receive new, just builded application.
This issue is realy poorly described in case of new ASP.

You need to run:
dnu publish --runtime <name of runtime or "active">
Optionally, you can also pass --no-source.
Once you do that, the bin/output folder will have the application, its dependencies and the runtime. Then, all you have to do is copy that folder to your Win 7 machine.
Here's a script that does something similar for the MusicStore sample. We use it to deploy MusicStore on Nano Server

Related

Deploy docker contained backend on windows 11 by single file click

The task is - deploy Django rest backend via docker on clean Windows 11. It must be done by client clicking single application / bat file. Everything should be installed and set up automatically.
Docker related files are set up okay and test backend works well on ubuntu machine. But how to do automatic deploy on windows?
Using virtual machine with linux is not accepted as well.

Configure Teamcity bundled with Tomcat servlet container, as a Windows Service

I installed Teamcity 2018.1 bundled with Tomcat servlet container on windows 7. I start Teamcity server by running teamcity-server script from bin folder.
But I want to start Teamcity server when windows starts as a windows service.
The most simple approach to make TeamCity start as a service is to use TeamCity .exe distribution and opt for the service configuration in the installation wizard.
If you are proficient with Windows Services, you can also do that later: use "teamcity-server.bat usage" as a starting point for supported service commands.

Trouble building build over Web interface

I set up a CI server for Xamarin.Forms using TeamCity on a mini Mac. When I run the build command from the terminal as root it builds successfully, but when I try to fire up a build from the Web UI it fails with the following error:
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets(0,0):
Tool exited with code: 1. Output: mdimport will not import on behalf
of root user. Exiting.
Amr, I cannot speak to Mac, but in Windows TC installs by default with the system account which would prevent any program/tools installed under a specific user account to run from TC Web UI. In Windows, I had to change the account for the service under which the teamcity server runs. I'm guessing you would have to do the same for Mac.
Stop the TC server service. Change the service user from system to your user. Start the TC server service.
this happens when you do:
sudo mdimport
but not:
mdimport
So, make sure that you currently own the current folder and you have read, write and execute permissions as well.
The solution is to install TeamCity in the recommended directory which is the /Library/TeamCity folder.

System.PlatformNotSupported exception with service stack

I am trying to run a service stack application, it works fine on my dev machine when deployed on another box, I get System.PlatformNotSupported exception.
Stack trace below:
Unhandled Exception: System.PlatformNotSupportedException: Operation is not supported on this platform.
at System.Net.HttpListener..ctor()
at ServiceStack.Host.HttpListener.HttpListenerBase.Start(IEnumerable`1 urlBases, WaitCallback listenCallback)
at ServiceStack.Host.HttpListener.HttpListenerBase.Start(String urlBase)
at ExcaliburAppHost.Program.Main(String[] args)
I am trying to build a Restful app with self hosting (with no IIS support on the other box).
var listeningOn = args.Length == 0 ? "http://*:8090/" : args[0];
var appHost = new AppHost()
.Init()
.Start(listeningOn);
error occurs in AppHost().Start() method
If you have any unmanaged .dlls e.g. sqlite3.dll you may need to set the Platform Target of your project as x86.
You can also try running the Console App as Administrator / sudo in-case it's a permissions issue.
To whom facing with exception "System.PlatformNotSupportedException: ServiceController enables manipulating and accessing Windows services and it is not applicable for other operating systems." - in my case I had to add "System.ServiceProcess.ServiceController" NuGet package to my .net 5 Worker Service project and issue is gone.
For me, I was building a .NET 6 worker service in a Docker container on a Linux host, building a Windows service to run on Windows Server 2016. My csproj file has the following properties set, but I was receiving the same PlatformNotSupportedException as the OP:
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<OutputType>Exe</OutputType>
<InvariantGlobalization>true</InvariantGlobalization>
<PublishSingleFile>false</PublishSingleFile>
<SelfContained>true</SelfContained>
<RuntimeIdentifier>win-x86</RuntimeIdentifier>
<PublishReadyToRun>false</PublishReadyToRun>
I was able to resolve this by specifying the runtime option (-r win-x64) directly to the dotnet publish command in my Dockerfile.
Now the application builds from a Docker container running on a Linux host, but the resulting binaries run fine on the Windows Server 2016 platform.

Jenkins : Selenium GUI tests are not visible on Windows

When I run my selenium test (mvn test) from jenkins (windows) I see only the console output. I don't see the real browsers getting opened . How can I configure jenkins so that I can see the browsers running the test?
I had the same problem, i got the solution after many attempts.
This solution works ONLY on windows XP
If you are using jenkins as a windows service you need to do the following :
1) In windows service select the service of jenkins
2) Open properties window of the service -> Logon-> enable the checkbox "Allow service to interact with desktop"
After then you should reboot the service jenkins
Hope this help you :)
UPDATE:
Actually, I'm working on a an automation tool using Selenium on Windows 10, I've installed Jenkins ver. 2.207 as windows application (EXE file), it's running as windows service and ALL drivers (Chrome, FireFox, IE) are visible during test executions WITHOUT performing a mere configuration on the System or Jenkins
I got the solution. I ran jenkins from command prompt as "java -jar jenkins.war" instead of the windows installer version. Now I can see my browser based tests being executed.
If you are already doing what #Sachin suggests in a comment (i.e. looking at the machine where Jenkins actually runs) and still do not see the browsers, then your problem may be the following:
If you run Jenkins as a service in the background it won't open apps in the foreground. You may either try to run it not as a service in the foreground, or run it as a Local System account and check Allow the service to interact with desktop option. In the latter case you may get into permission problems, though.
Update: To make sure this answer is understood properly by others: Jenkins Windows 'native' installation is not really native. It's a wrapper around Java that runs it as a service.
To interact with desktop GUI, you should launch slave agent via JNLP:
https://wiki.jenkins-ci.org/display/JENKINS/Distributed+builds#Distributedbuilds-LaunchslaveagentviaJavaWebStart
After adding the node in Jenkins (configured as Java Web Start launch), just make a startup batch script on the node machine:
java -jar slave.jar -jnlpUrl http://{Your Jenkins Server}:8080/computer/{Your Jenkins Node}/slave-agent.jnlp
(slave.jar can be downloaded from http://{Your Jenkins Server}:8080/jnlpJars/slave.jar)
See more answers here:
How to run GUI tests on a jenkins windows slave without remote desktop connection?
In the case of Windows 7 you should not install jenkins as windows application (because in this recent version, Microsoft decided to give services their own hidden desktop even you enable the functionality "interact with desktop" in jenkins service), you may have to deploy it from a war file as follows:
1) Download jenkins.war from Jenkins official site
2) Deploy it by the command prompt : java -jar {directoryOfJenkinsFile}/jenkins.war
3) Now you can access jenkins administration on http:// localhost:8080
Hope that helps you !
this is an issue for Jenkins. on Windows it is possible to access logon user's session (screen) under system account. to make the UI testing visible, Jenkins needs to bypass UAC (user access
control) at background. this solution works for me with my own service running as system account.
I also faced the same issue earlier in my local machine (Windows 10).
My test was running perfectly from the NetBeans but when I moved to Jenkins it was only running in console mode. I was unable to view the UI.
So for that, you just need to make your local machine as a Jenkins slave by creating a new slave node in your Jenkins and select that node to execute the Jenkins job.
If jenkins installed by windows installer it is showing only Console out put only. To see browsers download jenkins.war file and run java -jar jenkins.war from command line.
Go through this site:
http://learnseleniumtesting.com/jenkins-and-continuous-test-execution/
If you have the following situation,
You are able to login to the remote machine
You don't see the Jenkins agent window
This slave machine is accessed by many users then try the following,
then try the following suggestion.
Login to slave machine
Go to Task manager
Users
Logout all the users
Then login again.
This worked for me.

Resources