“Package is not found…” when updating NuGet Package from Azure DevOps

if you are using the Azure DevOps, you may already know that it provides Azure Artifacts (it was called NuGet Package Management before VSTS renamed to Azure DevOps). With that you could create and share NuGet pacakges feed from public and private sources.

With the Azure DevOps CI pipeline, you could then build your solution, pack and push the NuGet package into private Azure Artifacts.

If you are already running in this way, you may have experience on trying to update the existing NuGet Package and it returns an error,

“Attempting to gather dependency information for package ‘xxx.newer.version’ with respect to project ‘ThisProject’, targeting ‘.NETFramework,Version=v4.7’

Package ‘xxx.newer.version’ is not found in the following primary source(s): ‘https://[YourDevOps_Name].pkgs.visualstudio.com/_packaging/[Your_AzureArtifacts_Name]/nuget/v3/index.json,https://api.nuget.org/v3/index.json’. Please verify all your online package sources are available (OR) package id, version are specified correctly.”

I tried to search from internet and found someone who is working in Microsoft has replied on 10th May 2018 as the following,


“Seems you are trying to download the package or packages that where just freshly pushed to VSTS nuget feed.
Since Visual Studio 2017 is listing it correctly, then the issue should not related to the feed on VSTS server.
If this occurs very recently(download the new refresh package) and your package is very large, this maybe a network delay. Suggest you use a fiddler trace when this issue happens again. This makes “some” sense, what you see is probably an incorrect propagation of pushed packages showing up in the search results but not yet available to download.
And some other also encounter the same issue and error as you.”

Well, I tried to use fiddler to see what is happening when I tried to update the package. Because I have also set up the upstream sources, so it checks on all the available NuGet Packages in private Azure Artifact until it founds the match one. (That also explains me another question, why it takes so long to attempt the dependency information for the updating NuGet Package). I could confirm that the newer package is updated in feed and may be taking a longer time to upload the actual package.

So next time, if you found the similar message when updating NuGet Package from Azure Artifact, you could do,

  1. Wait and retry later.
  2. if the problem keep exists, you could try to clear the NuGet Cache from VS–>Tools–>Nuget Package Manager–>Package manager Settings–>General.

Adding Support of .NET Framework 4.6.1 Prerequisite into InstallShield 2015 in VS2015

For most of .NET developers, you might need to create a installer package for your developed application and you might be using InstallShield. One of the configuration that you would do is setting up the .NET Framework requirement for your project.

In VS2015 with InstallShield 2015, you will found the pre-defined package for the requirement of .NET framework is only up to “Microsoft .NET Framework 4.5 Full package”. I am going to show you how to add the package into InstallShield 2015 for the “Microsoft .NET Framework 4.6.1 Full Package”.

Below is the text that can be used to create your own .prq file for the Microsoft .NET Framework 4.6.1 Full Prerequisite.
+++++++++
<?xml version=”1.0″ encoding=”UTF-8″ standalone=”yes”?>
< SetupPrereq>
<conditions>
<condition Type=”2″ Comparison=”2″ Path=”HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full” FileName=”Release” ReturnValue=”394254″/>
</conditions>
<operatingsystemconditions>
<operatingsystemcondition MajorVersion=”6″ MinorVersion=”1″ PlatformId=”2″ CSDVersion=”” Bits=”4″ ServicePackMajorMin=”1″/>
<operatingsystemcondition MajorVersion=”6″ MinorVersion=”2″ PlatformId=”2″ CSDVersion=”” Bits=”4″/>
<operatingsystemcondition MajorVersion=”10″ MinorVersion=”0″ PlatformId=”2″ CSDVersion=”” Bits=”4″/>
</operatingsystemconditions>
<files>
<file LocalFile=”.\Microsoft.net\4.6\Full\NDP461-KB3102436-x86-x64-AllOS-ENU.exe” URL=”https://download.microsoft.com/download/E/4/1/E4173890-A24A-4936-9FC9-AF930FE3FA40/NDP461-KB3102436-x86-x64-AllOS-ENU.exe” CheckSum=”864056903748706E251FEC9F5D887EF9″ FileSize=”0,67681000″/>
</files>
<execute file=”NDP461-KB3102436-x86-x64-AllOS-ENU.exe” cmdline=”/q /norestart” cmdlinesilent=”/q /norestart” returncodetoreboot=”1641,3010″/>
<properties Id=”{B1C982A7-100D-4691-9DCF-F5986F404DD8}” Description=”This prerequisite installs the .NET Framework 4.6.1 full standalone package.”/>
<behavior Reboot=”32″/>
< /SetupPrereq>
+++++++++

Notes:

  • The Conditions are set for 64bit only, Windows 7, Windows 8, Windows 10.
  • The download location is good as of 10th March 2017. No telling how long it will last. If the download does not work any more, you would download the offline installer from https://www.microsoft.com/en-us/download/details.aspx?id=49982 and then copy it into “C:\Program Files (x86)\InstallShield\2015\SetupPrerequisites\Microsoft .net\4.6\Full” folder
  • If you received similar error as below
    “An error occurred streaming ‘Microsoft.net\4.6\Full\NDP461-KB3102436-x86-x64-AllOS-ENU.exe’ into setup.exe”
    You could try to run the InstallShield or VS in Admin mode.

Help:
For those new to making a Prerequisite .prq file:

  •  On your desktop create a new text file.
  • Rename this file “Microsoft .NET Framework 4.6.1 Full.prq”
  • Copy the above text to this new file. (Between the +++++)
  • Move this new file to folder C:\Program Files (x86)\InstallShield\2015\SetupPrerequisites
  • Open any InstallShield project
  • Go to the Installation Designer tab > Application Data > Redistributables
  • The list should now contain the new entry “Microsoft .NET Framework 4.6.1 Full”
  • To the right of the list it will say “Needs to be downloaded”
  • Right-click on the item Microsoft .NET Framework 4.6.1 Full.prq and select Download Selected Item…
  • This downloads the 66 MB file to C:\Program Files (x86)\InstallShield\2015\SetupPrerequisites\Microsoft.net\4.6\Full\

You should be good.

To edit any of the Conditions:
Right-click on the item Microsoft .NET Framework 4.6.1 Full.prq and select Edit Prerequisite

To Support 32bit and 64bit:
You could remove the “Bits” or leave the value of it to be blank in the above sample, and that will work for both x32 and x64

To find out more on OS version number
https://msdn.microsoft.com/en-us/library/windows/desktop/ms724832%28v=vs.85%29.aspx

To find out more on Value of Release for the .NET Framework
https://msdn.microsoft.com/en-us/library/hh925568%28v=vs.110%29.aspx

Update on C# and VB in VS2017

The latest version on Visual Studio 2017 at this moment is still in Release Candidate (RC) stage on build 26127.03, released on 1st Feb 2017. There are many new features in this VS2017 which it is too long to write all of them down here. You may visit the release notes for more detail.

Here I want to highlight the new support for C# & VB, and also 2 new members in VS2017, Visual Studio for Mac and Visual Studio Mobile Center.

Visual Studio for the Mac

is built from the ground up for the Mac and focused on full-stack, client-to-cloud native mobile development, using Xamarin for Visual Studio, ASP.NET Core, and Azure. To learn more, please read Miguel de Icaza’s blog post introducing Visual Studio for Mac.

 

Visual Studio Mobile Center

is “mission control for mobile apps.” It brings together multiple services commonly used by mobile developers into a single, integrated service that allows you to build, test, deploy, and monitor cloud attached apps in one place. To learn more, please read Nat Friedman’s post elaborating on Visual Studio Mobile Center.

 

OK, let’s talk about the new feature support for C# & VB in VS2017.

IDE Experience and Productivity

Visual Studio provides new refactorings to allow you to organize source code with one action:

  • New in RC Simplify object initialization with an initializer:
  • New in RC Move out variable declarations inline, leveraging a new C#7 feature:
  • New in RC Simplify null checks and throw expressions using null-coalescing operator, leveraging a new C#7 feature:
  • Move type to matching file: Extract a type from one file and put it in another file with a matching name with one click via Ctrl+..
  • Sync file and type name: If your file and type name are out of sync, you can use Ctrl+..
  • Convert String.Format to string interpolation: take advantage of the C# 6 language feature with this Quick Action.

This release also introduces improvements to IntelliSense that will make you more productive when working in a large solution or an unfamiliar codebase. We have added an icon tray to IntelliSense that enables you to filter the member list by type (e.g., methods, properties, classes, etc.). Each filter toggle has an associated keyboard shortcut which you can discover by hovering over the icon. To enable this feature, go to Tools > Options > Text Editor > [C# | Visual Basic] > IntelliSense and check the options for filtering and highlighting.

We’ve also added/updated style analyzers to help you customize and enforce coding conventions on your team, including:

  • Naming style rules.
  • Use of “var” or explicit types.
  • Use of “this.” or “Me.” on member access.
  • Missing braces.
  • Missing switch case.

New in RC Building on Visual Studio’s support for EditorConfig, we worked with the community to add .NET code style settings to the file format. This means that you can configure your team’s code style conventions, check them into source control, and have violations appear live in the editor as developers are typing. You can see all the code style options in the Roslyn repo’s .editorconfig or in the documentation.

Other new features in this release include:

  • You can now split a long string into multiple concatenated strings by positioning the cursor mid-string and pressing Enter.
  • A new code action for converting a property to a method.
  • We now use fuzzy matching in the NavigateTo search results.

Look for the following improvements to the IDE experience that are also in Visual Studio 2015 Updates:

  • A new quick fix option to add a reference to a NuGet package.
  • Refactorings that simplify delegate invocations and raising events using the null condition operator.
  • Refactorings to make async methods synchronous where applicable.
  • Improvements to Add Using command to support “fuzzy” matching for misspelled types, including adding any needed project or metadata references.

Language Extensions and Analyzers

This release includes some proposed new language extensions that we are working on for the next versions of C# and Visual Basic. These new language features are enabled by default and include:

For C#:

  • Task-like return types for async methods: This introduces the ability to return any task-like type from an async method. Previously these return types were constrained to Task<T> and Task.
  • Value tuples introduce language support for using tuples to temporarily group a set of typed values. To learn more, please review the design notes on GitHub.
  • Nested local functions extend the language to support declaration of functions in a block scope.
  • Pattern matching extensions enable many of the benefits of algebraic data types and pattern matching from functional languages.
  • Ref returns enable functions to return values by reference.

For Visual Basic:

  • Value tuples introduce language support for using tuples to temporarily group a set of typed values: Dim point As (x As Integer, y As Integer) = GetOffset().
  • ByRef return consumption extend the language to support consumption of functions and properties from libraries which have ByRef returns.
  • Binary literals and digit group separators allow native representation of binary numbers. This is super convenient for bitmasks and flags enumerations: &B1001_0011.

For more information, follow our development on GitHub to learn more about these and other proposed language extensions and APIs.

Finally, we have done considerable work to improve responsiveness of the IDE in presence of background operations that compute diagnostics and CodeLens information.