Error nu1105 unable to find project information for

Внезапно я получаю следующие ошибки для 3 проектов в решении: Error NU1105 Unable to find project information for 'C:codeexamplesrclibsexample.I18nexample.I18n.csproj'. The project file may be invalid or missing targets required for restore. В проекте изменились только некоторые вещи - пара ....

Внезапно я получаю следующие ошибки для 3 проектов в решении:

Error NU1105 Unable to find project information for 'C:codeexamplesrclibsexample.I18nexample.I18n.csproj'. 
The project file may be invalid or missing targets required for restore.

В проекте изменились только некоторые вещи — пара изменений БД, но в прошлом проблем не было. Единственное, что я обновил до Visual Studio 2017 15.5, это может вызвать проблемы?

Я пробовал — удаление и повторное решение от контроля источника. Но все равно получаю ошибку. Никаких проблем на машинах моих коллег, поэтому должно быть что-то локальное.

Пример одного из файлов .csproj, если это помогает:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>net452</TargetFramework>
    <AssemblyName>Example.I18n</AssemblyName>
    <PackageId>Example.I18n</PackageId>
    <GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
    <GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
    <GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="1.1.2" />
    <PackageReference Include="Microsoft.Extensions.Logging" Version="1.1.1" />
    <PackageReference Include="MessageFormat" Version="1.0.1" />
  </ItemGroup>

  <ItemGroup Condition=" '$(TargetFramework)' == 'net452' ">
    <Reference Include="System" />
    <Reference Include="Microsoft.CSharp" />
  </ItemGroup>

</Project>

8 ответов

Лучший ответ

Для меня оболочка файла проекта на диске не совпадает с оболочкой в файле решения.

Скажем, у меня есть решение с LibraryA.csproj и LibraryB.csproj, где LibraryB.csproj имеет ссылку на LibraryA.csproj. Неправильный регистр для LibraryA.csproj в файле решения может вызвать NU1105 при сборке LibraryB.csproj:

Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibraryA", "LibraryALibrarya.csproj", "{24DEBB3B-762A-491D-8B83-6D078C0B30C0}"

Я начал видеть эту проблему после обновления до версии 15.5 Visual Studio 2017. Я не сталкивался с этой проблемой с версией 15.4.5.


16

Chris
10 Дек 2017 в 23:18

У меня есть следующая структура проекта (.Net Core проектов):

../classLib
../../../webProject1
../../../webProject2
../../myWebProjects.sln

webProject1 и webProject2 ссылаются на classLib как на сам проект (а не на .dll). Когда я открыл свое решение в VS 2019 и попытался собрать, я получил идентичную ошибку error NU1105: Unable to find project information for '../classLib.csproj'..

Перед сборкой зависимых проектов необходимо восстановить там зависимости. Что я сделал, просто добавлю рядом Target с моими webProject1.csproj и webProject2.csproj файлами.

<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
    <Exec Command="dotnet restore" />
</Target>


2

itim
9 Июл 2019 в 10:42

Я также получил то же самое после обновления до версии 15.6 Visual Studio 2017.

Закрытие VS и удаление папки .vs исправили это для меня.


59

Alexandre Brisebois
11 Дек 2017 в 19:11

Недавно я столкнулся с ошибкой NU1105 при использовании JetBrains Rider в Linux. Так что это касается Mono и версии MSBuild, которая идет с ним.

Оказывается, это было вызвано тем, что мои файлы решений находились в каталоге, который был символической ссылкой на другой каталог. Я считаю, что MSBuild разыменовывал связанный каталог и вместо этого ссылался на исходный каталог. Это делает некоторые из указанных путей совершенно разными, даже если это те же самые файлы, регистр и все остальное. Открытие решения из исходного местоположения теперь прекрасно работает для меня.

То, что работало для меня, было

  1. Удалить оскорбительный проект
  2. Постройте решение
  3. Повторно добавьте проект.


