Ошибка net sdk

  • #1

При открытии архива записей DVR1604HE-L через SmartPSS (установлен на пк с win10x64) показывает временные отрезки на которых имеется запись, но при попытке запустить воспроизведение любого из фрагментов выдает: Ошибка воспроизведения. Ошибка NETSDK (Failed to start playback. NETSDK returns error — в англ версии). При этом просмотр онлайн видео происходит нормально, проблема только при обращении к архивам.
ПК связывается с регистратором по локальной сети 100мбит, проблема с сетью думаю, что исключена.

версия установленного на ПК SmartPSS — DH_SmartPSS_International_Win32_IS_V2_02_1_R_180619
на регистраторе прошивка стоит 2.606.0018.0
Дата сборки 2010-04-02
Web 2.1.7.21

Возможно стоит обновить прошивку девайса или понизить версию софта на ПК? smartPSS версии 1.0 рекомендованую пользователю с аналогичной проблемой я не нашёл в открытом доступе, прошивку на регистраторе более новую — тоже.

  • smartpss_error1.jpg

    27,3 КБ
    Просмотры: 13

  • 20200901_155220.jpg

    85,9 КБ
    Просмотры: 16

Техпідтримка VidiMost.com


  • #3

Старая воспроизводит, спасибо большое!

  • #4

У меня есть клиенты с такими древними DVR-ами, что держу в запасе PSS 4.06 (кто помнит ?). Ну и smartPSS 1.13, 1.16

  • #5

очень древняя программа для тех, кто обнаружил финиш календаря в PSS

  • #6

Smart PSS 2.02.1 при просмотре архива дает «Ошибка воспроизведения Ошибка NETSDK».
Версии 1.12, 1.13, 1.14, 1.16 архив воспроизводят, но при попытке записать в любом формате в любую папку дают «ошибка» или «failed».
Версия ПО регистратора 2.606.0018.0 build 2011-04-26
Windows 7×32 max.
Что еще можно попробовать?

  • #7

См.выше мою вчерашнюю ссылку на дропбоксе.

Техпідтримка VidiMost.com


  • #8

2.606.0018.0 build 2011-04-26

как-то уж ну очень старая. А что за модель?

  • #9

Здравствуйте.
У клиента 30 старых региков, все включены в внутреннюю сеть. И у всех такая же проблема
Ошибка NETSDK.
Старые версии программ тоже не работают. В pss календарь не полностью открывает, не показывает календарь с декабря. Клиент нервничает, менять регики не хочет.. Какие будут советы?

  • #11

Spymax, 16 BNC-портов, S/N PA1HF07701528, Версия ПО регистратора 2.606.0018.0 build 2011-04-26
Шильдика с номером модели с внешних сторон или снизу нет, в настройках регистратора тоже нигде не нашел.
Посмотреть, напишет ли номер модели при включении нет возможности (перезагрузка только в исключительном случае).
CMS DAHUA-HIKVISION-TVT установил, пока не могу настроить тип устройства/номер порта, чтобы увидеть изображение.

  • #12

Модель порты можно посмотреть через веб-интерфейс. Т.к. Spymax это скорее всего Dahua, то порт 37777. Тип — DVR.

  • #13

Модель в веб-интерфейсе также не нашел. Из того, что есть о системе:
Webrec control v.2.1.7.31, NETSDK v.3.3.7.4595, PLAYSDK v.3.31.0.4538, copyright 2008.
Но из веб-интерфейса получилось нужные записи на комп перекинуть, так что пока не найду подходящей проги буду запрашиваемые записи через него доставать.
У охранников онлайн-просмотр через rvi_pss 4.06.6 пока нормально работает.
В программе CMS DAHUA-HIKVISION-TVT устройство определилось (тип устройства dahua_DVR/номер порта 37777), растет лог срабатывания датчиков движения, но не могу настроить онлайн-просмотр и вытащить запись из архива.

  • #14

Решил проблему, делюсь.
Скачал отсюда: https://www.sferann.ru/shop/besplatnyi-soft программу SPYMAX VMS. Пока все работает.
Конвертер H.264 в AVI с этого же сайта при обработке файла архива *.h264 вылетает по ошибке, пара других конвертеров (типа movavi видеоконвертер) тоже отказались.
Файлы архивов с расширением .h264 получилось преобразовать в .avi программкой Dahua AVI Convert (dhavi.exe, установки не требует, работает очень шустро).

  • #15

