Home > Net >  How do i solve this ('.NETFramework,Version=v4.8) problem?
How do i solve this ('.NETFramework,Version=v4.8) problem?

Time:03-28

using System;
using Mathematik; //I can't add this library

namespace BeispielCsharp
{
    internal class Program
    {
        private static void Main(string[] args)
        {
 
        }
    }
}

//Mathematik

using System;

namespace Mathematik
{
    public class Operation
    {
        public string publicDaten { get; set; } 
        private string privateDaten { get; set; }
        internal string internalDaten { get; set; }

        private void samlung()
        {

        }
    }
    public class samlung
    {
        private void berechnung()
        {
            Operation i = new Operation();
            
        }
    }
}

Severity Code Description Project File Line Suppression State Error Project '..\Mathematik\Mathematik.csproj' targets 'net6.0'. It cannot be referenced by a project that targets '.NETFramework,Version=v4.8'. BeispielCsharp

CodePudding user response:

Your BeispielCsharp is version .net framework 4.8 and your Mathematik is of version 6.0. And you cannot use libraries that are on different framework version. So you have 2 options either update the BeispielCsharp to version 6 or downgrade the Mathematik to version 4.8.

You can see the .net version of the project by checking the .csproj. The .csproj is in your respected project folder

CodePudding user response:

The two projects are different frameworks, So You can't have one refer to the other. As Denis said, you have two options,I perfer to recommend you to migrate BeispielCsharp from .net Framework to .net core 6.0. Here are links1,links2 you can refer to.

  • Related