3

Kevin Brydon
6 Сен 2018 в 22:46

Я столкнулся с этой ошибкой при наличии дублирующейся ссылки на проект.

<ProjectReference Include="..ProjectA.csproj" />
<ProjectReference Include="..ProjectA.csproj" />

Удаление дубликата ссылки решило ошибку.


5

Adam
23 Авг 2018 в 21:47

Кажется, что некоторые проекты были удалены из файла решения (не знаю почему). Исправлено путем отмены этих изменений файла решения


3

FindOutIslamNow
11 Июл 2018 в 10:56

Это сообщение об ошибке также появляется, если указанный проект не включен в решение. Я столкнулся с этой проблемой сегодня и нашел исправление здесь.


8

Tyson Williams
27 Июл 2018 в 01:10

All of a sudden, I am getting the following errors for 3 projects in a solution:

Error NU1105 Unable to find project information for 'C:codeexamplesrclibsexample.I18nexample.I18n.csproj'. 
The project file may be invalid or missing targets required for restore.

The only thing that has changed in the project is a couple of DB changes, but I never had any issues in the past. The only other thing is that I updated to Visual Studio 2017 15.5. Could that cause issues?

I have tried removing and recloning the solution from source control, but still getting errors. No problems on my colleagues’ machines, so it must be something local.

Example of one of the .csproj files if this helps:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>net452</TargetFramework>
    <AssemblyName>Example.I18n</AssemblyName>
    <PackageId>Example.I18n</PackageId>
    <GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
    <GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
    <GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="1.1.2" />
    <PackageReference Include="Microsoft.Extensions.Logging" Version="1.1.1" />
    <PackageReference Include="MessageFormat" Version="1.0.1" />
  </ItemGroup>

  <ItemGroup Condition=" '$(TargetFramework)' == 'net452' ">
    <Reference Include="System" />
    <Reference Include="Microsoft.CSharp" />
  </ItemGroup>

</Project>

13 Answers

I also got the same after upgrading to version 15.6 of Visual Studio 2017.

Closing VS and deleting the .vs folder fixed it for me.

For me, the casing of the project file on disk did not match the casing in the solution file.

Say I had a solution with LibraryA.csproj and LibraryB.csproj, where LibraryB.csproj has a reference to LibraryA.csproj. Having an incorrect casing for LibraryA.csproj in the solution file would cause NU1105 when building LibraryB.csproj:

Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibraryA", "LibraryALibrarya.csproj", "{24DEBB3B-762A-491D-8B83-6D078C0B30C0}"

I started seeing this problem after upgrading to version 15.5 of Visual Studio 2017. I did not encounter this problem with version 15.4.5.

This error message will also occur if a referenced project is not included in the solution. I encountered this problem today, and I found the fix here.

I encountered this error when having a duplicate reference to a project.

<ProjectReference Include="..ProjectA.csproj" />
<ProjectReference Include="..ProjectA.csproj" />

Removing the duplicate reference resolved the error.

What worked for me was to

  1. Remove the offending project
  2. Build the solution
  3. Re-add the project.

I had this problem and I just followed what the error message recommends inside VS: to restore the solution.
So I chdir into the directory with the solution (.sln) file and just issued

C:> dotnet restore

Problem was fixed.

Seems that some projects were removed from solution file (don’t know why). Fixed by undoing these solution file changes

I have next project structure (.Net Core projects):

../classLib
../../../webProject1
../../../webProject2
../../myWebProjects.sln

webProject1 and webProject2 reference classLib as project itself (not as .dll). When I opened my solution in VS 2019 and tried to build I got identical error NU1105: Unable to find project information for '../classLib.csproj'. error.

Before build depended projects you need to restore there dependency. What I did, just add
next Target to my webProject1.csproj and webProject2.csprojfiles.

<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
    <Exec Command="dotnet restore" />
</Target>

