Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

getting an error when connecting two visual studio C# projects together

I have two C# Projects that I have linked via adding The second existing project to the first one, and then adding the second project as a reference. but when i run my first project im getting the following error:

Severity Code Description Project File Line Warning The primary reference "C:\Users\consultant10\Documents\Visual Studio 2015\Projects\dummyClientCare\dummyClientCare\bin\Debug\dummyClientCare.exe" could not be resolved because it was built against the ".NETFramework,Version=v4.5.2" framework. This is a higher version than the currently targeted framework ".NETFramework,Version=v4.5". insertIntoDataBase

and:

Severity Code Description Project File Line Warning The referenced project 'dummyClientCare' is targeting a higher framework version (4.5.2) than this project’s current target framework version (4.5). This may lead to build failures if types from assemblies outside this project’s target framework are used by any project in the dependency chain. insertIntoDataBase

how do i get over this hurdle? ..........the first project was created in visual studio 2012 band the referenced one in vs community 2015

like image 887
darren marela Avatar asked Aug 18 '15 07:08

darren marela


2 Answers

You need to change the Target Framework to be the same on both project.
Click on Project - Properties - Application.
Then in the dropdown, select .NET Framework 4.5.2.

The main issue is the compatbility between the versions of your projects. You should cannot use projects with upper version of your current project as a reference.

like image 84
Didier Aupest Avatar answered Sep 28 '22 10:09

Didier Aupest


  1. In Visual Studio 2015, in Solution Explorer, select your project. On the menu bar, open the Project menu and choose Unload project.

  2. On the menu bar, select File, Open, File. In the Open File dialog box, navigate to your project folder, and then open the project (.vcxproj) file.

  3. In the project file, locate the entry for the target Framework version. For example, if your project is designed to use the .NET Framework 4.5, locate <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> in the <PropertyGroup Label="Globals"> element of the <Project> element. If the <TargetFrameworkVersion> element isn't present, your project doesn't use the .NET Framework and no change is required.

  4. Change the value to the Framework version you want, such as v3.5 or v4.6.

  5. Save the changes and close the editor.

  6. In Solution Explorer, open the shortcut menu for your project and then choose Reload Project.

;)

like image 25
Aindriú Avatar answered Sep 28 '22 10:09

Aindriú