vsts extensions + build-results-enhance - visual-studio-extensions

when trying to upload am getting below error
Error:
(Build Results Enhancer) This extension targets Visual Studio 2017 but was not built with an up-to-date VSSDK. Please make sure to update your references and try uploading again. Note: you'll also need to add Prerequisites to your extension.vsixmanifest.
(Build Results Enhancer) This package has an Installation element that includes an InstallationTarget for Visual Studio 2010 which does not support this version of the VSIX schema.
(Build Results Enhancer) This extension targets Visual Studio 2017 but was not built with an up-to-date VSSDK. Please make sure to update your references and try uploading again. Note: you'll also need to add Prerequisites to your extension.vsixmanifest.
Publisher display name (PadmaPeddigari) in Marketplace and Author name (fabrikam) in the extension need to be the same to publish the extension.

vsts extensions + build-results-enhance
Before you upload your project, you should upgrade your old vsix project.
Step
1) open your project in VS2017 and then install this nuget package Microsoft.VSSDK.BuildTools version 15.9.xxx and Microsoft.VisualStudio.SDK version 15.0.1.
Or if you already have the nuget pakages, you could update it to 15.xxx version.
2) open source.extension.vsixmanifest file and click view code, and then make sure you have Prerequisite xml node and make sure that these related nodes include 15.0.
For an example, set Version of Microsoft.VisualStudio.Component.CoreEditor to [xxx,15.0] or [xxx,16.0).
Besides, more detailed steps, you could refer to this document.
Any feedback will be expected.

Related

New project xamarin.form prism Error NETSDK1004 - Prism 2.2.1

when generating a new project xamarin.form prism I get this error when running. With the previous version 2.1.7 it worked for me OK.
It does not allow me to open the Nuget Package since it also gives an error.
Any recommendation?
I saw the 2 posts of this error but they do not apply to me.
Error NETSDK1004 Assets file 'C:\Empresas\Job_Facu\Job\Job.Prism\Job.Prism\obj\project.assets.json' not found. Run a NuGet package restore to generate this file. Job.Prism C:\Program Files\dotnet\sdk\3.1.202\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets 234
The error tells you what to do. Run a NuGet restore. Visual Studio should help you do this automatically. Note that if this occurred after updating dependencies sometimes Visual Studio gets confused and it's best to close Visual Studio and reopen it. This usually gets it to refresh itself so you get the updated package restore.
If that's not working for you, you can download the latest nuget.exe and from the command line navigate to the solution directory and execute the command {path to nuget.exe} restore.
When NuGet performs a restore it generates the project.assets.json file in the obj folder of each project it has restored. This in turn provides MSBuild with the reference information it needs to properly reference your dependencies like Prism and Xamarin.Forms.
I have recently ran into similar issue as well, seemingly out of the blue. I believe upgrading my build machine to the latest VS version (VS for Mac 8.10.4 (build 11))
NETSDK1004: */project.assets.json' not found. Run a NuGet package restore to generate this file.
To fix, I had to run Nuget Restore twice. Once for the shared project directory and once for the iOS project.
If I run the restore just for the Shared/(main.sln file) project directory I get the error.
If I run the restore for the iOS project the build passes but IPA file isn't created.
Need to run both.
Modules used for CI/CD build in Azure Devops Pipeline

Visual studio 2017 Update 3 - The SDK 'Microsoft.NET.Sdk.Web' specified could not be found

