Programing

프로젝트 파일이 불완전합니다.

lottogame 2020. 10. 16. 07:01
반응형

프로젝트 파일이 불완전합니다. 예상 수입이 누락되었습니다.


컴퓨터를 포맷 한 후 Vs 2017 V 15.6.3을 다시 설치하고 Microsoft 2.1.4에서 ASP.Net Core SDK를 설치했습니다.

하지만 새 ASP 핵심 응용 프로그램을 만들 때 VS 오류로 실패했습니다.

"프로젝트 파일이 불완전합니다. 예상 된 가져 오기가 누락되었습니다."

누구든지 도울 수 있습니까?

ASP 핵심 응용 프로그램을 만드는 동안 발생한 오류


해결

  1. 제어판에서 특정 버전을 제거한 후에도 C : \ Program Files \ dotnet \ sdk에 삭제 된 버전이있는 파일과 폴더가 있습니다.

  2. 원치 않는 버전 폴더를 삭제하십시오.

  3. 프로젝트를 다시로드하십시오.

이것은 나를 위해 일했습니다.


나는 같은 문제가 있었다. 제 경우에는 global.json 및 appsettings를 삭제하면 문제가 해결되었습니다.


솔루션 루트 디렉터리에서 찾을 수있는 global.json 파일을 확인하고 대상 SDK 버전이 컴퓨터에 설치되어 있는지 확인하거나 SDK 버전 2.1.4가 설치되어있는 경우 이미 설치되어있는 버전으로 업데이트 할 수 있습니다. global.json은 다음과 같아야합니다.

{
  "sdk":
  {
    "version": "2.1.400"
  }
}   

마지막 Core 설치 복구가 저에게 효과적이었습니다.


또 다른 잠재적 원인은 Visual Studio와 호환되지 않는 .NET Core 버전을 설치 했기 때문입니다 . 이것은 다른 버전 번호와 관련이 있기 때문에 OP의 원래 질문과 관련이 없을 수 있지만 도움을 찾는 동안이 페이지에 왔기 때문에 다른 사람들에게 유용 할 것이라고 생각했습니다.

작성 당시 Visual Studio 2017 (Professional 15.9.11) 과 호환되지 않는 .NET Core 2.2.203설치했습니다 .

.NET 핵심 다운로드 페이지 는 비주얼 스튜디오 2017 현재 지원되는 버전이 사용하려는 경우 목록은 비주얼 스튜디오 2017에 대한 별도의 다운로드이 하나를 다운로드해야합니다 .NET 핵심 2.2.106을 .


제 경우에는 두 가지 버전의 Visual Studio (15.7 및 15.6)가 설치되어 있습니다. .net core 2.1 RC1이 이미 설치되었지만 15.7에는 웹 워크로드가 설치되지 않았습니다. asp.net 워크로드를 VS2017에 설치 한 다음 좋은 측정을 위해 .net 코어 설치를 복구했습니다. 확실히이 프로세스의 무언가가이 경로에서 내 c : \ program files (x86) \ dotnet 및 c "\ program files \ dotnet을 교체했으며 Visual Studio (15.7)는 내 웹 프로젝트를 열지 않습니다.

간단히 System Environment 변수를 편집하고 x86 폴더를 하나 아래로 이동 한 다음 Visual Studio를 다시 열었고 이제 프로젝트를로드했습니다. 시스템 환경 변수


어, 신인 실수, Visual Studio SSDT를 열어서 동일한 오류를 생성하는 기존 .Net Core 프로젝트를 열려고했습니다.

"프로젝트 파일이 불완전합니다. 예상 된 가져 오기가 누락되었습니다."

해결책은 SSDT가 아닌 Visual Studio를 사용하는 것이 었 습니다. 도움말> 정보를 참조하세요.

여기에 이미지 설명 입력


최근 Visual Studio를 닫고 다음 명령을 실행하여이 문제를 몇 번 해결했습니다.

  1. dotnet nuget locals -c all
  2. dotnet 청소
  3. dotnet 빌드

특히 프로젝트 초기에 너겟이 엉망이되는 (기술 용어) 때가있는 것 같습니다.


VS2019를 설치 한 후 VS2017에서 기존 .Net Core 솔루션을 열 때 동일한 오류가 발생하기 시작했습니다.
에서 Visual Studio를 설치 나는 최신 버전 (15.9.11)에 VS2017를 업데이트했는데 문제는 사라졌다.

나중에 VS2019 를 최신 릴리스로 업그레이드 한 후 동일한 오류가 발생하기 시작했고 VS2017을 다시 업그레이드해야했습니다.


이전 .NET Core SDK를 모두 제거하고 게시 시점에 최신 버전 인 2.1.5를 설치했을 때이 오류가 발생하기 시작했습니다. 나는 운없이 여기에서 모든 솔루션을 시도했기 때문에 이것이 문제의 원인이라고 생각했기 때문에 내가 한 모든 cleaup 후 현재 SDK 버전이 무엇인지 확인하기로 결정했으며 옳았습니다. 명령 프롬프트를 시작하고 메시지를 작성 dotnet --version하고 받았습니다. "dotnet SDK 명령을 실행 하시겠습니까? 다음에서 dotnet SDK를 설치하십시오." 이상합니다. SDK가 설치되어 있지만 시스템이 인식하지 못합니다. 그런 다음 환경 변수를 살펴 보았고 PATH 변수에는 일반 프로그램 파일 (x64) 경로 앞에 dotnet 경로에 대한 x86이있었습니다. 그래서 x64를 x86과 짜잔보다 먼저 옮겼습니다. 모든 것이 정상으로 돌아 왔습니다.

누군가를 도왔기를 바랍니다.


