<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Control WebPanel Wiki &#187; dotnet SDK</title>
	<atom:link href="https://wiki.centos-webpanel.com/tag/dotnet-sdk/feed" rel="self" type="application/rss+xml" />
	<link>https://wiki.centos-webpanel.com</link>
	<description>CentOS WebPanel Wiki</description>
	<lastBuildDate>Wed, 12 Feb 2025 20:38:16 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.1.1</generator>
	<item>
		<title>Install dotnet SDK and running a Project Example</title>
		<link>https://wiki.centos-webpanel.com/install-dotnet-sdk-and-running-a-project-example</link>
		<comments>https://wiki.centos-webpanel.com/install-dotnet-sdk-and-running-a-project-example#comments</comments>
		<pubDate>Wed, 05 Aug 2020 21:02:55 +0000</pubDate>
		<dc:creator><![CDATA[publisher]]></dc:creator>
				<category><![CDATA[Other]]></category>
		<category><![CDATA[dotnet SDK]]></category>

		<guid isPermaLink="false">http://wiki.centos-webpanel.com/?p=1411</guid>
		<description><![CDATA[Installation of dotnet on CWP server : First install .net package repo from official Microsoft site : rpm -Uvh https://packages.microsoft.com/config/rhel/7/packages-microsoft-prod.rpm To install dotnet SDK 2.2 yum install dotnet-sdk-2.2 -y To install dotnet SDK 3.1 LTS : yum install dotnet-sdk-3.1 -y you can check the main dotnet version by running this command : dotnet --version How [&#8230;]]]></description>
				<content:encoded><![CDATA[<h3>Installation of dotnet on CWP server :</h3>
<p>First install .net package repo from official Microsoft site :</p>
<pre>rpm -Uvh https://packages.microsoft.com/config/rhel/7/packages-microsoft-prod.rpm
</pre>
<p>To install dotnet SDK 2.2</p>
<pre>yum install dotnet-sdk-2.2 -y</pre>
<p>To install dotnet SDK 3.1 LTS :</p>
<pre>yum install dotnet-sdk-3.1 -y</pre>
<p>you can check the main dotnet version by running this command :</p>
<pre>dotnet --version
</pre>
<h3><strong>How to Create project - example:</strong></h3>
<p>to create a project or download any existing prebuild project you need to follow this steps:<br />
<strong>Login into ssh with the username</strong> of your account user (<strong>ensure you enabled the full shell access for that user</strong>)<br />
or from root you can run this command to change the user :</p>
<pre>su - username -s /bin/bash
</pre>
<p>now go to user dir public_html:</p>
<pre>cd /home/username/public_html</pre>
<p>Download pre build ASP core project, we're using "movie-app-list" as an example :</p>
<pre>git clone https://github.com/do-community/movie-app-list.git movie-app-list
</pre>
<p>Then enter the project dir :</p>
<pre>cd movie-app-list</pre>
<p>before we do the configuration this project needs MySQL DB and MySQL User for its data storage, you can simply create MySQL user and DB from user panel as well as admin panel.</p>
<p>after you <strong>create db</strong> and its <strong>user</strong> add those details in "<strong>appsettings.json</strong>"</p>
<pre>{
  "Logging": {
    "LogLevel": {
      "Default": "Warning"
    }
  },
  "AllowedHosts": "*",
  "ConnectionStrings": {
    "MovieContext": "Server=localhost;User Id=<span style="color: #ff0000;"><strong>user_netdb</strong></span>;Password=<strong><span style="color: #ff0000;">dqrESQo3</span></strong>;Database=<strong><span style="color: #ff0000;">user_netdb</span></strong>" } }</pre>
<p><strong>Now build the application :</strong></p>
<p><strong>you need to run this as root :</strong></p>
<pre>dotnet ef database update
dotnet build
dotnet publish
</pre>
<p>**upper commands will install csharp and all other dependencies.</p>
<p>Then fix the user permission :</p>
<pre>cd /home/username/public_html
chown -R username:username *
</pre>
<p>Now again login to ssh as user and run the below command to start the application by<strong> default application is set to run</strong> on<strong> localhost:5000</strong></p>
<p>Now start the application via this command :</p>
<pre>$ su - username -s /bin/bash
$ /usr/bin/dotnet /home/username/public_html/movie-app-list/bin/Debug/netcoreapp2.2/publish/MvcMovie.dll</pre>
<p>After that <strong>Ensure you've installed Nginx from CWP</strong> for <strong>port 5000 proxy</strong> go to :</p>
<p><strong>ADMIN &gt;&gt; Webserver Settings &gt;&gt; Webserserver domain conf &gt;&gt; Choose user &gt;&gt; Create config under domain you need to proxy dotnet application &gt;&gt; Choose "nginx -&gt; proxy -&gt; (custom-port)</strong>" and<strong> choose force https template</strong> tick <strong>rebuild vhost</strong> and <strong>save changes</strong> and done.</p>
<p>* don't forget to set your app port!</p>
<p>go to the domain name and see your application is live there.</p>
<p><strong>Troubleshoot guide :</strong></p>
<p>If you get too many files open you simply need to increase the open file limit for the user from edit user account.</p>
]]></content:encoded>
			<wfw:commentRss>https://wiki.centos-webpanel.com/install-dotnet-sdk-and-running-a-project-example/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
