Comments (9)
I have narrowed it down a bit - the error seems to appear if I use JsonProperty on an ICommand-implementing class (in my case, AddTenantToPolicyCommand.cs) as followed:
using AzureFromTheTrenches.Commanding.Abstractions;
using ICE.Models;
using Newtonsoft.Json;
namespace ICE.Commands.Policies
{
public class AddTenantToPolicyCommand : ICommand<Policy>
{
[JsonProperty("name")] // Commenting this out stops the error.
public string PolicyName { get; set; }
// [JsonProperty("newTenant")]
public int NewTenant { get; set; }
}
}
I have a sneaking suspicion that this has something to do with the way JSON serialisation & deserialisation is done natively by FM?
from functionmonkey.
Or, if a command subclasses from a class with JsonProperties.
from functionmonkey.
Thanks for reporting it and doing all that digging around - I'll try and take a look today (I'm on UK time).
from functionmonkey.
Apologies - struggled to find any time the last couple of days but almost certainly will over the weekend.
from functionmonkey.
Could you give this a go on the latest Azure Functions runtime with Function Monkey v0.13 please and let me know how you get on?
I'm struggling to replicate it but my attempts to do so have taken place after updating Function Monkey to be compatible with the new runtime.
from functionmonkey.
Yep will do - currently doing some spring cleaning on the codebase but I should get around to this in 3-4hrs.
from functionmonkey.
I can, in fact, confirm this isn't happening anymore. Weird, perhaps due to the new AZ function runtime?
from functionmonkey.
Yes I think so - I'd suspected it might be. They've done a lot of work around the dependency compatibility issues caused by things being in process and packages in the core runtime in the last couple of releases and the last update made the final set of changes for v2. It was super easy to get into a pickle before.
Phew.
Thanks for reporting and working through with me, much appreciated.
from functionmonkey.
Hi James,
This seems to have reared its head again. Using FM 3.0.17 with Microsoft.NET.sdk.Functions 1.0.30-beta2 results in :
13>Unhandled Exception: System.IO.FileLoadException: Could not load file or assembly 'Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'. Could not find or load a specific file. (Exception from HRESULT: 0x80131621) 13> at System.ModuleHandle.ResolveType(RuntimeModule module, Int32 typeToken, IntPtr* typeInstArgs, Int32 typeInstCount, IntPtr* methodInstArgs, Int32 methodInstCount, ObjectHandleOnStack type) 13> at System.ModuleHandle.ResolveTypeHandleInternal(RuntimeModule module, Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext) 13> at System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments) 13> at System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttributeRecord caRecord, MetadataImport scope, Assembly& lastAptcaOkAssembly, RuntimeModule decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, Object[] attributes, IList derivedAttributes, RuntimeType& attributeType, IRuntimeMethodInfo& ctor, Boolean& ctorHasParameters, Boolean& isVarArg) 13> at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes) 13> at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimePropertyInfo property, RuntimeType caType) 13> at System.Attribute.InternalGetCustomAttributes(PropertyInfo element, Type type, Boolean inherit)
from functionmonkey.
Related Issues (20)
- CamelCaseJsonSerializer does not work for ExpandoObject
- HttpResponseHandler not used for BadParameterResponse in http.csharp.handlebars HOT 1
- Receive and add CancellationToken to DI to enable for graceful shutdowns HOT 1
- Compiling Azure Functions with NuGet package dependencies fails HOT 13
- Problems with StorageQueue in 4.0.56-beta4 HOT 2
- Event Grid Triggers
- Unable to upload a file
- HowTo BeforeServiceProviderBuild HOT 1
- Solution Structure
- Http Trigger: AuthorizationLevel.Anonymous runs ClaimsPrincipalAuthorization but it should be ignored HOT 3
- How to access Cookie (and QueryString) collection ?
- Future of Function Monkey HOT 10
- Compiler Build Error with Entity Framework Core HOT 4
- Add Validators via Assembly search not working HOT 2
- Primitives / Arrays in HTTP body
- Need a way to access full HttpContext HOT 2
- FunctionMonkey.Compiler can't be built
- Accessing request headers
- Azure App Configuration in Configuration.
- CosmosDB lease container appears inoperable
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from functionmonkey.