Giter Club home page Giter Club logo

Comments (3)

clairernovotny avatar clairernovotny commented on June 15, 2024

What is the TFM of your console application?

from msbuildsdkextras.

datoml avatar datoml commented on June 15, 2024

The TFM is set to net6.0-windows.
I made a Multi-Target library and referenced it to a net6.0 library that is also referenced in my console application.
So I think the issue was on my side that I used it wrong.
I had to reference the Multi-Target library in my net6.0-windows app and pass it with an interface to the .net6-0.

This is the correct and only way because the net6-0 library doesn't know the OS. Is this assumption correct?

from msbuildsdkextras.

datoml avatar datoml commented on June 15, 2024

It was 100% on my side. I mixed up some things in my head. 😅

If someone comes across the same "problem", this is the solution to it.

To give you a little bit of context. The idea is to create a multi-target library that is able to work with the .net6.0 TFM. What I do here is to separate android, linux and windows. Android is easy because there is a TFM for it. For linux and windows I use a separate configuration. Default will be windows.

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFrameworks>net6.0;net6.0-android</TargetFrameworks>
    <LangVersion>Preview</LangVersion>
  </PropertyGroup>

  <ItemGroup>
    <Compile Remove="Platforms\**\*.*" />
    <None Include="Platforms\**\*.*" />
  </ItemGroup>

  <ItemGroup Condition="$(TargetFramework.Contains('-android'))">
    <Compile Include="Platforms\Android\**\*.cs" />
  </ItemGroup>

  <ItemGroup Condition="!$(TargetFramework.Contains('-android')) and ($(Configuration) == 'Debug' or $(Configuration) == 'Release')">
    <Compile Include="Platforms\Windows\**\*.cs" />
  </ItemGroup>

  <ItemGroup Condition="!$(TargetFramework.Contains('-android')) and $(Configuration.Contains('-Linux'))">
    <Compile Include="Platforms\Linux\**\*.cs" />
  </ItemGroup>

</Project>

from msbuildsdkextras.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.