나는 같은 문제가 있습니다. 새로 설치된 VS2017에서 새 ASP .Net Core 2를 만들거나 VS2017이 설치된 다른 컴퓨터에서 완벽하게 작동하는 기존 항목을 열 수 없습니다.

Windows에서 모든 .NET Core Runtimes 및 .NET Core Windows Server Hosting을 제거한 후 작동하기 시작했습니다. SDK 만 남았고 모든 것이 마침내 작동합니다.여기에 이미지 설명 입력

아마도 Windows에서 .NET Core Runtimes 또는 .NET Core Windows Server Hosting 만 제거해야했으며 충분할 것입니다.


손상된 dotnet core SDK에서 동일한 증상이 발생했습니다 (명령 줄에서 이전에 가능했던 dotnet -v를 실행할 수 없음). 실패한 IIS 웹 플랫폼 설치 실패 후 프로젝트를로드하지 못했습니다. .NET core SDK를 다시 설치하면 문제가 해결되었습니다.


나를 위해 일한 유일한 것은 Visual Studio를 업그레이드하는 것입니다.

여기에 이미지 설명 입력

여기에 이미지 설명 입력


제 경우에는 C : \ Program Files \ dotnet \ sdk 폴더로 이동하여 미리보기 sdk 폴더를 삭제 한 다음 명령 줄에서 다음을 실행합니다.

dotnet sdk 2.1.200

asp.net 코어에 대한 올바른 sdk 버전을 설정합니다. 이것은 문제를 해결했습니다.


나는 같은 문제가 있었다. 그것을 알아 내기 위해 잠시 조용히했습니다. 제 경우에는 새 ASP .NET Core 애플리케이션을 열려고했는데이 게시물에있는 것과 같은 0 개의 프로젝트가 반환되었습니다.

내가 시도한 것 : 제어판 \ 시스템 및 보안 \ 시스템에서 환경 변수를 변경해 보았습니다 (고급 설정 클릭).

여기에 이미지 설명 입력

그런 다음 환경 변수를 클릭하십시오.

여기에 이미지 설명 입력

그런 다음 프로그램 파일 또는 프로그램 파일 (x86) 아래에 dotnet 경로가 포함되어 있는지 확인합니다. 여기에 이미지 설명 입력

일부 사람들은 Microsoft 설명서를 기반으로 (x86) 위로 이동하도록 제안했습니다.

What fixed my issue: Turns out I had the wrong version installed and it was not compatible with Visual Studio 2017 여기에 이미지 설명 입력

Then I removed the other installations and reinstalled the right version that is compatible with VS17 and works like a magic. Hope it helps someone in the future.


Thanks guys, i had reinstall older version of visual studio 2017 and it works well. My VS version is 15.4 and it's fine


This happened to me when I uninstalled a VS2015 instance of Visual Studio I had running side by side with VS2017.

I had to go out and reinstall the .Net Core sdk/runtime with the x86 version. I had already manually done the x64 versions of these but didn't think about visual studio running in 32bit.

These are the files:

  • dotnet-sdk-x.x.x-win-x86.exe

  • DotNetCore.x.x.x-WindowsHosting.exe


I was facing the same issue. I was running my project on .Net core 2.2. I tried every single solution given here but nothing worked. I repaired my visual studio and it's working fine now.


I solved this problem by modifying the first line in the .csproj file from:

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

to:

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

I had the same problem with an ASP.net Core 2.0 project after I've installed the DotNetCore.2.0.5-WindowsHosting Framework on my development machine. I could solve this problem after I've deinstalled the WindowsHosting Framework and all .net Core packages. After this I've reinstalled the dotnet-sdk-2.1.200-win-x64 package and everything worked fine.


Deleting the bin and obj folders for the project fixed this for me.


Same issue...took me a while to figure out. Since I was working on an ASP.NET Core project that targeted .NET Core 1.1, I thought I still needed the .NET Core 1.1 SDK installed. Since I had .NET Core SDK 2.1 installed too there was some sort of conflict and I couldn't open the project file. After uninstalling .NET Core 1.1 I was then able to open my project.


Run dotnet restore on command line for the solution.

Tip. If you've uninstalled the latest .net core version let's say 2.1.403 and installed the previous one, ensure the 2.1.403 folder has been actually removed at the path

C:\Program Files\dotnet\sdk\

I had the issue due to there left an empty folder with 2.1.403


Delete all build generated bin and obj folders. This worked for me after renaming project and trying to reload solution. Not really sure about the real cause of incompatible loading.


I get the same issue, and I run Visual with Administrator privilege again. This helps me to open project nomarlly.


Turns out my project was dependent on another project in the solution, which had failed NuGet dependency issues, which in turn was because the Target Framework in the project properties was blank.

I opened the .csproj file to check the target framework, downloaded the target framework and chose "repair", then restarted Visual Studio and all good again!


Installing the dot net core latest version worked for me.


I just had the same issue while installing the new preview version of VS 2019. I fixed it by uninstalling the latest update which in turn uninstalled the most recent downloaded version of core. Which I belive caused the missmatch.


Just need to cross check your project creation .net core library version with updated one.When you update core library it won't get updated into .csproj, either you need to update it manually or need to remove latest/updated core sdk file.

To check .net core version --fire command on cmd :- dotnet --version

Then check with installed library in Program and Features --Removing of latest library resolve the problem without change of single line


Visual Studio 2017을 15.9.11로 업데이트하는 문제가 해결되었습니다 (실패한 버전을 기억할 수 없습니다). Visual Studio 복구도 효과가 있었을 것입니다. .NET Core 설치를 복구하고 빌드 아티팩트 및 임시 파일을 정리해도 문제가 해결되지 않았습니다.

참고 URL : https://stackoverflow.com/questions/49432666/project-file-is-incomplete-expected-imports-are-missing

반응형