0

The steps I take are:

  1. I right click on project and then "Manage NuGet packages.."
  2. I search for Lucene.Net in the available packages (including pre-releases)
  3. I click install for version 4.8.0-beta00005
  4. I get the console error:

    Attempting to gather dependency information for package 'Lucene.Net.4.8.0-beta00005' with respect to project 'PegmaSyncWindowsService', targeting 'UAP,Version=v10.0.10586'

    Error: Could not install package 'Lucene.Net 4.8.0-beta00005'. You are trying to install this package into a project that targets 'UAP,Version=v10.0.10586', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

The thing is, my has .Net 4.5.1 as the target framework and it looks to me like Lucene.Net would/should work on this version of .Net.

Is there a way to get this dependency installed on my project?

I am using Visual Studio Community 2017

gus3001
  • 851
  • 9
  • 19

1 Answers1

0

Your error message indicates you are targeting UAP Version 10.0.10586. You have indicated in text that you are targeting.NET Framework 4.5.1. You have tagged your question with the xamarin tag.

Clearly you have conflicting versions here and you need to be sure you are targeting the framework you think you are. Make sure (by manually checking the .csproj files in your solution) that you are targeting .NET Framework 4.5.1 in your main project and all dependent projects.

Visual Studio 2017

Fortunately, in VS 2017 they made this easier to do. You can now simply right click the project and select Edit <projectName>.csproj.

Edit Project in Visual Studio 2017

Prior Versions of Visual Studio

  1. Right-click on your project node in Solution Explorer and click Unload Project.
  2. Right-click the project node again and click Edit <projectName>.csproj.

What to Look For

Here is an example of a MVC version mismatch that was resolved this way. It might help to create a fresh project from the MVC 5 template to see what an updated project is supposed to look like and then compare the differences between Web.config, Views/Web.config and .csproj files, and then cycle through each of the rest of the dependencies ensuring the version numbers are consistent and up-to-date.

Make sure to check if the .csproj files are using MSBuild conditions, as Visual Studio has no way to update these and they tend to be a major source of problems when it comes to upgrading.

If That Doesn't Work

Make sure you are using the latest update to Visual Studio 2017, as some of the earlier releases may not have the latest NuGet bits needed to install NuGet packages built with the latest tooling.

NightOwl888
  • 55,572
  • 24
  • 139
  • 212
  • Hi @NightOwl888 Unfortunately, that didn't work. What did work was updating the project to .net 4.6.1 – gus3001 Jan 31 '18 at 10:12