I have a number of RMSC that work in DevForce 2010, but I can't seem to get them to work in 2012. I can do a normal query and get entities back, so I don't think it is a EM configuration issue.
I have tried this from a test project, and the error is always the same:
System.IO.FileNotFoundException: Could not load file or assembly 'SilverlightApplication62' or one of its dependencies.
ServerMethods.cs is linked to the SL project for the Delegate.
This is the test Server Method:
public static class ServerMethods
{
[AllowRpc]
public static object GetNumberOfOrders(IPrincipal principal,
EntityManager entityManager, params Object[] args)
{
return 5;
}
}
This is the SL call:
public async void GetNumberOfOrderFromServer(int id) {
var _entityManager = new JetAnalyticsEntities();
var serverMethod = new ServerMethodDelegate(ServerMethods.GetNumberOfOrders);
var returnValue = (int)await _entityManager.InvokeServerMethodAsync(serverMethod, id);
}
I also tried it using strings:
public async void GetNumberOfOrders2(int id)
{
try
{
string typeName = "SilverlightApplication62.ServerMethods, SilverlightApplication62";
string methodName = "GetNumberOfOrders";
var result = (int) await _entityManager.InvokeServerMethodAsync(typeName, methodName, id);
}
catch (Exception ex)
{
}
}
The error message is always the same about the file could not be found. I am assuming that it can't find ServerMethods.cs, as a breakpoint in the file is never hit. This is the full error message from the log:
Caught exception: System.IO.FileNotFoundException: Could not load file or assembly 'SilverlightApplication62' or one of its dependencies. The system cannot find the file specified. File name: 'SilverlightApplication62' at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) at System.Reflection.Assembly.Load(AssemblyName assemblyRef) at IdeaBlade.Core.Reflection.ReflectionExtensions.LoadAssembly(String assemblyName) at IdeaBlade.Core.Reflection.ReflectionFns.GetLatestType(String pTypeName, Boolean pThrowOnError, Boolean pIgnoreCase) at IdeaBlade.EntityModel.Edm.RsmMethod.Create(String typeName, String methodName) at IdeaBlade.EntityModel.Edm.UdtMethodMap.GetRsmMethod(String typeName, String methodName) at IdeaBlade.EntityModel.Server.EntityServer.InvokeServerMethod(SessionBundle sessionBundle, InvokeServerMethodWorkState workState) at SyncInvokeInvokeServerMethod(Object , Object[] , Object[] ) at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs) at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage41(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage3(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage2(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage1(MessageRpc& rpc) at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet) === Pre-bind state information === LOG: User = DisplayName = SilverlightApplication62 (Partial) WRN: Partial binding information was supplied for an assembly: WRN: Assembly Name: SilverlightApplication62 | Domain ID: 2 WRN: A partial bind occurs when only part of the assembly display name is provided. WRN: This might result in the binder loading an incorrect assembly. WRN: It is recommended to provide a fully specified textual identity for the assembly, WRN: that consists of the simple name, version, culture, and public key token. WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue. LOG: Appbase = file:///D:/Clients/Test/SilverlightApplication62Web/ LOG: Initial PrivatePath = D:\Clients\Test\SilverlightApplication62Web\bin Calling assembly : IdeaBlade.Core, Version=7.1.1.0, Culture=neutral, PublicKeyToken=287b5094865421c0. === LOG: This bind starts in default load context. LOG: Using application configuration file: D:\Clients\Test\SilverlightApplication62Web\web.config LOG: Using host configuration file: C:\Users\Administrator\Documents\IISExpress\config\aspnet.config LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config. LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind). LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/1ae1acb2/bf9e6e56/SilverlightApplication62.DLL. LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/1ae1acb2/bf9e6e56/SilverlightApplication62/SilverlightApplication62.DLL. LOG: Attempting download of new URL file:///D:/Clients/Test/SilverlightApplication62Web/bin/SilverlightApplication62.DLL. LOG: Attempting download of new URL file:///D:/Clients/Test/SilverlightApplication62Web/bin/SilverlightApplication62/SilverlightApplication62.DLL. LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/1ae1acb2/bf9e6e56/SilverlightApplication62.EXE. LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/1ae1acb2/bf9e6e56/SilverlightApplication62/SilverlightApplication62.EXE. LOG: Attempting download of new URL file:///D:/Clients/Test/SilverlightApplication62Web/bin/SilverlightApplication62.EXE. LOG: Attempting download of new URL file:///D:/Clients/Test/SilverlightApplication62Web/bin/SilverlightApplication62/SilverlightApplication62.EXE.
|