I recently came across Error NU1105 while using JetBrains Rider on Linux. So this involves Mono and the MSBuild version that comes with it.

It turns out this was being caused by my solution files being in a directory that was a symbolic link to another directory. I believe MSBuild was dereferencing the linked directory and instead referencing the source directory. This makes some of the referenced paths completely different, even though they are the exact same files, case, everything else. Opening the solution from the original location works perfectly now for me.

I was getting this error error NU1105: Unable to find project information for ‘C:folder2project1.csproj’.
but project1 that I had as part of the solution was located in C:folder1project1.csproj (it was also there in c:folder2project1.csproj too but not part of the solution, so it was confusing)
Once I changed the reference to the correct location of the project it worked.

I correct this error by simply running the clean solution option.
Right click the solution in the solution explorer and choose clean solution.

This is insane, i tried all this:
updated VS. manually deleted all bin folders, run dotnet restore, clean rebuild nothing works

solution: finally i unload all the projects and start reloading them into solution, one by one in the order they show dependency errors. then the last one just cascade fixes everything. No idea what was wrong

Я также получил то же самое после обновления до версии 15.6 Visual Studio 2017.

Закрытие VS и удаление папки .vs исправили это для меня.

Для меня корпус файла проекта на диске не соответствовал корпусу в файле решения.

Скажем, у меня было решение с LibraryA.csproj и LibraryB.csproj , где LibraryB.csproj имеет ссылку на LibraryA.csproj . Наличие неправильного регистра для LibraryA.csproj в файле решения приведет к NU1105 при построении LibraryB.csproj :

Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibraryA", "LibraryALibrarya.csproj", "{24DEBB3B-762A-491D-8B83-6D078C0B30C0}"

Я начал сталкиваться с этой проблемой после обновления до версии 15.5 Visual Studio 2017. Я не сталкивался с этой проблемой в версии 15.4.5.

Это сообщение об ошибке также появляется, если указанный проект не включен в решение. Я столкнулся с этой проблемой сегодня, и я нашел исправление здесь .

Я столкнулся с этой ошибкой при наличии дублирующей ссылки на проект.

<ProjectReference Include="..ProjectA.csproj" />
<ProjectReference Include="..ProjectA.csproj" />

Удаление повторяющейся ссылки устранило ошибку.

Что сработало для меня, так это

  1. Удалить проект-нарушитель
  2. Создайте решение
  3. Повторно добавьте проект.

Кажется, что некоторые проекты были удалены из файла решения (не знаю, почему). Исправлено путем отмены этих изменений файла решения

У меня есть следующая структура проекта (проекты .Net Core):

../classLib
../../../webProject1
../../../webProject2
../../myWebProjects.sln

webProject1 и webProject2 ссылаются classLib как на сам проект (а не как .dll ). Когда я открыл свое решение в VS 2019 и попытался собрать, я получил идентичную ошибку error NU1105: Unable to find project information for '../classLib.csproj'. .

Перед сборкой зависимых проектов вам необходимо восстановить их зависимость. Что я и сделал, просто добавил следующие Target в мои файлы webProject1.csproj и webProject2.csproj .

<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
    <Exec Command="dotnet restore" />
</Target>

Недавно я столкнулся с ошибкой NU1105 при использовании JetBrains Rider в Linux. Так что это касается Mono и версии MSBuild, которая идет с ним.

Оказывается, это было вызвано тем, что мои файлы решений находились в каталоге, который был символической ссылкой на другой каталог. Я считаю, что MSBuild разыменовывал связанный каталог и вместо этого ссылался на исходный каталог. Это делает некоторые из указанных путей совершенно разными, даже если они являются одними и теми же файлами, регистром и всем остальным. Открытие решения из исходного местоположения теперь отлично работает для меня.

