How to configure build for netcore and net4x in both windows and Linux

moh.hassan20's Avatar

moh.hassan20

02 May, 2019 07:50 PM

I run a multi-target project net40,net45 and netstndard2.0, netcoreapp2.1 in both windows and ubentu.

In build, I use the command

            ps: dotnet build Myproject -c Release
  
and for test:

              ps: dotnet test Myproject.Test
 
In windows it succeed because all frameworks are installed
In ubentu, it fail with a message:

>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

It seems that Mono is not installed on ubentu .
My Question:

How to configure appveyor.yml to set ubentu skip building net4x. i.e

in windows : build/test all frameworks.
In ubentu: only netstndars2.0, netcoreapp2.1

Powershell commands work in both windows and ubentu

2) Is there a plan to install Mono on ubentu.

  1. Support Staff 1 Posted by Ilya Finkelshte... on 02 May, 2019 11:08 PM

    Ilya Finkelshteyn's Avatar

    You can run dotnet build with -f (framework) parameter on Ubuntu. E.g. dotnet build Myproject -c Release -f netcoreapp2.1

    How to run different commands on Linux and Windows builds, you can learn here.

  2. 2 Posted by moh.hassan20 on 02 May, 2019 11:37 PM

    moh.hassan20's Avatar

    Thanks @Ilya for reply.
    The solution you provided is very nice and it works fine.
    Thanks for help.

    > // Please reply above this line
    >>> ==================================================
    >>>
    >>> *From*: Ilya Finkelshteyn (Support staff)
    >>>
    >>> You can run dotnet build with -f (framework) parameter on Ubuntu. E.g. dotnet
    >>> build Myproject -c Release -f netcoreapp2.1
    >>>
    >>> How to run different commands on Linux and Windows builds, you can learn
    >>> here
    >>> <https://www.appveyor.com/docs/getting-started-with-appveyor-for-linux/#running-windows-and-linux-builds-side-by-side>
    >>> .
    >>>
    >>> On Thu, May 02 at 12:50 PM PDT, moh.hassan20 wrote:
    >>>
    >>> I run a multi-target project net40,net45 and netstndard2.0,
    >>> netcoreapp2.1 in both windows and ubentu.
    >>>
    >>> In build, I use the command
    >>>
    >>> ps: dotnet build Myproject -c Release
    >>>
    >>> and for test:
    >>>
    >>> ps: dotnet test Myproject.Test
    >>>
    >>> In windows it succeed because all frameworks are installed
    >>> In ubentu, it fail with a message:
    >>>
    >>> >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
    >>>
    >>> It seems that Mono is not installed on ubentu .
    >>> My Question:
    >>>
    >>> How to configure appveyor.yml to set ubentu skip building net4x. i.e
    >>>
    >>> in windows : build/test all frameworks.
    >>> In ubentu: only netstndars2.0, netcoreapp2.1
    >>>
    >>> Powershell commands work in both windows and ubentu
    >>>
    >>> 2) Is there a plan to install Mono on ubentu.
    >>>
    >>>
    <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
    Virus-free.
    www.avg.com
    <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
    <#m_4095145224896703672_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

  3. Support Staff 3 Posted by Ilya Finkelshte... on 02 May, 2019 11:52 PM

    Ilya Finkelshteyn's Avatar

    Thank you :) We use it our selves to build multi-platform AppVeyor Server :)

  4. Ilya Finkelshteyn closed this discussion on 02 May, 2019 11:52 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac