Open drdamour opened 3 years ago
I am also getting this issue when trying to use DisableAttribute with provider. Going to ping one of the contributors to hopefully get some response since the issue was reported almost a year ago. cc @ahmelsayed
Done a bit of digging, the validation for DisableAttribute with type provider was added in https://github.com/Azure/azure-functions-vs-build-sdk/issues/85 There was a comment from @MikeStall describing the behaviour https://github.com/Azure/azure-functions-vs-build-sdk/issues/85#issuecomment-319843602
The driving factor here is that whatever the tooling emits cooperates with the existing function.json spec around disabled; and if it's not supported in function.json today, then the tooling emits a error.
From what I can understand DisableAttribute
with type provider is not supported by function.json, but supported by function host at runtime (as well as the setting)
So perhaps, the sdk should just ignore the DisableAttribute with provider type, output nothing into function.json and let webjobs host handle it?
I just ran into this. When I build, it is giving me this error:
1>C:\Users\cataggar\.nuget\packages\microsoft.net.sdk.functions\4.0.1\build\Microsoft.NET.Sdk.Functions.Build.targets(32,5): error : the constructor 'DisableAttribute(Type)' is not supported.
1>C:\Users\cataggar\.nuget\packages\microsoft.net.sdk.functions\4.0.1\build\Microsoft.NET.Sdk.Functions.Build.targets(32,5): error : Error generating functions metadata
1>C:\Users\cataggar\.nuget\packages\microsoft.net.sdk.functions\4.0.1\build\Microsoft.NET.Sdk.Functions.Build.targets(32,5): error :
1>C:\Users\cataggar\.nuget\packages\microsoft.net.sdk.functions\4.0.1\build\Microsoft.NET.Sdk.Functions.Build.targets(32,5): error : Metadata generation failed.
from C:\Users\cataggar.nuget\packages\microsoft.net.sdk.functions\4.0.1\build\Microsoft.NET.Sdk.Functions.Build.targets
I'm using Microsoft.NET.Sdk.Function 4.0.1
It looks like the error the constructor 'DisableAttribute(Type)' is not supported.
is from here:
https://github.com/Azure/azure-functions-vs-build-sdk/commit/e01723e42828899efa92cf89c067d9fb10504036#diff-deef5eafcb2f79e9b4fa343f175b8c0ad462fe43112394ebb47e5b1a563af62cR147
Indeed. This is not a supported constructor in the context of Functions. We'll create an analyzer for this providing clearer information when this is used (with a code suggestion).
@kashimiz will be creating an issue to track the analyzer work and closing this once that is done.
So this sounds like we cannot use a DisableProvider with the DisableAttribute until this is resolved, is that correct? And if so, what release is this planned for?
Any work around for this issue? I am having same one
Updates?
with
now if my DisableProvider is in a referenced project i get:
if it's in the same project assembly i get:
any advice?