I am trying to create a nuget package from a class library project in Visual studio 2015, In Project properties ---> package tab is not available/ visible.
IN the package tab we define the nuget package details.
Is it because of the visual studio 2015 issue or should I look for it somewhere else ?
VS2015 IDE does not support that.
The Package tab(Generate Nuget package on build) is the feature of new sdk style lib project.(Net Core and Net Standard).
And the new sdk projects are released since VS2017 while VS2015 does not support it -- You can not create any Net Core or Net Standard projects and only the Net Framework lib projects which does not contain the feature.
So you should use VS2017 or later VS and then create a Net Core or Net Standard lib project and then you can find it.
Related
I installed latest visual studio preview (Visual Studio Community 2022 Preview - 17.4.0 Preview 3) with .NET 7 include. I started a new project to experience the new Map control and selected the target .NET to be net7.0. Now when searching for the NuGet package Microsoft.Maui.Controls.Maps I'm unable to find it in the NuGet solution. How and where can I install it?
Maps is only available as a pre-release at the moment of writing: https://www.nuget.org/packages/Microsoft.Maui.Controls.Maps
You need to tick the check box that says Include prerelease when you search for NuGets in the Package Manager.
We are finding that Visual Studio 2017 does NOT include Microsoft.Bcl.Build in its package for an Azure Cloud Service (.NET Framework 4.5) project. The same project built and packaged under Visual Studio 2015 does include Microsoft.Bcl.Build.
We determined if included or not when putting the package into production in Azure and the web roles reporting the missing dependency. This can also be seen by comparing the bin folders as well.
Why doesn't VS 2017 include it as it should?
Here is a pic of the nuget dependencies for the project(s).
The package Microsoft.WindowsAzure.Management.Sql is obsolete and had no releases since 2015. It's been replaced by Microsoft.Azure.Management.Sql which has none of these dependencies. You should upgrade to that package.
Note that the Bcl packages are dependencies of an old version of Microsoft.Azure.Common. That package doesn't require them in the current version either. If you can't upgrade to the latest Azure SQL Management package perhaps you should upgrade the Microsoft.Azure.Common package.
Neither VS 2015 nor VS 2017 will ever add Microsoft.Bcl or Microsoft.Bcl.Async. Those packages were created as a stop-gap measure back in 2012 to allow applications using C# 4 to use the async/await keywords. They added both the runtime and compiler extensions to understand the async/await keywords and generate the asynchronous state machine. Visual Studio 2012 itself was able to target C# 5 so it didn't need that package.
Those packages are only used by old libraries that haven't been upgraded to C# 5.
I have Visual Studio 2017 with Xamarin installed.
I want to update to Xamarin.Forms 3
I understand that I have to use NuGet to install the Xamarin Forms 3 NuGet package.
However, to install to NuGet package I need to open a solution in Visual Studio first.
When I open a solution and install the NuGet package - will this package (Forms 3) only be available for that solution?
I need Forms 3 to be available for all new solutions that I will create in future...
If you have at least Visual Studio 2017 15.7 installed then the latest Cross-Platform project templates provided by Xamarin use the Xamarin.Forms 3.0 NuGet package.
For existing projects you have created you would need to update the Xamarin.Forms NuGet package yourself.
Context
I am using VS 2017.3. Just created an ASP MVC project, then added two nuget packages,
Microsoft.TypeScript.Compiler v2.5.3
Microsoft.TypeScript.MSBuild v2.5.3
When trying to configure the typescript build, I see that TypeScript version 2.5 is not available.
Question
What am I missing? I thought that adding those nuget packages will the project (and build) independent from the development machine state of installation...
What I've tried so far
Unloaded, reloaded the project
Exit VS,
restart VS Build the project
Why the added version of typescript compiler is still not available?
You need download and install the typescripts SDK version 2.5.3 from the download center and restarted Visual Studio.
The NuGet package of Microsoft.TypeScript.MSBuild is used for providing the TypeScript MSBuild task, and matching compiler version.
Starting with Visual Studio 2017, we could have multiple TypeScript versions installed and choose specific versions for each of your projects, after you install Microsoft.TypeScript.MSBuild package, you can choose specific versions for your project, for example, I have install several versions of the Typescripts SDKs on my machine:
Then I install that package to my ASP MVC project with the version 2.3, restart the Visual Studio, re-open project, on the Typescripts build tab, you will notice the matching version of Typescript 2.3 is selected by default:
Of course, you can manually select other version of Typescript.
The accepted answer is to the point, but perhaps some further explanation will prove helpful.
In Visual Studio 2017, the typescript compiler provided with the nuget package is only used by msbuild, but the TypeScript language service relies on a TypeScript SDK to be installed on the machine. Quoting from a github issue, "Currently, compile on save in VS requires a matching version of the TypeScript language service to be installed on the machine."
Although the question is tagged with Visual Studio 2017, it might be of interest that this will be amended with Visual Studio 2019. From the release notest of the release candidate: "The JavaScript/TypeScript language service will now be automatically loaded in projects that have the TypeScript NuGet package or npm package installed (TypeScript 3.2 and up is supported from the NuGet package and TypeScript 2.1 and up is supported from the npm package)."
A NuGet package is published with many, many assemblies. Not all assemblies in a NuGet package need to be referenced in the *.csproj in Visual Studio. How does Visual Studio determine which assembly to reference? Is the logic for this in nuget.exe or is it in some NuGet API?
How does Visual Studio determine which assembly to reference? Is the logic for this in nuget.exe or is it in some NuGet API?
This determine should be a combination of nuget.exe and NuGet API in Visual Studio. Visual Studio use NuGet.exe to download the package, then use the NuGet API in Visual Studio to install the corresponding assemblies to the project.
First, NuGet supports putting multiple versions of the same library in a single package when using the convention-based working directory. So we will use different case-sensitive framework names to specifically target multiple frameworks with subfolders under lib:
lib\{framework name}[{version}]
Then we will use NuGet API in Visual Studio to install the package to project, it tries to match the framework name of the assembly with the target framework of the project.
Besides, NuGet Package Manager for Visual Studio is an instance of the combination of nuget.exe and nuget API, so Visual studio knows which assemblies in a NuGet package to reference.
You can refer to the NuGet document Supporting multiple .NET framework versions for more detail info.