Я получал эту ошибку NU1105: невозможно найти информацию о проекте для «C:folder2project1.csproj». но project1, который у меня был как часть решения, находился в C:folder1project1.csproj (он также был там в c:folder2project1.csproj, но не был частью решения, поэтому это сбивало с толку) Однажды я изменил ссылку на правильное расположение проекта, он работал.

Error NU1105 Unable to find project information — The project file may be invalid or missing targets required for restore

Questions : Error NU1105 Unable to find project information — The project file may be invalid or missing targets required for restore

2023-02-06T14:50:00+00:00 2023-02-06T14:50:00+00:00

773

All of a sudden, I am getting the following articles uvdos visual-studio errors for 3 projects in a solution:

Error NU1105 Unable to find project information for 'C:codeexamplesrclibsexample.I18nexample.I18n.csproj'. 
The project file may be invalid or missing targets required for restore.

The only thing that has changed in the articles uvdos visual-studio project is a couple of DB changes, but I articles uvdos visual-studio never had any issues in the past. The only articles uvdos visual-studio other thing is that I updated to Visual articles uvdos visual-studio Studio 2017 15.5. Could that cause issues?

I have tried removing and recloning the articles uvdos visual-studio solution from source control, but still articles uvdos visual-studio getting errors. No problems on my articles uvdos visual-studio colleagues’ machines, so it must be articles uvdos visual-studio something local.

Example of one of the .csproj files if this articles uvdos visual-studio helps:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>net452</TargetFramework>
    <AssemblyName>Example.I18n</AssemblyName>
    <PackageId>Example.I18n</PackageId>
    <GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
    <GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
    <GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="1.1.2" />
    <PackageReference Include="Microsoft.Extensions.Logging" Version="1.1.1" />
    <PackageReference Include="MessageFormat" Version="1.0.1" />
  </ItemGroup>

  <ItemGroup Condition=" '$(TargetFramework)' == 'net452' ">
    <Reference Include="System" />
    <Reference Include="Microsoft.CSharp" />
  </ItemGroup>

</Project>

Total Answers 17

30

Answers 1 : of Error NU1105 Unable to find project information — The project file may be invalid or missing targets required for restore

I also got the same after upgrading to blogs uvdos visual-studio version 15.6 of Visual Studio 2017.

Closing VS and deleting the .vs folder blogs uvdos visual-studio fixed it for me.

0

2023-02-06T14:50:00+00:00 2023-02-06T14:50:00+00:00Answer Link

mRahman

6

Answers 2 : of Error NU1105 Unable to find project information — The project file may be invalid or missing targets required for restore

For me, the casing of the project file blogs uvdos visual-studio on disk did not match the casing in the blogs uvdos visual-studio solution file.

Say I had a solution with blogs uvdos visual-studio LibraryA.csproj and LibraryB.csproj, blogs uvdos visual-studio where LibraryB.csproj has a reference to blogs uvdos visual-studio LibraryA.csproj. Having an incorrect blogs uvdos visual-studio casing for LibraryA.csproj in the blogs uvdos visual-studio solution file would cause NU1105 when blogs uvdos visual-studio building LibraryB.csproj:

Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibraryA", "LibraryALibrarya.csproj", "{24DEBB3B-762A-491D-8B83-6D078C0B30C0}"

I started seeing this problem after blogs uvdos visual-studio upgrading to version 15.5 of Visual blogs uvdos visual-studio Studio 2017. I did not encounter this blogs uvdos visual-studio problem with version 15.4.5.

0

2023-02-06T14:50:00+00:00 2023-02-06T14:50:00+00:00Answer Link

rohim

3

Answers 3 : of Error NU1105 Unable to find project information — The project file may be invalid or missing targets required for restore

This error message will also occur if a blogs uvdos visual-studio referenced project is not included in blogs uvdos visual-studio the solution. I encountered this blogs uvdos visual-studio problem today, and I found the fix here.

0

2023-02-06T14:50:00+00:00 2023-02-06T14:50:00+00:00Answer Link

