tag:help.appveyor.com,2012-11-13:/discussions/questions/37287-how-to-configure-build-for-netcore-and-net4x-in-both-windows-and-linuxAppVeyor: Discussion 2019-05-02T23:52:24Ztag:help.appveyor.com,2012-11-13:Comment/472297382019-05-02T19:50:50Z2019-05-02T19:50:50ZHow to configure build for netcore and net4x in both windows and Linux<div><p>I run a multi-target project net40,net45 and netstndard2.0, netcoreapp2.1 in both windows and ubentu.</p>
<p>In build, I use the command</p>
<pre>
<code> ps: dotnet build Myproject -c Release</code>
</pre>
<p>and for test:</p>
<pre>
<code> ps: dotnet test Myproject.Test</code>
</pre>
<p>In windows it succeed because all frameworks are installed<br>
In ubentu, it fail with a message:</p>
<blockquote>
<p>error MSB3644: The reference assemblies for framework ".NETFramework,Version=v4.0" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you ha</p>
</blockquote>
<p>It seems that Mono is not installed on ubentu .<br>
My Question:</p>
<p>How to configure appveyor.yml to set ubentu skip building net4x. i.e</p>
<p>in windows : build/test all frameworks.<br>
In ubentu: only netstndars2.0, netcoreapp2.1</p>
<p>Powershell commands work in both windows and ubentu</p>
<p>2) Is there a plan to install Mono on ubentu.</p></div>moh.hassan20tag:help.appveyor.com,2012-11-13:Comment/472297382019-05-02T23:08:49Z2019-05-02T23:08:49ZHow to configure build for netcore and net4x in both windows and Linux<div><p>You can run <code>dotnet build</code> with <code>-f</code> (framework) parameter on Ubuntu. E.g. <code>dotnet build Myproject -c Release -f netcoreapp2.1</code></p>
<p>How to run different commands on Linux and Windows builds, you can learn <a href="https://www.appveyor.com/docs/getting-started-with-appveyor-for-linux/#running-windows-and-linux-builds-side-by-side">here</a>.</p></div>Ilya Finkelshteyntag:help.appveyor.com,2012-11-13:Comment/472297382019-05-02T23:37:13Z2019-05-02T23:37:13ZHow to configure build for netcore and net4x in both windows and Linux<div><p>Thanks @Ilya for reply.<br>
The solution you provided is very nice and it works fine.<br>
Thanks for help.</p>
<blockquote>
<p>// Please reply above this line</p>
<blockquote>
<blockquote>
<p>==================================================</p>
<p><em>From</em>: Ilya Finkelshteyn (Support staff)</p>
<p>You can run dotnet build with -f (framework) parameter on Ubuntu. E.g. dotnet build Myproject -c Release -f netcoreapp2.1</p>
<p>How to run different commands on Linux and Windows builds, you can learn here <a href="https://www.appveyor.com/docs/getting-started-with-appveyor-for-linux/#running-windows-and-linux-builds-side-by-side">https://www.appveyor.com/docs/getting-started-with-appveyor-for-linux/#running-windows-and-linux-builds-side-by-side</a> .</p>
<p>On Thu, May 02 at 12:50 PM PDT, moh.hassan20 wrote:</p>
<p>I run a multi-target project net40,net45 and netstndard2.0, netcoreapp2.1 in both windows and ubentu.</p>
<p>In build, I use the command</p>
<pre>
<code> ps: dotnet build Myproject -c Release</code>
</pre>
<p>and for test:</p>
<pre>
<code> ps: dotnet test Myproject.Test</code>
</pre>
<p>In windows it succeed because all frameworks are installed In ubentu, it fail with a message:</p>
<blockquote>
<p>error MSB3644: The reference assemblies for framework ".NETFramework,Version=v4.0" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you ha</p>
</blockquote>
<p>It seems that Mono is not installed on ubentu . My Question:</p>
<p>How to configure appveyor.yml to set ubentu skip building net4x. i.e</p>
<p>in windows : build/test all frameworks. In ubentu: only netstndars2.0, netcoreapp2.1</p>
<p>Powershell commands work in both windows and ubentu</p>
<p>2) Is there a plan to install Mono on ubentu.</p>
<p><a href="http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail">http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail</a><br>
Virus-free.<br>
<a href="http://www.avg.com">www.avg.com</a><br>
<a href="http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail">http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail</a><br>
<#m_4095145224896703672_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2></p>
</blockquote>
</blockquote>
</blockquote></div>moh.hassan20tag:help.appveyor.com,2012-11-13:Comment/472297382019-05-02T23:52:22Z2019-05-02T23:52:22ZHow to configure build for netcore and net4x in both windows and Linux<div><p>Thank you :) We use it our selves to build multi-platform <a href="https://www.appveyor.com/blog/2019/05/01/appveyor-server-available-for-download/">AppVeyor Server</a> :)</p></div>Ilya Finkelshteyn