нашёл закономерность.
регистраторы только с цифрой 1 имеют описанные проблемы .
PA1LQххххххххх
PA1MFххххххххх
PA1Mхххххххххх
PA1LQххххххххх
Запрос в сервис результатов не дал .Они не опознали серийные номера, это было 7-9 лет назад. хотел прошивку поменять.

  • #16

Модель порты можно посмотреть через веб-интерфейс. Т.к. Spymax это скорее всего Dahua, то порт 37777. Тип — DVR.

я смог увидеть серийник и версию п.о. и всё..

Техпідтримка VidiMost.com


  • #17

Укажите PN с наклейки на дне

  • #18

Укажите PN с наклейки на дне

нет возможности. Могу только удаленно зацепится.

Техпідтримка VidiMost.com


  • #19

без PN, я не подберу прошивку.

  • #20

Здравствуйте. Проблема 1 декабря. Дальше архива нет. Онлайн просмотр работает. Не можем посмотреть видео в архиве ни в smart pss, ни в operator 4.05 и 4.06

I’m trying to build a solution using msbuild command line and I keep getting this error:

error MSB4236: The SDK 'Microsoft.NET.Sdk' specified could not be found.

The version of msbuild is the latest from microsoft visual studio 2017 tools. I’m using Windows Server 2012 R2 and the project uses .NET Core 2.0.

This is the command that I’m using:

msbuild.exe /p:Configuration=Release /t:restore C:ProjectsMyProject.sln

Complete log:

    Microsoft (R) Build Engine version 15.3.409.57025 for .NET Framework
    Copyright (C) Microsoft Corporation. All rights reserved.

    Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
    Build started 9/16/2017 3:09:03 PM.
    Project "C:ProjectsMyProject.sln" on node 1 (restore target(s)).
    ValidateSolutionConfiguration:
      Building solution configuration "Release|Any CPU".
    Project "C:ProjectsMyProject.sln" (1) is building "C:ProjectsKernelKernel.csproj" (2) on node 1 (restore target(s)).
    C:ProjectsMyProject.sln" (1) is building "C:ProjectsKernelKernel.csproj : error MSB4236: The SDK 'Microsoft.NET.Sdk' specified could not be found.
    Done Building Project "C:ProjectsMyProject.sln" (1) is building "C:ProjectsKernelKernel.csproj" (restore target(s)) -- FAILED.

    Build FAILED.
    "C:ProjectsMyProject.sln" (restore target) (1) ->
"C:ProjectsKernelKernel.csproj" (restore target) (2) ->
  C:ProjectsKernelKernel.csproj : error MSB4236: The SDK 'Microsoft.NET.Sdk' specified could not be found.

0 Warning(s)
    11 Error(s)

asked Sep 16, 2017 at 18:54

Luiz Gustavo Maia's user avatar

6

I encountered this error after playing around with .Net Core 2.0 installation and seemingly messing it up. I would get this same error for dotnet restore, dotnet build or dotnet msbuild. Essentially, anything involving .Net Core and msbuild.

The error occurred because the MSBuildSDKsPath environment variable was still pointing to the old .Net Core 1.1 SDK.

To fix the problem, I manually set the MSBuildSDKsPath environment variable to point to 2.0.0’s SDK path, which, for me with x64, this was at: C:Program Filesdotnetsdk2.0.0Sdks.

Basically, if you have Sdk="Microsoft.NET.Sdk" in your .csproj, then a folder with the same name should exist at your MSBuildSDKsPath location.

answered Sep 21, 2017 at 8:32

Sebastian Nemeth's user avatar

Sebastian NemethSebastian Nemeth

5,3754 gold badges25 silver badges36 bronze badges

7

You were probably missing some components when you installed the VS tools

  1. Download and run Build Tools for Visual Studio 2019. (On the VS download page, go to Tools for Visual Studio 2019 and then click download Build Tools for Visual Studio 2019)

  2. Select Modify on Visual Studio Build Tools 2019 or your instance.
    enter image description here

  3. Select tab Individual components and check .NET Core SDK component
    enter image description here