joya

1

Answers 4 : of Error NU1105 Unable to find project information — The project file may be invalid or missing targets required for restore

I had this problem and I just followed blogs uvdos visual-studio what the error message recommends inside blogs uvdos visual-studio VS:
to restore the solution.

So I opened a command line or package blogs uvdos visual-studio manager console, chdir into the blogs uvdos visual-studio directory with the solution (.sln) file blogs uvdos visual-studio and just issued

C:> dotnet restore .mySolution.sln

Problem was fixed.

0

2023-02-06T14:50:00+00:00 2023-02-06T14:50:00+00:00Answer Link

yousuf

4

Answers 5 : of Error NU1105 Unable to find project information — The project file may be invalid or missing targets required for restore

I encountered this error when having a blogs uvdos visual-studio duplicate reference to a project.

<ProjectReference Include="..ProjectA.csproj" />
<ProjectReference Include="..ProjectA.csproj" />

Removing the duplicate reference blogs uvdos visual-studio resolved the error.

0

2023-02-06T14:50:00+00:00 2023-02-06T14:50:00+00:00Answer Link

joya

6

Answers 6 : of Error NU1105 Unable to find project information — The project file may be invalid or missing targets required for restore

What worked for me was to

  1. Remove the offending project
  2. Build the solution
  3. Re-add the project.

0

2023-02-06T14:50:00+00:00 2023-02-06T14:50:00+00:00Answer Link

karim

6

Answers 7 : of Error NU1105 Unable to find project information — The project file may be invalid or missing targets required for restore

Seems that some projects were removed blogs uvdos visual-studio from solution file (don’t know why). blogs uvdos visual-studio Fixed by undoing these solution file blogs uvdos visual-studio changes

0

2023-02-06T14:50:00+00:00 2023-02-06T14:50:00+00:00Answer Link

rohim

3

Answers 8 : of Error NU1105 Unable to find project information — The project file may be invalid or missing targets required for restore

I have next project structure (.Net Core blogs uvdos visual-studio projects):

../classLib
../../../webProject1
../../../webProject2
../../myWebProjects.sln

webProject1 and webProject2 reference blogs uvdos visual-studio classLib as project itself (not as blogs uvdos visual-studio .dll). When I opened my solution in VS blogs uvdos visual-studio 2019 and tried to build I got identical blogs uvdos visual-studio error NU1105: Unable to find project blogs uvdos visual-studio information for ‘../classLib.csproj’. blogs uvdos visual-studio error.

Before build depended projects you need blogs uvdos visual-studio to restore there dependency. What I did, blogs uvdos visual-studio just add
next Target to my blogs uvdos visual-studio webProject1.csproj and blogs uvdos visual-studio webProject2.csprojfiles.

<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
    <Exec Command="dotnet restore" />
</Target>

0

2023-02-06T14:50:00+00:00 2023-02-06T14:50:00+00:00Answer Link

joya

4

Answers 9 : of Error NU1105 Unable to find project information — The project file may be invalid or missing targets required for restore

I recently came across Error NU1105 blogs uvdos visual-studio while using JetBrains Rider on Linux. So blogs uvdos visual-studio this involves Mono and the MSBuild blogs uvdos visual-studio version that comes with it.

It turns out this was being caused by my blogs uvdos visual-studio solution files being in a directory that blogs uvdos visual-studio was a symbolic link to another blogs uvdos visual-studio directory. I believe MSBuild was blogs uvdos visual-studio dereferencing the linked directory and blogs uvdos visual-studio instead referencing the source blogs uvdos visual-studio directory. This makes some of the blogs uvdos visual-studio referenced paths completely different, blogs uvdos visual-studio even though they are the exact same blogs uvdos visual-studio files, case, everything else. Opening blogs uvdos visual-studio the solution from the original location blogs uvdos visual-studio works perfectly now for me.

0