Error:
C:\WebApp\WebApp.csproj : error : The SDK 'Microsoft.NET.Sdk.Web' specified could not be found. C:\WebApp\WebApp.csproj
I am trying to open Dotnet core project and I am getting the above error.
I have installed the latest SDK from https://www.microsoft.com/net/core#windowscmd
I have checked the path for dotnet cmd and it works fine.
Am I missing something? Let me know if you need more information.
The target framework is set to .NET 4.5.2
I stumbled upon this issue a number of times recently. Here's a brief list of the workaround I found (one of them always worked until now):
Install the right .NET Core SDK: Either the latest version or the version required by your project.
Clean-up obsolete .NET Core versions: Go to Control Panel and uninstall previous .NET Core SDK/Runtime versions (as long as you don't use them anymore).
Create a Global.json file: Add a new global.json file to your project's root with the following content (replace the .NET Core version build with the one you want to run the project with):
{
"sdk": {
"version": "2.0.5"
}
}
Rename the SDK reference: Open your .proj file and replace <project sdk="Microsoft.NET.Sdk.web"> with <project sdk="Microsoft.NET.Sdk"> .
Add the MSBuildSDKsPath Environment Variable: 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: Verify that both C:\Program Files\dotnet and C:\Program Files (x86)\dotnet are in the PATH environment variable.
For additional info regarding the issue and other viable fixes check out this blog post that I wrote on this topic.
I agree with the comment on Sundeep's answer, you shouldn't have a global.json file in your project anymore.
It seems as though installing the .NET Core 2.0 SDK is causing issues with the PATH. Verify that C:\Program Files\dotnet and C:\Program Files (x86)\dotnet are in the PATH environment variable. In my case, these values were already present under System Variables so I added them to User Variables and rebooted my machine. This resolved my issue.
As suggested in the comment, I updated global.json file as shown below
{
"sdk": {
"version": "1.0.0"
}
}
Also, I had to remove the <ItemGroup> which contains wwwroot files path in .csproj file.
Reload the project and it works like a charm!
I've encountered the same problem, I just rename <project sdk="Microsoft.NET.Sdk.web"> to <project sdk="Microsoft.NET.Sdk"> on csproj
another situation:
https://stackoverflow.com/a/55529011/2971851
issue details: 2.1.6xx & 2.2.2xx version of the SDKs are only supported
on Visual Studio 2019. VS 2017 needs 2.1.5xx & 2.2.1xx versions of the
SDK.
How to fix the issue? Install 2.1.5xx version of the SDK if you are
targetting a 2.1 app Install 2.2.1xx version of the SDK if you are
targetting a 2.2 app.
and according to the official document:
Note: If you are a Visual Studio user, there are MSBuild version
requirements so use only the .NET Core SDK supported for each Visual
Studio version. If you use other development environments, we
recommend using the latest SDK release.
Do not uninstall previous SDK versions!
When I followed the 2nd step suggested in Darkseal's answer, uninstalling the previous SDK versions, it caused an "expected imports are missing" fatal error every time I opened up my project, so I needed to repair my Visual Studio, since installing the old SDK versions again kept popping up this error...
Also the other steps mentioned in that answer did not make any difference (both dotnet references were present in the environment variables and MSBuildSDKsPath was not needed for me).
Install the proper SDK version and select it in the Solution's Properties
As Jyoten mentioned I was using VS2017 x86 version and my SDKs were x64.
However, this was not the only issue, it seems there's some incompatibility with some SDK versions and VS2017. Having installed SDK v2.2.203 and v2.2.202, they would never showed up in the Target framework dropdown when I double-clicked the Properties on my project's solution (in the Solution Explorer (Ctrl+Alt+L)).
So I needed to install v2.2.105 x86 as mentioned in this answer, for it to show up in that dropdown.
Once it did, the solution that was requiring .NET Core v2.2 worked properly (did the Build normally).
I had this issue when I had to open a .Net Core 1.0.4 project in VS2017.
When I installed 1.0.4 SDK, i chose the x64 version which placed the sdk files in 'c:\Program Files\dotnet' ...
but my VS2017 was 32bit and was therefore looking for the sdk in 'c:\Program Files (x86)\dotnet'.
Once I installed the 32 bit version of the SDK it worked fine.
I was running into an issue where creating a new ASP.NET Core 2.0 project was giving me an error The SDK 'Microsoft.Net.Sdk.Web' specified could not be found, and leaving me unable to open the project in Visual Studio. The problem was the project was created in a folder that contained a global.json file, tying the SDK version to 1.0.0.
Deleting the global.json, or updating it to 2.0.0, fixed the issue. Be sure to check parent folders too - if any parent folder contains a global.json, the SDK version specified in the "closest" folder will be used.
I was getting this error in Visual Studio Code.
I was able to find the issue by setting the OmniSharp log settings in VS Code to debug. Once I did that I could see that it wasn't finding Microsoft.Build.Resources.dll.
I installed MS Build by repairing my VS 2017 Community installation. That fixed it.
uninstall and reinstall microsoft .NET core SDK.
then restart visual studio.
this works for me.
Choose the proper SDK according to your Visual Studio and Operating System. I downloaded the correct version from here https://dotnet.microsoft.com/download/visual-studio-sdks and after that .Net Core appeared in target frameworks list (there is a strict dependence between sdk version and VS version, so be careful).
I have solved this issue by,
go to this site, https://dotnet.microsoft.com/download
In that, install both .NET Core Runtime and .NET Core SDK.
After you install that, Open the Visual Studio 2017 with an administrator, Now The problem has been gone😊
I edited the .csproj file and changed netcoreapp2.2 to netcoreapp2.1 in this stanza & then I was able to get it working.
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>
Install the proper SDK version and go to below links
https://dotnet.microsoft.com/download/dotnet-core/thank-you/sdk-3.1.403-windows-x64-installer
https://dotnet.microsoft.com/download/dotnet-core/thank-you/runtime-desktop-3.1.9-windows-x64-installer
This worked for me:
Make sure that the .NET folder where SDKs are and Visual Studio are
in the same program files (x86) or program files.
Provide the path to the SDK in the environment variable.
If anyone else stumbles upon this issue (including future me), I had the same problem and tried literary every solution proposed here and nothing worked. Finally what fixed the issue for me was deleting NuGetFallbackFolder in C:\Program Files\dotnet\sdk.
After deleting that folder, everything just started to work magically.
I had this error when from old project (in .NET 4.7.2) I was trying to do:
var project = new Microsoft.Build.Evaluation.Project(someDotNet6ProjectPath);
The solution was to upgrade Microsoft.Build packages.

How to restore an ASP.NET Core project with Ubuntu

Recently, I created an asp.net core project using Visual Studio Code on Windows and pushed it to GitHub. When I cloned the repo from GitHub and attempted to do a dotnet restore on the project on Ubuntu, an error message stating there was no project.json file was returned. Can anyone point me to a resource that will show me how to properly restore a .net core project from a Linux machine? Thanks!
So it seems like on each of your machines you are running different versions of the .net core SDK.
A big caveat with what you are trying to do. Are you trying to use Project Rider from Jetbrains on Linux? This only works with project.json (As of the time of this post) so be wary of that.
Now there are two ways to do this. If you are wanting the very latest on Linux and don't care about using Rider, then you can go here : https://github.com/dotnet/core/blob/master/release-notes/download-archive.md and download the latest release for both Linux and Windows, install on both and you should be good to go.
If you do care about using Rider or you aren't ready to be strapped in for the wild ride of the latest release. Then you can do the following.
Find what version of the SDK you have on linux by typing into a terminal the following :
dotnet --version
This will spit out what version you have on linux. Go here and download the same version for windows and install it on your windows machine (https://github.com/dotnet/core/blob/master/release-notes/download-archive.md).
Now BEFORE you create a project, create a solution folder and create a file in it called global.json. Inside that put the following :
"sdk": {
"version": "1.0.0-preview2-003131"
}
Where the SDK version matches what you got from your linux terminal. Now create a folder for your project inside the solution folder. Run "dotnet new -t web" or a similar command to create your project. It will inspect the SDK version of the global.json and create a project with the tooling that matches. You should then be able to shift this project around any machine that has the same SDK installed, even if it also has the latest SDK's also.
If you do not create the global.json, it defaults to the latest version (Atleast on Windows).
Read a bit more about it here : http://dotnetcoretutorials.com/2017/02/17/developing-two-versions-net-core-sdk-side-side/

sqllite3.dll issues with UWP app development for Mobile

I am trying to learn how to develop apps for UWP for both Desktop and Mobile. I have been currently working on getting the Entity Framework working in my app to store application state and followed the following link:
https://learn.microsoft.com/en-us/ef/core/get-started/uwp/getting-started
It worked well for Desktop, the issue however is that when I try to run it on the Windows Mobile emulator I get the following error in debug mode when the code reaches the db.Database.Migrate() step:
Unable to load DLL 'sqlite3': The specified module could not be found
In the link I pasted above, someone else had the same issue and in the comments they recommended to try the following:
Step 1: Install SQLite VSIX pacakge for Universal Windows Platform development using Visual Studio 2015
https://www.sqlite.org/2016/sqlite-uwp-3130000.vsix
Step 2: Install NuGet package SQLite.NET-PCL
Install-Package SQLite.NET-PCL
Step 3: Add references
Add Reference -> Universal Windows ->Extensions -> Make sure the following packages have been checked: "SQLite for Universal Windows Platform" "Visual C++ 2015 Runtime for Universal Windows Platform Apps"
After that, if you get the error "Payload contains two or more files with the same destination path 'sqlite3.dll', do the following:
copy sqlite3.dll from
C:\Program Files (x86)\Microsoft SDKs\UAP\v0.8.0.0\ExtensionSDKs\SQLite.UAP.2015\3.8.11.1\Redist\Debug\ARM\sqlite3.dll
past to (override it)
C:\Users\%USERNAME%\.nuget\packages\SQLitePCL.raw_basic\0.7.1\build\native\sqlite3_dynamic\winrt81\arm\sqlite3.dll
The problem after doing those steps is that I am now seeing the issue when doing a build for "Payload contains two or more files" however not in the SQLitePCL.raw_basic directory (I don't even seem that have that). Instead my error is the following:
Payload contains two or more files with the same destination path 'sqlite3.dll'. Source files:
C:\Users\admin\.nuget\packages\SQLite\3.13.0\runtimes\win7-x86\native\sqlite3.dll
C:\Program Files (x86)\Microsoft SDKs\UAP\v0.8.0.0\ExtensionSDKs\SQLite.UWP.2015\3.13.0\Redist\Debug\x86\sqlite3.dll
I have been searching everywhere and am truly stumped as to how to get my UWP program working on Mobile. Thanks a lot for your help!
It seems like you got the solution for resolving the exception The specified module could not be found from #Leandro_Medeiros_Machado 's comment on this document. If you got the Payload contains two or more files with the same destination path 'sqlite3.dll' exception after you done the above three steps you may be also found the next solution from the comment.
After that, if you get the error "Payload contains two or more files with the same destination path 'sqlite3.dll', do the following:copy sqlite3.dll from
C:\Program Files (x86)\Microsoft SDKs\UAP\v0.8.0.0\ExtensionSDKs\SQLite.UAP.2015\3.8.11.1\Redist\Debug\ARM\sqlite3.dll
past to (override it)
C:\Users\%USERNAME%\.nuget\packages\SQLitePCL.raw_basic\0.7.1\build\native\sqlite3_dynamic\winrt81\arm\sqlite3.dll
For you, you may need to copy from
C:\Program Files (x86)\Microsoft SDKs\UAP\v0.8.0.0\ExtensionSDKs\SQLite.UWP.2015\3.13.0\Redist\Debug\x86\sqlite3.dll to(override) C:\Users\admin\.nuget\packages\SQLite\3.13.0\runtimes\win7-x86\native\sqlite3.dll.
But actually, for using EF core you don't need the above steps and I recommend you check your environment instead of using the above workaround. I created a simple EF project by following the document and without install the VSIX I can run successfully on the emulator (build 10586). My VS build is 2015 update 3, my OS version is build 14393 and the EF core version is Microsoft.EntityFrameworkCore.Sqlite 1.1.0. So please firstly check if your environment met the following requirements:
Windows 10
Visual Studio 2015 Update 3
The latest version of Windows 10 Developer Tools
And if your EF core and EF core tools versions are right.

Error when installing Visual Studio Tools for Apache Cordova CTP3.0 in Visual Studio 2013

I installed Multi-Device Hybrid Apps for Visual Studio 2013 CTP 2.0. I then updated VS2013 to update 4. Now I can't upgrade MDHA to 3.0 because it tells me to uninstall 2.0 first, however the uninstaller doesn't work. When trying to uninstall 2.0 from Programs and Features, it just goes through the setup and then doesn't remove the software from the Add/Remove list.
I tried following this however it doesn't work:
http://support.microsoft.com/kb/3014133
I ended up discovering that the package GUID in the the KB article is wrong. I used this to uninstall the 2.0, then I could install 3.0. The package ID may vary so you may need to search the directory for vs2013mda_0.1.exe and replace the command with your package location.
"%ProgramData%\Package Cache\{38f367f1-1468-4f16-a4c4-29747084003b}\vs2013mda_0.1.exe" /uninstall /passive /force /burn.ignoredependencies={53d408db-eb91-43fb-9d8f-167681c19763};vsupdate_KB2829760
Also,be prepared to wait. This takes a long time.
Thank you TechnoTim, the problem is that, every people has its own package GUID.
To solve the problem, you must lunch the command from the root directory, c:\, changing the package GUID with your package GUID.
In my system:
C:\>"%ProgramData%\Package Cache\{dea88246-f74a-4171-ad6c-d9c978bf2973}\vs2013md
a_0.1.exe" /uninstall /passive /force /burn.ignoredependencies={53d408db-eb91-43
fb-9d8f-167681c19763};vsupdate_KB2829760
To find the right package GUID I go to C:\ProgramData\Package Cache\ and search for
vs2013mda_0.1.exe and save the path in the block note, then change in path in the orignal command and lunch it from the root directory c:\, and its work.
Sorry fom my english.
Goodbye!
"You cannot install Visual Studio Tools for Apache Cordova CTP3.0 in Visual Studio 2013"
To resolve this issue, follow these steps to uninstall Multi-Device Hybrid Apps for Visual Studio CTP 2.0
Open a command prompt as an administrator.
Run the following command: "%ProgramData%\Package Cache{dea88246-f74a-4171-ad6c-d9c978bf2973}\vs2013mda_0.1.exe" /uninstall /passive /force /burn.ignoredependencies={53d408db-eb91-43fb-9d8f-167681c19763};vsupdate_KB2829760
Run vs2013mda_0.3.exe again for Visual Studio Tools for Apache Cordova CTP 3.0.
The above worked when installing update 4, please see: http://support.microsoft.com/kb/3014133
I solved this problem by another way.
I have tried to uninstall from command line, but no one of paths don't exists on my computer.
And I simply created another user with administrator permissions and installed new apache cordova tools from that user.
In my situation it correctly works running by new created user and old user.
Sorry for my horrible English.

Resources