dotnet restore cmd failing - error MSB4019 - \DotNet\Microsoft.DotNet.Props file missing #5175 - yeoman

So I've done some searching most articles suggest installing the Vs2015 tooling. Which I have installed. But I am still getting this error when I try to restore a project from Yeomans. The 'Microsoft.DotNet.Props' file definitely does not exist on my machine. Im running Windows 7 x64 with Vs2015update3 and Vs2015 tools preview 2.0.3. What am I doing wrong?
Not sure if this helps but here is my dotnet --info
Product Information:
Version: 1.0.0-preview4-004233
Commit SHA-1 hash: 8cec61c
Runtime Environment:
OS Name: Windows
OS Version: 6.1.7601
OS Platform: Windows
RID: win7-x64
Base Path: C:\Program Files\dotnet\sdk\1.0.0-preview4-004233

I was able to work through this issue. The original Yeomans template I was using was generated with a different version to dotnet so I had to manually force this switch using the global.json file with Solution file and the Visual Studio IDE was able to update the build. Then I could switch back and get the builds to run. This may not be the only way but this did work for me in this case. Here is more details on the issue.
https://forums.asp.net/t/2113044.aspx?dotnet+restore+failing+error+MSB4019+1+0+0+preview4+004233+Microsoft+VisualStudio+v14+0+DotNet+Microsoft+DotNet+Props+was+not+found+

Related

.NET Core - Docker build can't find SDK version in global.json

I have a .NET (Core) 5.0 solution with a global.json because I want to keep a specific SDK version:
{
"sdk": {
"version": "5.0.302"
}
}
5.0.302 is installed on my machine, and the solution opens in Visual Studio (for Mac) and builds just fine, but when I try to build with Docker from the command line I get:
A compatible installed .NET SDK for global.json version [5.0.302] from [/src/global.json] was not found.
The image used in my Dockerfile is:
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
I don't think I understand the global.json docs. I tried changing the version in global to 5.0.0 and adding rollforward: latestFeature. Now Docker will build, but Visual Studio won't build when I open the project:
.NET Core 5.0.0 SDK is required to build this application, and is not installed.
I expected VS to use the installed 5.0.302 in this case, but it doesn't.
While a 5.0.302 SDK isn't listed in the Microsoft registry, it was available when I tried to pull it.
Try changing your Dockerfile to
FROM mcr.microsoft.com/dotnet/sdk:5.0.302 AS build
I don't know how often Microsoft clean their registry, but you should probably be prepared for the image to disappear at some point.
If you can, I'd advise you to not rely on a specific version of the SDK.

.NET 5 Projects with Packaging Projects fail to build after VS2019 Upgrade to version 16.10

Following issue occurs only on .NET Desktop Projects that also include Windows Application Packaging Project.
After my VS2019 was updated to version 16.10, all my .NET 5 projects that also include a Windows Application Packaging Project fail to build in VS2019. Both the Clean Solution and Rebuild Solution actions fail. In both cases we get the following error:
ResolvePackageDependencies task failed unexpectedly
When I tried dotnet clean I got the following error:
C:\Program Files\dotnet\sdk\5.0.300\Microsoft\DesktopBridge\Microsoft.DesktopBridge.props" was not found. Confirm that the expression in the Import declaration "C:\Program Files\dotnet\sdk\5.0.300\\Microsoft\DesktopBridge\\Microsoft.DesktopBridge.props" is correct, and that the file exists on disk.
And I verified on my Windows 10 Pro - latest version 20H2 that the folder C:\Program Files\dotnet\sdk\5.0.300\Microsoft\ does not have the DesktopBridge folder - and that seem to cause the issue. Both the Clean Solution and Rebuild Solution were working fine just before an upgrade of VS2019 to version 16.10

Cant find package manager console in visual studio for mac

I am using Visual studio for mac. I need to install some packages but I can't find package manager console for that.
Visual studio version: Preview 1 (7.0 build 347)
Warning:
A commenter reports this extension crashes VS Community 2019 for Mac version 8.5 (Build 3183). I haven't upgraded to it, so I can't speak to this. Anyone with information/fix/alternate approach, please chime in down in the comments.
OK:
At least in Visual Studio Community 8.4.8 build 2, you can find it under Visual Studio-->Extensions, using search term "nuget":
It took me so long to find this I hope it helps someone else find it faster!
Similar to Xamarin Studio, you have to use its dialog,
https://developer.xamarin.com/guides/cross-platform/xamarin-studio/nuget_walkthrough/
As there was no cross platform PowerShell, Xamarin Studio lacks of Package Manager Console. It might come one day in Visual Studio for Mac. We will see.
You can follow the NuGet CLI reference and install it
https://learn.microsoft.com/en-us/nuget/tools/nuget-exe-cli-reference
An excerpt from that link provided reads:
macOS/Linux
Behaviors may vary slightly by OS distribution.
Install Mono 4.4.2 or later.
Execute the following commands at a shell prompt:
# Download the latest stable `nuget.exe` to `/usr/local/bin`
sudo curl -o /usr/local/bin/nuget.exe https://dist.nuget.org/win-x86-commandline/latest/nuget.exe
# Give the file permissions to execute
sudo chmod 755 /usr/local/bin/nuget.exe
Create an alias by adding the following script to the appropriate file for your OS (typically ~/.bash_aliases or ~/.bash_profile):
# Create as alias for nuget
alias nuget="mono /usr/local/bin/nuget.exe"
Reload the shell. Test the installation by entering nuget with no parameters. NuGet CLI help should display.
I found a good reference for mac users:
https://github.com/mrward/monodevelop-nuget-extensions
Thanks for the reference and it works for me.

Xamarin iOS build server on OSX using Jenkins and Nuget

I am currently building a continuous integration pipeline on an iMac in order to build Xamarin iOS apps. We are using Jenkins to control the CI build process but the project contains a number of Nuget packages that are not stored in our Git source repo. As these packages are not downloaded by Jenkins I need to call a Restore on the solution.
Is Nuget.exe installed as part of Xamarin Studio on OSX (and if so where) and if not is there an OSX command line version for El Capitan?
The Mono installer on OS-X supplies a nuget shell script and the nuget.exe CIL-assembly
Default install location of script:
/usr/local/bin/nuget
Script contents:
#!/bin/sh
exec /Library/Frameworks/Mono.framework/Versions/4.4.0/bin/mono $MONO_OPTIONS /Library/Frameworks/Mono.framework/Versions/4.4.0/lib/mono/nuget/NuGet.exe "$#"
Nuget version:
As of Mono 4.4.0, the nuget version is:
NuGet Version: 2.8.5.0
Nuget restore:
In the root of your solution, all you have to do is call nuget restore with your solution, i.e.
>nuget restore mysolution.sln
All packages listed in packages.config are already installed

msvcbuild - how to compile luajit

i'va just downloaded luajit and trying to compile it. i'm doing everything as it says here
to compile it i should execute msvcbuild from VS .NET Command Promt. so i installed VS 2010 and started VS 2010 Command Promt
and when i try to execute nsvcbuild it says "no such program and bla-bla-bla".
first i thought that there was no environment path. so i decided to find file msvcbuild.exe inside Program Files folder. and there is no such file.
what am i doing wrong and what should i do to compile luajit?
any help appriciated!
Required steps to build using Visual Studio 2010:
open VS 2010 command prompt window
set up appropriate VS environment: e.g. vcvarsall.bat x64 (for 64-bit) or vcvarsall.bat x86 (for 32-bit)
go to luajit src directory: e.g. cd \projects\luajit\src
start the build: msvcbuild.bat

Resources