1

I have a Class Library which needs the .NET reference to work as it utilizes a lot of System APIs but I am unable to add the reference from the Add References dialogue box. The .NET reference isn't available under Assemblies in the Reference Manager.

This is how my project looks like and I get the following error when I build this project:

There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\\mscorlib.dll", "x86". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project.

enter image description here

Following is the screenshot of my Reference Manager

enter image description here

I want the .NET reference as attached to the image below.Any idea how can I solve this issue? Thanks in advance :)

enter image description here

11
  • 1
    What reference? Commented Jan 17, 2018 at 11:01
  • .NET reference Commented Jan 17, 2018 at 11:02
  • required screenshots? Commented Jan 17, 2018 at 11:02
  • 1
    Can you please specify the specific reference you are having issues with? Commented Jan 17, 2018 at 11:03
  • 1
    What is ".NET reference"? A .NET class library should have the requisite system and similar references, you don't add a reference to ".NET". Can you be specific exactly what it is you want to add? Also, why do you need to add anything, show code that doesn't compile and tell us what you tried to add in order to fix that. Commented Jan 17, 2018 at 11:05

2 Answers 2

1

Found the answer to this question.

To resolve the process architecture mismatch issue, I followed the following steps :

First I uninstalled the nuget packages in my project.

Then I opened the properties of my project. Left-click your project and open Properties.

Click on Library in the left panel and under Targets click Change. If the .NET Framework is checked, uncheck it and save by clicking Ok.

Then re-install the nuget packages and build again. It worked like a charm. It seems that Visual Studio 2017 automatically adds the .NET reference. I believe its a bug in VS 2017

Sign up to request clarification or add additional context in comments.

Comments

0

To add one of the many .NET libraries, right-click on "References" and select "Add Reference".

The dialog that opens up has a menu on the left, and the .NET libraries can be found under "Assemblies" -> "Framework".

For example, System.Web.Services. (There is no ".NET reference" per se... it is divided into many assemblies).

Add Reference

2 Comments

There are no references available under Assemblies
Can you share your Reference Manager screenshot?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.