answered Nov 4, 2020 at 12:07

Yasel's user avatar

YaselYasel

2,8904 gold badges40 silver badges48 bronze badges

5

for me the solution was to set the sdk version in the global.json file:
solution items global.json

and specify the correct version which exists in the C:Program Filesdotnetsdk folder. The VS installer uninstalled the previous version of .NET Core 3.0.100 and installed new one 3.1.100 so I had to change it from:

{  "sdk": {    "version": "3.0.100"  }}

to

{  "sdk": {    "version": "3.1.100"  }}

answered Dec 5, 2019 at 10:44

pawellipowczan's user avatar

2

For me updating Visual Studio Build Tools resulted in the ‘SDK not found’ error.

The solution: run Visual Studio Installer, modify the Visual Studio (Build Tools) installation, and make sure the following workload is selected:

check ".NET build tools"

answered Sep 9, 2021 at 10:49

HyperQuantum's user avatar

HyperQuantumHyperQuantum

1,4621 gold badge10 silver badges12 bronze badges

1

I got this issue in Mac OS and while using docker container and Azure this occurs because docker bash overrides MSBuildSDKsPath so don’t
change any code just quit and restart your IDE (visual studio Mac) and run it again

answered May 25, 2020 at 16:03

Nelcon Croos's user avatar

2

I started getting this error after installing Visual Studio 2022 in Windows 10, when I opened up my solution. The solution contains a mix of .NET Framework 4.8 and .NET Standard 2.0 projects, and the error was on the .NET Standard 2.0 projects. I had previously Visual Studio 2019 and 2019 Build Tools installed.

The problem was that I had both x86 and x64 of dotnet installed, and both was in my systems PATH environment variable:

C:Program Files (x86)dotnet
C:Program Filesdotnet

I did the following steps to fix this error:

  • Uninstalled VS2019
  • Uninstalled VS2019 Build Tools
  • Removed the x86 path from the environment variable
  • Removed the folder «C:Program Files (x86)dotnet» from my computer
  • Restarted VS2022

I think that the important part was to remove x86 from the environment variable. The other steps was just to «clean up».

answered Nov 10, 2021 at 8:49

Marfyy's user avatar

I got the same issue when I tried to install x64 .Net Core SDK installer. Even the following dotnet --info command shows me that no SDK is found.

So, try to install x86 .Net Core SDK installer. That can help you.

Tim's user avatar

Tim

5,3457 gold badges41 silver badges62 bronze badges

answered Mar 25, 2019 at 8:53

Vadzim Papko's user avatar

I had the same problem and found solution here:
https://github.com/aspnet/AspNetCore/issues/3624

Solution is to just have x64 or x86 version of sdk/runtime/hosting.
If you have both and if you use for example x86 version of dotnet.exe it won’t see x64 versions of SDK installed.

Problem usually occures when you install hosting bundle because it includes both x86 and x64. Just uninstall one you don’t use.

answered Sep 27, 2019 at 11:48

hex's user avatar

hexhex

7131 gold badge11 silver badges17 bronze badges

To anyone that, like me, run into this issue on Linux and found this thread:

This problem occurs, because your .bashrc config overrides MSBuildSDKsPath environment variable with outdated value (most likely it’s a leftover after dotnet package update). To solve this:

  1. Edit ~/.bashrc
  2. Remove the line with MSBuildSDKsPath variable initialization, e.g.

export MSBuildSDKsPath=»/opt/dotnet/sdk/2.2.108/Sdks/»

answered Feb 6, 2020 at 12:54

rufus1530's user avatar

rufus1530rufus1530

7654 silver badges19 bronze badges

If you have previously worked with C# and it somehow stopped working:


For me updating to the latest version (probably of the build tools) with the «Visual Studio Installer» solved the problem.

answered Dec 24, 2020 at 9:50

codewing's user avatar

codewingcodewing

6648 silver badges25 bronze badges

1

The issue was occuring for me only when I tried to build the project with
dotnet build using VS2022 .
MsBuild on the same project was working fine.

What I did was:

  • restore the .net core runtime sdk — I was using 3.1 at the time. enter image description here

  • Add both sdk paths in both Path vars, for the user and system, in that order:
    enter image description here

  • Delete the MSBuildSDKsPath

