I have simple C# console application developed in Visual Studio 2008, which writes information in MySQL database. Is it possible to run the application in my hosting environment (Cent OS, with local MySQL database)? I have only control panel or ftp access to my hosting space. The database is only accessible from local (from the hosting space).
I have read something about Mono/Monodevelop, but those need to be run on the Cent OS, right? I don't have access to install this or other staffs on the hosting environment.
Given what you've specified about the environment and your limitations, not you can't run it.
You will need to have Mono installed to run a .NET app on Linux. If you can't install it, you're probably out of luck.
You could check with your hosting provider to see if they have other options.
If your hosting provider allows it, has mono installed, and you've verified that your application runs under mono you may be able to invoke the program via a shell command from php.
<?php
$output = shell_exec('mono myprogram.exe');
echo "<pre>$output</pre>";
?>
If your host has mono installed, and you have the ability to execute arbitrary shell commands from PHP, then you can run it. Otherwise no. Do you have the source to the program? If so, I would just port the code to PHP (or whatever your host provides).
Related
I'm writing a .NET Core application in C# that will run on a Linux server, but I need to impersonate a Windows user in order to access some remote resources on a Windows Server. I have credentials to authenticate there, but all the implementations I see rely on the "Advanced Windows 32 Base API" (advapi32.dll), which is a shared Windows library not available on Linux.
How do I make this work?
I was able to get a solution by thinking outside the box a bit. I discovered that I could use SharpCifs.Core for CIFS access and the Microsoft PowerShell SDK to gain a remote PowerShell session, and get environment variables. I do wish that Microsoft would write some better cross-platform tooling.
Mono project has a kind of wrapper of several linux commands, one of them is seteuid (the linux command used for impersonation). It could be worth having a look to the NuGet package Mono.Posix.NETStandard. It seems is going to be revamped in the new .Net 5 version. I'm not sure if it can fit your needs...
I'm really new at this, never hosted an app before, everything I've done so far has been locally.
I have a windows server 2008 sp1 running at work, with IIS installed. I access to it via remote desktop, and I need to be able to deploy my app, first locally on the server, so computers that can access it (through LAN) are able to use it.
Right now, if I create a folder and put some data in it, with an html file, and go to "localhost" in a browser, I can see the rendered html file.
The version installed is IIS 7.0, and my app is uses the MVC pattern, and .net framework 4.6.
If on my windows 10 PC I start my app (vs 2017) I can see it on my browser.
I want to be able to do what I do in my PC but on the server. How can I do this?
Update:
I tried Publishing the app through vs but that is on my windows pc and getting a lot of errors. What I know so far is that a guy from Networks gets the app by the developers and they publish it, but I don't know what kind of files does he need.
I followed tutorials but I just can't apply them.
As I said earlier, I have visual studio installed on my w10 PC, and tried publishing through that app to the ip where the server is, getting a lot of errors.
I don't know what to do, I'm really trying a lot of different things, but I don't even know how the app is supposed to look to be run in any way that is not how I run it in visual studio.
UPDATE:
I'm getting this error when I try to publish locally
Here is the Outline of what we need as per OPs requirement
In VS publish the App to a folder
Sort out the server prerequisites:
Turning Windows Feature On or Off for ASP.NET, ISAPI filters, ISAPI extensions, NET extensibility
Server should have .NetFramework installed
Copy the published folder to the Server
Configure IIS manager to add a new site and set physical path to published folder
I have a service written in C# that relies on features in .NET 4.5 that are not yet supported in any version of mono, so I have to use Windows servers. In other cases to deploy a network service I would just SCP a jar/tar/whatever over and then SSH over the deployment process, and that can be made a part of an sh script that can distribute to wherever. But because this is Windows, I don't have those tools and I'm at a bit of a loss as to how to deploy this to 20 (or more) different servers.
So I see that there is a publish process in MSVS 2012, but it seems to make use of Windows file shares or else I'm supposed to send it to a website of some kind(???) but it doesn't look like it has any way of starting it even if I could figure out how to get it there.
Is there some product that does this in Windows or would it be easier for me to just install an SSH server? I have remote desktop access, but would prefer not to have to deploy anything manually on them.
Thank you!
Try using Powershell with WMI. [This question] (https://superuser.com/questions/337810/how-can-i-remotely-install-or-uninstall-a-service-on-windows-server-2008-r2) discussed some approaches to install windows service remotely.
I have been working on a C# application which needs bug fixes and updates once i deliver it to clients. I am currently trying clickOnce method of microsoft to provide updates.
For that i need to publish my application to server with frontpage server extension (If i am not wrong!). We are using windows server 2008 enabled machine, with Apache running, i googled regarding "Publish c sharp application on Apache server" and i found this workaround.
It edits .htaccess file to allow access to VS to publish application. But it doesn't seem working. I guess the page is out dated, written in 2006.
So my questions are:
How do i publish c sharp app on apache box?
How do we publish app? Using VS or any other method?
The manifest and payload (files) just need to be generated and then copied en masse to your server, it doesn't have to be a Windows machine.
Publish to a local folder/share and then replace the entire ClickOnce folder so that the code security values remain intact. I'd suggest you always rename your current folder and then copy your latest bits into a "new" folder that is your install location.
i managed to give updates with this workaround (i dont know how feasible is this! Need inputs!)
I used database to track version numbers and (link for) latest copy of software. Then i check for updates on startup. If new update is available it downloads exe (in app itself), closes app and run the setup.
I am using install-shield to generate setup. But when i run setup in machine which is already having older version of software, it doesn't update it, even though it displays its updating.
I know visual studio also provides option to create installation, but it isn't working either!
Scenario
I have a server, that has NO Visual Studio Installed. It literally has a normal command prompt and nothing installed yet. We don't want to install anything (except the .Net framework which we have already done). We just want to install a bunch of C# Windows Services that we have written.
So far
I have been installing and running the windows service on my local machine using a "setup and deploy" project that I built into the application, which I could then use to install the service locally.
Question
How can I install the service on the server?
I imagine it can be done from the command prompt only, but what else do I need? - If anything? and where do I put the files that I want to install BEFORE I install them?
I imagine I will have to compile the application on my local machine in Visual Studio, then copy it over to the server, and then run an install utility to install it on the server?
Any help would be greatly appreciated.
according to this thread you need to run
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe C:\MyService.exe
(replace c:\windows with your windows path)
Your server has a sc.exe (service control) command which allows you to install, uninstall, start, stop and configure services - no Visual Studio bits needed.
Run sc.exe -? at a command prompt to get a listing of all available options
I add code similar to the one in this article to my services:
http://www.codeproject.com/KB/dotnet/WinSvcSelfInstaller.aspx
Then I can install/uninstall them just by typing ServiceName -i or ServiceName -u at the command prompt. Makes it easier if it'll be installed by people who don't know .Net.