2023-02-06T14:50:00+00:00 2023-02-06T14:50:00+00:00Answer Link

yousuf

4

Answers 10 : of Error NU1105 Unable to find project information — The project file may be invalid or missing targets required for restore

Reload the project which causes the blogs uvdos visual-studio problem, this will fix the issue,

As mentioned in the following link :

https://docs.microsoft.com/en-us/nuget/reference/errors-and-warnings/nu1105

0

2023-02-06T14:50:00+00:00 2023-02-06T14:50:00+00:00Answer Link

rohim

2

Answers 11 : of Error NU1105 Unable to find project information — The project file may be invalid or missing targets required for restore

I correct this error by simply running blogs uvdos visual-studio the clean solution option.
Right click blogs uvdos visual-studio the solution in the solution explorer blogs uvdos visual-studio and choose clean solution.

0

2023-02-06T14:50:00+00:00 2023-02-06T14:50:00+00:00Answer Link

karim

1

Answers 12 : of Error NU1105 Unable to find project information — The project file may be invalid or missing targets required for restore

This is insane, i tried all blogs uvdos visual-studio this:
updated VS. manually deleted all blogs uvdos visual-studio bin folders, run dotnet restore, clean blogs uvdos visual-studio rebuild nothing works

solution: finally i unload all the blogs uvdos visual-studio projects and start reloading them into blogs uvdos visual-studio solution, one by one in the order they blogs uvdos visual-studio show dependency errors. then the last blogs uvdos visual-studio one just cascade fixes everything. No blogs uvdos visual-studio idea what was wrong

0

2023-02-06T14:50:00+00:00 2023-02-06T14:50:00+00:00Answer Link

yousuf

1

Answers 13 : of Error NU1105 Unable to find project information — The project file may be invalid or missing targets required for restore

In my case I did it and it worked for me

  1. goto Tools/CommandLine/Developer Command Prompt or Developer Powershell
  2. type this command and Enter «dotnet restore».
  3. Build your solution

That’s all

0

2023-02-06T14:50:00+00:00 2023-02-06T14:50:00+00:00Answer Link

joya

2

Answers 14 : of Error NU1105 Unable to find project information — The project file may be invalid or missing targets required for restore

Open powershell and running restore blogs uvdos visual-studio command solved my issue.

dotnet restore Sample.sln

0

2023-02-06T14:50:00+00:00 2023-02-06T14:50:00+00:00Answer Link

rohim

6

Answers 15 : of Error NU1105 Unable to find project information — The project file may be invalid or missing targets required for restore

I was getting this error error NU1105: blogs uvdos visual-studio Unable to find project information for blogs uvdos visual-studio ‘C:folder2project1.csproj’.
but blogs uvdos visual-studio project1 that I had as part of the blogs uvdos visual-studio solution was located in blogs uvdos visual-studio C:folder1project1.csproj (it was also blogs uvdos visual-studio there in c:folder2project1.csproj too blogs uvdos visual-studio but not part of the solution, so it was blogs uvdos visual-studio confusing)
Once I changed the reference blogs uvdos visual-studio to the correct location of the project blogs uvdos visual-studio it worked.

0

2023-02-06T14:50:00+00:00 2023-02-06T14:50:00+00:00Answer Link

joya

3

Answers 16 : of Error NU1105 Unable to find project information — The project file may be invalid or missing targets required for restore

After spending 3 hours, trying out blogs uvdos visual-studio numerous solutions, what worked for me blogs uvdos visual-studio is that I had to undo my root solution blogs uvdos visual-studio sln file…some of the project blogs uvdos visual-studio references were removed..not sure how.

0

2023-02-06T14:50:00+00:00 2023-02-06T14:50:00+00:00Answer Link

joya

2

Answers 17 : of Error NU1105 Unable to find project information — The project file may be invalid or missing targets required for restore