P.s. I had this error while trying to run the coverlet coverage analysis

answered Apr 28, 2022 at 8:04

tanuk's user avatar

tanuktanuk

4889 silver badges10 bronze badges

I resolve the issue by installing the package directly form the Package Manager Console:

Install-Package NETStandard.Library -Version 2.0.3

answered Jun 18, 2021 at 14:18

yannick triqueneaux's user avatar

Maybe you encountered the error after installing .NET core SDK 3.0. You have to check the environment variable MSBuildSDKsPath after every install of a new SDK. It must target the SDK you use to create your project. I use VS2017 with Windows 10.

For 2.2 SDK:

C:Program Filesdotnetsdk2.2.104Sdks

For 3.0 preview :

C:Program Filesdotnetsdk3.0.100-preview3-010431Sdks 

Tim's user avatar

Tim

5,3457 gold badges41 silver badges62 bronze badges

answered Mar 10, 2019 at 20:33

MNF's user avatar

MNFMNF

6779 silver badges13 bronze badges

Had the same issue after I updated (snip) all VS installations on my windows machine a while ago. A restart of my PC resolved the issue.

answered Jun 15, 2022 at 16:44

Namujiji's user avatar

1

I had this same issue, and it turned out the resolution for me was none of the above for me.
I was running the VS preview version with an older version of VS. I removed the Preview VS and then had to remove each of the environment variables by hand (i.e ANDRIOD_HOME, and .Net Maui vars, etc) and was back in business. Hope this helps someone out there who has installed VS Preview only to break the dev build environment.

answered Jul 15, 2022 at 21:30

dePhantom's user avatar

answered Sep 16, 2022 at 13:25

FrqSalah's user avatar

FrqSalahFrqSalah

4723 silver badges9 bronze badges

I ran into this issue after installing .NET 7 to work with gRPC. After uninstalling .NET 7 the IDE was still looking for it. I deleted the empty C:Program Filesdotnetsdk7 folder. I closed an opened the project it found the lastest .NET 6 installation.

answered Jan 10 at 15:03

Elim Garak's user avatar

Elim GarakElim Garak

1,7081 gold badge15 silver badges21 bronze badges

I tried almost all in this thread without success. I was able to fix the issue by changing the PATH environment variable. I had «C:Program Files (x86)dotnet» and after «C:Program Filesdotnet». The solution was to put «C:Program Files (x86)dotnet» after «C:Program Filesdotnet». Solved!

answered Mar 3 at 19:09

Cristiano Gimenes's user avatar

1

title description ms.topic ms.date f1_keywords

NETSDK1045: The current .NET SDK does not support ‘newer version’ as a target.

Learn about .NET SDK error NETSDK1045, which occurs when the build tools can’t find the requested version of the .NET SDK.

error-reference

02/12/2021

NETSDK1045

NETSDK1045: The current .NET SDK does not support ‘newer version’ as a target.

This article applies to: ✔️ .NET Core 2.1.100 SDK and later versions

This error occurs when the build tools can’t find the version of the .NET SDK that’s needed to build a project. This is typically due to a .NET SDK installation or configuration issue. The full error message is similar to the following example:

NETSDK1045: The current .NET SDK does not support ‘newer version’ as a target. Either target ‘older version’ or lower, or use a .NET SDK version that supports ‘newer version’.

The following sections describe some of the possible reasons for this error. Check each one and see which one applies to you. Keep in mind that when making changes to the environment or the configuration files, you might have to restart command windows, restart Visual Studio, or reboot your machine, for your changes to take effect.

.NET SDK version

Open the project file (.csproj, .vbproj, or .fsproj) and check the target framework. This is the version of the framework that your app is trying to use.

<TargetFramework>netcoreapp3.0</TargetFramework>

Make sure that the version of .NET listed is installed on the machine. You can list the installed versions by using the following command (open a Developer Command Prompt and run this command):

x86 or x64 architecture

Each version of the .NET SDK is available in both x86 and x64 architecture. The project might be trying to find the .NET SDK for the wrong architecture, or the .NET SDK for the architecture your project needs might not be installed. Check the installation folders for the architecture you need. For example, on Windows, the x86 version of the .NET SDK is installed in C:Program Files (x86)dotnet and the x64 version is installed in C:Program Filesdotnet. See How to check that .NET is already installed and choose your operating system to find out how to detect what’s installed on your machine.

