You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 16, 2024. It is now read-only.
Trying to use Fake-Xrm-Easy inside node.js, using edge.js, and calling the method GetOrganizationService in the XrmFakedContext, I'm getting the following exception:
System.TypeInitializationException: The type initializer for 'FakeItEasy.Core.FakeScope' threw an exception. ---> System.ArgumentException: Illegal characters in path.
at System.IO.Path.CheckInvalidPathChars(String path, Boolean checkAdditional)
at System.Security.Permissions.FileIOPermission.CheckIllegalCharacters(String[] str)
at System.Security.Permissions.FileIOPermission.AddPathList(FileIOPermissionAccess access, AccessControlActions control, String[] pathListOrig, Boolean checkForDuplicates, Boolean needFullPath, Boolean copyPathList)
at System.Security.Permissions.FileIOPermission..ctor(FileIOPermissionAccess access, String path)
at System.Reflection.RuntimeAssembly.get_Location()
at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
at System.Collections.Generic.HashSet`1.UnionWith(IEnumerable`1 other)
at System.Collections.Generic.HashSet`1..ctor(IEnumerable`1 collection, IEqualityComparer`1 comparer)
at FakeItEasy.Core.TypeCatalogue.GetAllAssemblies(IEnumerable`1 extraAssemblyFiles)
at FakeItEasy.Core.TypeCatalogue.Load(IEnumerable`1 extraAssemblyFiles)
at FakeItEasy.ImportsModule.<>c__DisplayClass3.<RegisterDependencies>b__1(DictionaryContainer c)
at FakeItEasy.IoC.DictionaryContainer.SingletonResolver`1.UnresolvedState.Resolve(DictionaryContainer container)
at FakeItEasy.IoC.DictionaryContainer.<>c__DisplayClass1`1.<Register>b__0(DictionaryContainer c)
at FakeItEasy.IoC.DictionaryContainer.Resolve(Type componentType)
at FakeItEasy.ServiceLocator.Resolve[T]()
at FakeItEasy.ImportsModule.<RegisterDependencies>b__0(DictionaryContainer c)
at FakeItEasy.IoC.DictionaryContainer.SingletonResolver`1.UnresolvedState.Resolve(DictionaryContainer container)
at FakeItEasy.IoC.DictionaryContainer.<>c__DisplayClass1`1.<Register>b__0(DictionaryContainer c)
at FakeItEasy.IoC.DictionaryContainer.Resolve(Type componentType)
at FakeItEasy.ServiceLocator.Resolve[T]()
at FakeItEasy.ImportsModule.<RegisterEnumerableInstantiatedFromTypeCatalogue>b__5[T](DictionaryContainer c)
at FakeItEasy.IoC.DictionaryContainer.SingletonResolver`1.UnresolvedState.Resolve(DictionaryContainer container)
at FakeItEasy.IoC.DictionaryContainer.<>c__DisplayClass1`1.<Register>b__0(DictionaryContainer c)
at FakeItEasy.IoC.DictionaryContainer.Resolve(Type componentType)
at FakeItEasy.ServiceLocator.Resolve[T]()
at FakeItEasy.Core.FakeScope.RootScope..ctor()
at FakeItEasy.Core.FakeScope..cctor()
--- End of inner exception stack trace ---
at FakeItEasy.Core.FakeScope.get_Current()
at FakeItEasy.IoC.DictionaryContainer.<>c__DisplayClass1`1.<Register>b__0(DictionaryContainer c)
at FakeItEasy.IoC.DictionaryContainer.Resolve(Type componentType)
at FakeItEasy.ServiceLocator.Resolve[T]()
at FakeItEasy.RootModule.<RegisterDependencies>b__3(DictionaryContainer c)
at FakeItEasy.IoC.DictionaryContainer.<>c__DisplayClass1`1.<Register>b__0(DictionaryContainer c)
at FakeItEasy.IoC.DictionaryContainer.Resolve(Type componentType)
at FakeItEasy.ServiceLocator.Resolve[T]()
at FakeItEasy.RootModule.<RegisterDependencies>b__1c(DictionaryContainer c)
at FakeItEasy.IoC.DictionaryContainer.<>c__DisplayClass1`1.<Register>b__0(DictionaryContainer c)
at FakeItEasy.IoC.DictionaryContainer.Resolve(Type componentType)
at FakeItEasy.ServiceLocator.Resolve[T]()
at FakeItEasy.RootModule.<RegisterDependencies>b__1b(DictionaryContainer c)
at FakeItEasy.IoC.DictionaryContainer.<>c__DisplayClass1`1.<Register>b__0(DictionaryContainer c)
at FakeItEasy.IoC.DictionaryContainer.Resolve(Type componentType)
at FakeItEasy.ServiceLocator.Resolve[T]()
at FakeItEasy.A.Fake[T]()
at FakeXrmEasy.XrmFakedContext.GetFakedOrganizationService(XrmFakedContext context)
at FakeXrmEasy.XrmFakedContext.GetOrganizationService()
at Startup.<Invoke>d__0.MoveNext()
The Javascript code that I'm trying to run is the following:
varedge=require('edge');varhelloWorld=edge.func({source:function(){/* using System.Threading.Tasks; public class Startup { public async Task<object> Invoke(object input) { var x = new FakeXrmEasy.XrmFakedContext(); try{ var y = x.GetOrganizationService(); } catch(System.Exception ex){ System.Console.WriteLine(ex); throw ex; } return null; } }*/},references:['FakeXrmEasy.dll','Microsoft.Crm.Sdk.Proxy.dll','Microsoft.Xrm.Tooling.Connector.dll','Microsoft.Xrm.Sdk.dll','System.Runtime.Serialization.dll','Microsoft.IdentityModel.Clients.ActiveDirectory.dll','System.ServiceModel.dll','System.Activities.dll']});helloWorld('JavaScript',function(error,result){if(error)throwerror;console.log(result);});
Trying to use Fake-Xrm-Easy inside node.js, using edge.js, and calling the method GetOrganizationService in the XrmFakedContext, I'm getting the following exception:
The Javascript code that I'm trying to run is the following:
Attached example:
FakeXrmEasyTest.zip
In order to run the example, download, unblock and unzip the attached file.
In a console, cd into the extracted dir and type
then
You should see the above error message.
Any ideas about what can be causing this?
Thanks
The text was updated successfully, but these errors were encountered: