Where is FunctionInvocationFilterAttribute located? - c#

I've been reading about the extension points of azure functions using the function filters - https://github.com/Azure/azure-webjobs-sdk/wiki/Function-Filters
However I'm stuck at the first hurdle of creating my own class that inherits FunctionInvocationFilterAttribute. I just can't find the type anywhere.
FYI - I'm also pointing at the nightly builds nuget feed (http://www.myget.org/F/azure-appservice/api/v2)
Where is the FunctionInvocationFilterAttribute type located?

Finally found the location of the FunctionInvocationFilterAttribute, It looks like it is part of the 2.x.x line of packages on the nightly build feed not the 3.x.x packages. Thus Updating to the latest pre-release package didn't contain the class.
For anyone interested - this is currently in the dev branch on the github project - https://github.com/Azure/azure-webjobs-sdk/blob/dev/src/Microsoft.Azure.WebJobs.Host/Filters/FunctionInvocationFilterAttribute.cs
and also details on this functionality can be found on this github issue
So to install the correct package:
Install-Package Microsoft.Azure.WebJobs -Version 2.1.0-beta1-10998
or
dotnet add package Microsoft.Azure.WebJobs --version 2.1.0-beta1-10998

Related

Issue with multiple target frameworks in Nuget Package: 'package_version' is not a valid version string. Parameter name: Version

I made a Nuget package which has 1 project in it that targets .NETFramework Version=V4.8 and V6.0.
It also has a dependency on another Nuget package being: Microsoft.Graph.
When installing the package on a .NET V6.0 project everything works fine, however, when installing the same package on a .NET v4.8 project I get the following error:
Error message:
.csproj file main project:
The Nuget package gets built and pushed to Nuget using DevOps pipelines.
This is the pipeline used for this package:
I have already tried solutions explained in this post: '' is not a valid version string." exception in nuget for VS2019
Does anyone have any idea what i'm doing wrong here? Thanks in advance!
Kind Regards,
Swedo

Can a package contain a package?

Installing Packages from Nuget are one of the most efficient ways for developing C# applications. It's a huge time saver.
However, can a Package I install from Nuget also contain a package(s) installed within it? If so how can I view sub-packages within a Package?
Short answer is yes, you can use packages inside of other packages. They are called dependencies, and the other packages will get installed along side the first package. Here's the Microsoft Documentation on nuget package dependency.
EDIT:
Here's how to view/manage these in visual studio. You can view all other packages in the dependencies section shown below. This package depends on System.ValueTuple with a version of 4.5.0 or greater.

How do I install Newtonsoft.json for Visual Studio 2010?

I am trying to make Newtonsoft.json available for use in my local Visual Studio 2010 projects. I installed NuGet.Tools on my system. Now I see an item in the Solution Explorer called Service References that wasn't there before, but I don't understand how to use that to reference the Newtonsoft package I also downloaded, which is currently in my Downloads folder. Do I need to move the package to a different location to reference it?
Thanks for your help.
You can right click on the project where you want to install newtonsoft nuget package.
You will find an option "Manage NuGet packages".
Then search online for "newtonsoft".
This would add a packages.config file in your project (depending on which framework you are targeting to ).
this new file contains all the nuget dependencies required for this project.
Refer this blog for more details
VS2010 is old and is unable to update to the latest NuGet version. This means that adding recent packages will often fail; however, you can often add an older version of a package that has a compatible NuGet version and it will work. This causes the suggested answer by #ManojChoudhari to fail for me. In the case of Newtonsoft.Json, the following worked using the Package Manager Console:
Install-Package Newtonsoft.Json -Version 9.0.1

NuGet fails to find existing package

How it's possible that NuGet's Install-Package fails with Unable to find version 'x' of package 'y' when that exact version is released as NuGet to the official repository and it shown on the https://www.nuget.org/packages/y page.
Here is specific sample with nuget.org content and NuGet Install-Package command output.
UPDATE. Package sources are set to defaults (from nuget.org). Actually, you can see the issue just by running Install-Package Log4Net.Async -Version 1.3.0.
UPDATE 2. I want to highlight that it's not about some developer's machine - the same things happen on Visual Studio Online Hosted Build Controller.
UPDATE 3. Here is how NuGet tries to load package and it looks like NuGet API just broken, because all these requests fail with the error below.
Resource not found for the segment 'Packages'
Also NuGet produces a strange output on NuGet API calls that issued at VS search packages stage, please see here: http://pastebin.com/qveadrZB.
NuGet currently has some service issues related to search and package restore functionality. It is possible this is the cause of your package restore failure.
If other dev machines are working OK, it's likely they have access to a cached version of this package.
Clear your NuGet cache under options -> NuGet Package Manager
I know this thread is very old, but someone who has this problem like me in these days, find my solution for solving such problem here.
I've installed Visual Studio 2012/2015/2017 parallel, and 2012 failed with "package not found error".
So I take a look in the NuGet-settings in VS2017 and found the following package resource:
https://api.nuget.org/v3/index.json
I just added this location to the package resources and vĂ²ila, the searched packages where found and installed (in my example the HtmlRenderer).
But be careful with compatibility to Framework 2.0! This setting breaks maybe the functionality to version 2.0!!
Hope this helps someone sometimes somewhere.
Greetings
I'm a latecomer to this thread... I'm in Visual Studio 2017 - 15.9.4
I got this error today trying to pull from my private DevOps NuGet feed
CONTEXT:
the first time I called Install-Package everything worked, but, my NuGet was not assembled right, so, I re-published the NuGet pkg, and
when I tried to update my project that was consuming the pkg, that's
when I got the failure)
Switching my Package Source to "all" alleviated the problem.
After 4 hours struggle I found solution here
https://www.grapecity.com/componentone/docs/uwp/online-getting-started/config-nugetpackage.html
Tools > Options > NuGet Package Manager > Package Sources. > Click add button and add following one by one
nuget.org
https://www.nuget.org/api/v2/
GrapeCity
http://nuget.grapecity.com/nuget
NuGet settings in Visual Studio
Right click on references in your project
Manage NuGet Packages => All
Uninstall affected packages
If this does not resolve the issue, try to remove it from the NuGet config file located at
C:\Users\UserName\AppData\Roaming\NuGet\NuGet.config

Twilio.Api.dll version mismtach with nuget?

In VS2013, I started a new console app and issued a nuget command to pull down the latest Twilio.API.dll (as per the nuget gallery website)
Install-Package Twilio -Version 3.6.27
And I get:
Adding 'RestSharp 105.0.1' to Twilio.
Successfully added 'RestSharp 105.0.1' to Twilio.
Adding 'Twilio 3.6.27' to Twilio.
Successfully added 'Twilio 3.6.27' to Twilio.
...
And I build the console. This puts the dependent DLLs in my bin/Debug folder. When I right-click on the actual Twilio.Api.dll file, and go to the Details tab, it says the product version is 3.4.1.0.
Any ideas on why there is this version mismatch? Does it matter?
Twilio Evangelist here.
A 3.6.27 is the version of the Nuget package, which contains all the references as described above.
What you're looking at is the assembly version for Twilio.Api. that comes from the SharedAssemblyInfo.cs which is hardcoded. You are right however when you think this should change as it should ideally match the package version.
To answer your question though, what is important here is that you downloaded the correct Nuget package, and with that all the up-to-date references, so your project should work without glitches.

Categories

Resources