If the version you need isn’t installed, find the one you need at the .NET Downloads page.

Preview not enabled

If you have a preview installed of the requested .NET SDK version, you also need to set the option to enable previews in Visual Studio. Go to Tools > Options > Environment > Preview Features, and make sure that Use previews of the .NET Core SDK is checked.

Visual Studio version

For example, .NET Core 3.0 and later require Visual Studio 2019. Upgrade to Visual Studio 2019 version 16.3 or later to build your project.

Visual Studio for Mac

VS for Mac supports both dotnet msbuild and MSBuild on Mono. But the .NET SDK version is downgraded when MSBuild on Mono is used, and this can result in the NETSDK1045 error.

Open the Solution Properties window (ctrl-click the solution in the Solution window and select Properties), select Build — General, and uncheck Build with MSBuild on Mono. This Build with MSBuild on Mono option will be checked if there are any classic projects in the solution, and this can cause problems since Mono does not support the later .NET SDKs.

For more information about which Visual Studio for Mac 2022 versions support which .NET versions, see Supported versions of .NET.

PATH environment variable

The build tools use the PATH environment variable to find the right version of the .NET build tools. If the PATH environment variable contains direct paths to older build tools, this error message could appear. Make sure the only path to the .NET tools in the PATH environment variable is to the top-level dotnet folder, for example, C:Program Filesdotnet. An example of an incorrect PATH would be something like C:Program Filesdotnet2.1.0sdks.

MSBuildSDKPath environment variable

Check the MSBuildSDKPath environment variable. This optional environment variable is recognized by MSBuild and if set, overrides the default value. It might be set to a specific older version of the .NET SDK. If it’s set, try deleting it and rebuilding your project.

global.json file

Check for a global.json file in the root folder in your project and up the directory chain to the root of the volume, since it can be anywhere in the folder structure. If it contains an SDK version, delete the sdk node and all its children, or update it to the desired newer .NET Core version.

{
  "sdk": {
    "version": "2.1.0"
  }
}

The global.json file is not required, so if it doesn’t contain anything other than the sdk node, you can delete the whole file.

Directory.build.props file

The Directory.build.props file is an optional MSBuild file that can set global properties. Check for these files in the solution folder and up the directory chain to the root of the volume, since they can be anywhere in the folder structure. Look for TargetFramework elements, or settings of MSBuildSDKPath that could override your desired settings.

See also

  • .NET Downloads
  • The Current .NET SDK does not support targeting .NET Core 3.0 – Fix

I just upgraded my visual studio 2019 to latest version 16.8.3 and suddenly I am not able to load any C# project and getting the following error for all .NET core projects:

The project file cannot be opened. Unable to locate the .NET SDK.
Check that it is installed and that the version specified in
global.json (if any) matches the installed version.

mj1313's user avatar

mj1313

7,8502 gold badges10 silver badges32 bronze badges

asked Dec 9, 2020 at 1:53

Dadwals's user avatar

1

Try to edit envrionment Variables.

Right click on This PC -> Properties -> Advanced System Settings -> Advanced -> Environment Variables -> System Variables

Add [install path] C:Program Filesdotnet to the variable path.

Restart visual studio.

If it does not solve this problem, you can refer to this answer.

answered Dec 9, 2020 at 6:04

Karney.'s user avatar

Karney.Karney.

4,7382 gold badges7 silver badges11 bronze badges

8

I found that the path C:Program Filesdotnet was already in my path but it was ordered below the C:Program Files (x86)dotnet entry. By simply moving C:Program Filesdotnet above C:Program Files (x86)dotnet in the list and restarting Visual Studio cleared up the problem.

Alex Logvin's user avatar

answered Jan 27, 2021 at 18:50

stidhat's user avatar

stidhatstidhat

1,0416 silver badges5 bronze badges

4

If there is a global.json file in your solution folder(where *.sln file reside), delete this.

answered May 16, 2021 at 20:44

Ahmet Arslan's user avatar

Ahmet ArslanAhmet Arslan

