想知道你是否有任何关于我遇到的以下问题的想法.
这是一些超级简单的插件代码.
namespace Demo.DebugTraceBlog
{
public class TraceAndDebugDemo : IPlugin
{
public void Execute(IServiceProvider serviceProvider)
{
Trace.WriteLine("Started Plugin");
Trace.WriteLine("Plugin Working");
Trace.WriteLine("Ending Plugin");
}
}
}
Run Code Online (Sandbox Code Playgroud)
我正在使用DebugView(http://goo.gl/YRfus)来查看正在写入的跟踪消息.当我执行这个代码作为一个插件在沙箱中运行,我得到我预期的结果:三线出现在DebugView中,如果我附上VS沙盒工作进程我看到写入到输出窗口三行.现在,当我改变隔离模式无法比拟的,并且让它在W3WP.EXE过程来看,我没有得到任何输出到DebugView中,当我连接到我的w3wp.exe可以设置断点以验证它正在运行,但我不知道获取任何输出到输出窗口.
知道为什么会发生这种情况以及如何重写原因并强制非沙盒执行按预期工作的任何想法.我可以猜测它与运行CRM IIS进程内部有关,而CRM正在抑制Trace写入 - 我专门使用Trace而不是Debug来试图避免这个问题,但没有运气.
我知道我可以使用ITracingService,但这不符合我当前的要求.
我在Sandbox中执行了一个Dynamics CRM 2013插件.
此代码具有以下自定义异常类:
[Serializable]
public class PluginValidationException : Exception
{
public PluginValidationException()
{
}
protected PluginValidationException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
public PluginValidationException(string message)
: base(message)
{
}
public PluginValidationException(string message, Exception inner)
: base(message, inner)
{
}
}
Run Code Online (Sandbox Code Playgroud)
当插件中抛出此异常时,它会生成一个通用错误窗口,日志文件中没有详细信息:

未处理的异常:System.ServiceModel.FaultException`1 [[Microsoft.Xrm.Sdk.OrganizationServiceFault,Microsoft.Xrm.Sdk,版本= 6.0.0.0,文化=中性公钥= 31bf3856ad364e35]]:System.Runtime.Serialization.SerializationException: Microsoft Dynamics CRM遇到错误.为管理员或支持参考号:#1355B4E4Detail:-2147220970调用堆栈在Microsoft.Crm.Application.Platform.ServiceCommands.PlatformCommand.XrmExecuteInternal()在Microsoft.Crm.Application.Platform.ServiceCommands.CreateCommand.Execute()在Microsoft.Crm.在Microsoft.Crm.Application.Platform.EntityProxy.CreateAndRetrieve(String [] columnSet,Boolean performDuplicateCheck上的Microsoft.Crm.Application.Platform.EntityProxy.Create(Boolean performDuplicateCheck)中的Application.Platform.EntityProxy.Create(Boolean performDuplicateCheck,Guid auditingTransactionId) )维持在Microsoft.Crm.Application.WebServices.InlineEdit在Microsoft.Crm.Application.WebServices.InlineEdit.SaveCommand.ExecuteCommand(字符串commandXml Microsoft.Crm.Application.WebServices.InlineEdit.CommandBase.UpdateEntity(实体的实体,布尔检索)) .CommandBase.Execute(String commandXml)System.Runtime.Serialization.SerializationException:Microsoft Dynamics CRM遇到错误.为管理员或支持参考号:#1355B4E4 2014-04-06T02:04:30.0972001Z [Demo.DemoPlugin:Demo.DemoPlugin.BasicCrmPlugin] [d86b89ab-F1BC-e311-9408-000c29254b18:Demo.DemoPlugin.BasicCrmPlugin:创建接触的]
查看CRM跟踪日志显示以下内容:
System.Runtime.Serialization.SerializationException:在组件类型 'Demo.Helpers.PluginValidationException' 'Demo.DemoPlugin,版本= 1.0.0.0,文化=中性公钥= fbb51ba1e588d276' 未标记为可序列.at Microsoft.Crm.Sandbox.SandboxAppDomainHelper.Execute(IServiceEndpointNotificationService serviceBusService,IOrganizationServiceFactory organizationServiceFactory,String pluginTypeName,String pluginConfiguration,String pluginSecureConfig,IPluginExecutionContext requestContext)at …
我想通过HTML页面进行CRUD操作,而不在Dynamics CRM的webresource中添加该页面.
使用C#我们可以连接动态crm,并且可以使用CRM的dll进行/添加/编辑/删除操作,但我不知道从独立于CRM的webresource的html页面做同样的方法.
任何人都可以建议我这是否可能,如果是,那么如果有的话.