hello, I have just a warning (no compile errors) but code does not build. "primary reference could not be resolved"

I think at this point I can't really find any solution without your help...

I linked c++ to c# using ClR, in order to use c++ algorithm in unity.
This works perfectly in normal C# file, but when I moved code to unity it gives me
a warning:
" Severity Code Description Project File Line Suppression State
Warning The primary reference "CppWrapper" could not be resolved because it has an indirect dependency on the .NET Framework assembly "System.ServiceProcess, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which has a higher version "4.0.0.0" than the version "2.0.0.0" in the current target framework. Assembly-CSharp "

here is code in c#:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
using UnityEngine;
using System.Collections;

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

//using System.Threading.Tasks;


public class newspawn_real : MonoBehaviour {
    

	// Use this for initialization
	void Start () {

        int maxgeneration_in_csharp = 150;

        int popsize_in_csharp = 50;

        int genesize_in_csharp = 20;

        int[,,] bam = new int[maxgeneration_in_csharp, popsize_in_csharp, genesize_in_csharp];

        int[,,] pam = new int[maxgeneration_in_csharp, popsize_in_csharp, genesize_in_csharp];

        unsafe
            {

                fixed (int * p = &bam[0, 0, 0])
                {
                    CppWrapper.CppWrapperClass controlCpp = new CppWrapper.CppWrapperClass();

                    controlCpp.allocate_both();
                    controlCpp.fill_both();
                    controlCpp.fill_wrapper();
                    for (int i = 0; i<maxgeneration_in_csharp; i++)
                        for(int j = 0; j<popsize_in_csharp; j++)
                            for(int k = 0; k<genesize_in_csharp; k++)
                                 bam[i, j, k] = controlCpp.ba_array_in_wrapper[i][j][k]; // mxolod bacteria


                    for (int i = 0; i<maxgeneration_in_csharp; i++)
                        for (int j = 0; j<popsize_in_csharp; j++)
                            for (int k = 0; k<genesize_in_csharp; k++)
                                pam[i, j, k] = controlCpp.pa_array_in_wrapper[i][j][k];

                    controlCpp.delete_both();
                }
}
            for (int i = 148; i< 149; i++)
                for (int j = 0; j< 50; j++)
                {
                    /*for (int k = 0; k< 20; k++)
                        Console.Write( bam[i, j, k]);
                             Console.WriteLine();
*/
                }
            for (int i = 148; i< 149; i++)
                for (int j = 0; j< 50; j++) 
                {
                /*
                    for (int k = 0; k< 20; k++)
                       Console.Write(pam[i, j, k]);
                   Console.WriteLine();
                   */
                }

    }
	
	
	// Update is called once per frame
	void Update () {
	
	}
}

I will really appreciate your any comment!
Last edited on
it was just about changing frameworks.
write click on project-> properties ->application-> target framework
Topic archived. No new replies allowed.