5,2402 gold badges33 silver badges35 bronze badges

0

In my case, I had .NET 6 preview but then uninstalled it. After uninstalling, some of my projects won’t load. I have all the configurations mentioned above but still won’t load the projects. I went to C:Program Filesdotnetsdk where I found that there still exist a .NET 6 folder which is empty. Deleting that empty .NET 6 folder fixes the issue and I was able to load my projects.

answered Oct 4, 2021 at 22:10

Lance's user avatar

LanceLance

2,6924 gold badges37 silver badges57 bronze badges

2

This works for me…
Check first if which .net Core SDK is available in the system.

Step 1: Open Command prompt (CMD) and type dotnet —info

enter image description here

The above image shows no SDK is installed or register

Step 2: Install SDK from https://dotnet.microsoft.com/download/dotnet-core

Done Visual studio works like charm… Verify if its properly installed and register

enter image description here

Above image you can see .net core SDK is registered properly on the system.

answered Feb 10, 2021 at 5:37

Krunal Solanki's user avatar

0

I had a similar situation upgrading from VS 2019 to VS 2022, trying to run a dotnet 5.0 solution from VS 2022 (that starts to use dotnet 6.0).

In the PATH env. variable I had both ‘C:Program Filesdotnet’ and ‘C:Program Files (x86)dotnet’. I removed the (x86) one and stopped having that error

answered Nov 9, 2021 at 18:36

brunochaina's user avatar

brunochainabrunochaina

6797 silver badges7 bronze badges

Installing missed SDK that the project has built solved the problem

I had a similar issue when I tried to build a net5.0 solution that is not installed on my machine.

In my case, I had VS 2022, and net6.0 installed.

Installing net5.0 SDK solved the problem.

I had only C:Program Filesdotnet in Path env

answered Jun 17, 2022 at 17:17

Maruf's user avatar

MarufMaruf

3343 silver badges8 bronze badges

I just carefully followed the error message and tried to resolve the problem.

I got below error message:

F:mypathServerlessFuncServerlessFuncServerlessFunc.csproj : error
: The project file cannot be opened. C:Program
Filesdotnetsdk6.0.402SdksMicrosoft.NET.SdkSdk not found. Check
that a recent enough .NET SDK is installed and/or increase the version
specified in global.json.

I then tried to navigate through

C:Program Filesdotnetsdk6.0.402SdksMicrosoft.NET.SdkSdk

path which was mentioned in the above error and found that the above path does not exist. This problem could be resolved if I install SDK of version of 6.0. Rather I started using VS-2022.

answered Nov 12, 2022 at 4:05

Ashok kumar's user avatar

Ashok kumarAshok kumar

1,5834 gold badges32 silver badges68 bronze badges

Dealing with .NET Core projects in Visual Studio can be tricky, expecially if you’ve installed multiple versions of the SDK and Runtime in your development environment. Among the many issues you can stumble upon, there are the following ones:

«Microsoft.NET.Sdk.Web» is missing

or

«Microsoft.NET.Sdk.Web» specified could not be found

The above error messages will most likely be shown within a pop-up error message that will appear as soon as you try to load/reload a .NET Core project contained in a Visual Studio 2017 solution:

.NET Core - How to fix the "Microsoft.NET.Sdk.Web could not be found" error in Visual Studio 2017

There are a number of causes that could cause this, the most common ones being the following:

  • You copied, download or GIT-cloned a project from one computer to another.
  • You opened a .NET Core solution file created with a previous version/build of Visual Studio or before updating your local Visual Studio installation.
  • You installed a newer version of the .NET Core Runtime and/or SDK (or uninstalled a previous one).
  • You messed up with your PATH environment variable(s)

… And so on.

Luckily enough, there are a number of things that can be done to fix that problem for good: let’s see what can we do.

Install the right .NET Core SDK

The first thing to do is to be sure that the right .NET Core SDK and/or Runtime are installed on your system: the most recent builds and versions can be found on the official .NET Core downloads page.

Notice that the .NET Core Runtime alone is only needed if you want to be able to run the executable only: if you require to actively build the production using VS2017 you will need to get the SDK, which does also include the Runtime. Also, if you’re looking to run a specific project developed and built with a specific version of the SDK/Runtime, be sure to get and install it: conversely, if you’re doing that for your own solutions, getting the latest version is highly recommended — you will patch your local project files accordingly.