This happend to me when I had files with blogs uvdos visual-studio names exceeding OS’s max path limit. blogs uvdos visual-studio Check your names ;)

0

2023-02-06T14:50:00+00:00 2023-02-06T14:50:00+00:00Answer Link

karim

Внезапно я получаю следующие ошибки для 3-х проектов в решении:

Error NU1105 Unable to find project information for 'C:codeexamplesrclibsexample.I18nexample.I18n.csproj'. 
The project file may be invalid or missing targets required for restore.

В проекте только что изменились, это несколько изменений в БД, но в прошлом никогда не было никаких проблем. Только что я обновил Visual Studio 2017 15.5, может ли это вызвать проблему?

Я попробовал — удаление и повторное решение из исходного элемента управления. Но все еще ошибка. Никаких проблем с машинами моих коллег не должно быть что-то местное.

Пример одного из файлов .csproj, если это помогает:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>net452</TargetFramework>
    <AssemblyName>Example.I18n</AssemblyName>
    <PackageId>Example.I18n</PackageId>
    <GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
    <GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
    <GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="1.1.2" />
    <PackageReference Include="Microsoft.Extensions.Logging" Version="1.1.1" />
    <PackageReference Include="MessageFormat" Version="1.0.1" />
  </ItemGroup>

  <ItemGroup Condition=" '$(TargetFramework)' == 'net452' ">
    <Reference Include="System" />
    <Reference Include="Microsoft.CSharp" />
  </ItemGroup>

</Project>

4b9b3361

Ответ 1

Для меня оболочка файла проекта на диске не соответствует оболочке в файле решения.

Скажем, у меня было решение с LibraryA.csproj и LibraryB.csproj, где LibraryB.csproj имеет ссылку на LibraryA.csproj. Наличие неправильного корпуса для LibraryA.csproj в файле решения вызовет NU1105 при построении LibraryB.csproj:

Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibraryA", "LibraryALibrarya.csproj", "{24DEBB3B-762A-491D-8B83-6D078C0B30C0}"

Я начал эту проблему после обновления до версии 15.5 Visual Studio 2017. Я не сталкивался с этой проблемой с версией 15.4.5.

Ответ 2

Я также получил то же самое после обновления до версии 15.6 Visual Studio 2017.

Закрытие VS и удаление папки .vs исправили его для меня.

Ответ 3

Это сообщение об ошибке также будет появляться, если указанный проект не включен в решение. Я столкнулся с этой проблемой сегодня, и я нашел решение здесь.

Ответ 4

Кажется, что некоторые проекты были удалены из файла решения (не знаю почему). Исправлено путем отмены этих изменений файла решения

Ответ 5

Я столкнулся с этой ошибкой при наличии дублирующейся ссылки на проект.

<ProjectReference Include="..ProjectA.csproj" />
<ProjectReference Include="..ProjectA.csproj" />

Удаление дубликата ссылки решило ошибку.

Ответ 6

То, что работало для меня, было

  1. Удалить оскорбительный проект
  2. Постройте решение
  3. Повторно добавьте проект.

Ответ 7

У меня есть следующая структура проекта (.Net Core проектов):

../classLib
../../../webProject1
../../../webProject2
../../myWebProjects.sln

webProject1 и webProject2 ссылаются на classLib как на сам проект (а не на .dll). Когда я открыл свое решение в VS 2019 и попытался собрать, я получил ту же error NU1105: Unable to find project information for '../classLib.csproj'. ошибка.

Перед сборкой зависимых проектов необходимо восстановить там зависимость. Что я сделал, просто добавьте следующую Target в мои webProject1.csproj и webProject2.csproj.

<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
    <Exec Command="dotnet restore" />
</Target>

Понравилась статья? Поделить с друзьями:
  • Error no matching distribution found for torch
  • Error not supported between instances of nonetype and int
  • Error no matching distribution found for tensorflow
  • Error not support wireless lan in system
  • Error not set start date generation please call перевод