As soon as you’ve installed the required (or latest) .NET Core SDK and/or Runtime, try to launch your solution file again and see if the issue is gone before proceeding.

Clean-up obsolete .NET Core versions

Having multiple .NET Core Runtimes, SDK and Tooling sets installed might prevent Visual Studio from working properly for a number of reasons: wrong paths, outdated references/project/solution files, and so on. To prevent these kind of issues, you should always be sure to uninstall the .NET Core versions/builds which you don’t require anymore from your development machine.

The best way to do that is to use the good old Control Panel > Programs and Features panel (or Uninstall a Program if your Control Panel is in the category view). If you’re a .NET Core developer from day-one there’s a good chance that it will require some time, as there will be a considerable amount of entries you’ll want to get rid of:

.NET Core - How to fix the "Microsoft.NET.Sdk.Web could not be found" error in Visual Studio 2017

It’s worth noting that you should only uninstall the SDK and Runtime versions/builds you’re sure you don’t need anymore. If you’re a .NET Core developer, there’s a good chance that you might want to keep multiple SDK on your machine to be able to run/compile different projects/solutions… Just be sure to get rid of anything that you’re sure you don’t need anymore, as that will greatly help Visual Studio — and your environment’s .NET Core versioning system in general.

IMPORTANT: While looking at the installed versions/builds, it’s worth checking that you don’t have a runtime conflict between the 32-bit Runtime and the 64-bit SDK or vice-versa: if that’s the case, try to uninstall one of them as explained above, or install the same SDK version for 32-bit and 64-bit.

As soon as you’ve uninstalled everything you need to, check again your solution file again: if the original issue is still there, hop on to the next step(s).

Create a Global.json file

The global.json file has been introduced in may 2017 to allow selection of the .NET Core tools version being used through the
sdk property.

The .NET Core CLI tools look for this file in the current working directory (which isn’t necessarily the same as the project directory) or one of its parent directories. This basically means that, when you run dotnet new or dotnet build, the dotnet host will look in the current folder — and all parent folders up to the drive’s root — for a global.json file and act accordingly:

  • If a global.json file is found (and the SDK version it references is installed), then that version will be used for all SDK commands.
  • If it can’t find one, it will just use the newest version of the SDK installed on the machine.

It’s worth noting that, back in the day, the global.json file was also used to define the source code folders for a solution, but that functionality was removed with the 1.0.0 SDK. The current file has now a very simple schema, that simply defines which version of the SDK to use:

{

  «sdk»: {

    «version»: «2.0.5»

  }

}

For further info regarding the global.json file, read the official MS docs.

Rename the SDK reference

According to this StackOverflow answer, renaming the Microsoft.NET.Sdk.web reference to Microsoft.NET.Sdk within the project file might fix the issue, at least in some scenarios. To do that, open your .proj file and replace
<project sdk=«Microsoft.NET.Sdk.web»>  with
<project sdk=«Microsoft.NET.Sdk»> .

Add the MSBuildSDKsPath Environment Variable

If all the above methods don’t work, you can try with setting the MSBuildSDKsPath Environment Variable pointing to the required (or latest) .NET Core SDK. In order to do that, open the Windows Control Panel, then select System and go to the Advanced settings in the following way:

.NET Core - How to fix the "Microsoft.NET.Sdk.Web could not be found" error in Visual Studio 2017

As a matter of fact, the dotnet CLI sets the MSBuildSDKsPath environment variable when invoking MSBuild: however, a December 2016 patch changed the CLI behaviour so that it will respect an existing environment variable, if it has already been set: this will allow the developer to «force» the CLI to use a specific SDK.

Check your PATH

It seems that sometimes installing the .NET Core 2.0 SDK will cause issues with the PATH environment variable: verify that both 
C:Program Filesdotnet  and
C:Program Files (x86)dotnet  are in the PATH environment variable.

Понравилась статья? Поделить с друзьями:
  • Ошибка no direct3d support
  • Ошибка no data for testing
  • Ошибка no compatible graphics device found
  • Ошибка no bus крайслер
  • Ошибка no bootable device на ноутбуке lenovo