小编l--*_*'''的帖子

创建插件的预验证

我编写了一个包含以下配置的插件:

在此输入图像描述

我只是想将一个datetime字段设置为等于另一个datetime字段:

 IPluginExecutionContext context = localContext.PluginExecutionContext;
            IOrganizationService service = localContext.OrganizationService;

            if (context.InputParameters.Contains("Target") && context.InputParameters["Target"] is Entity)
            {
                // Obtain the target entity from the input parmameters.
                Entity entity = (Entity)context.InputParameters["Target"];
                try
                {
                    if (entity.LogicalName == "list" && entity.Attributes["gbs_lastusedonoriginal"] != null)
                    {
                        entity.Attributes["lastusedon"] = entity.Attributes["gbs_lastusedonoriginal"];
                        service.Update(entity);
                    }
                }
                catch (FaultException ex)
                {
                    throw new InvalidPluginExecutionException("An error occured in the plug-in.", ex);
                }

            }
Run Code Online (Sandbox Code Playgroud)

我得到的例外是:

未处理的异常:System.ServiceModel.FaultException`1 [[Microsoft.Xrm.Sdk.OrganizationServiceFault,Microsoft.Xrm.Sdk,Version = 6.0.0.0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35]]:插件中发生错误.Detail:
-2147220891 OperationStatus 0 SubErrorCode -2146233088插件中发生错误. …

c# microsoft-dynamics crm dynamics-crm-2011 dynamics-crm-2013

0
推荐指数
1
解决办法
6643
查看次数

如何在R或Rstudio中安装软件包

在尝试安装包时:

> install.packages("mlr")
Installing package into ‘/home/kisco/R/x86_64-pc-linux-gnu-library/3.0’
(as ‘lib’ is unspecified)
Warning in install.packages :
  dependencies ‘plyr’, ‘dplyr’, ‘lazyeval’ are not available
also installing the dependencies ‘scales’, ‘ggplot2’, ‘ggvis’, ‘reshape2’

trying URL 'http://cran.rstudio.com/src/contrib/scales_0.2.5.tar.gz'
Content type 'application/x-gzip' length 56346 bytes (55 Kb)
opened URL
==================================================
downloaded 55 Kb

trying URL 'http://cran.rstudio.com/src/contrib/ggplot2_1.0.1.tar.gz'
Content type 'application/x-gzip' length 2351203 bytes (2.2 Mb)
opened URL
==================================================
downloaded 2.2 Mb

trying URL 'http://cran.rstudio.com/src/contrib/ggvis_0.4.2.tar.gz'
Content type 'application/x-gzip' length 728345 bytes (711 Kb)
opened URL
==================================================
downloaded 711 …
Run Code Online (Sandbox Code Playgroud)

installation r package failed-installation

0
推荐指数
1
解决办法
3714
查看次数

如何模拟不断变化的课程?

我有一个XrmServiceContext类,每次CRM配置更改时它都会更改。

我的服务类在其构造函数中接受它:

public class fooService(XrmServiceContext xrmServiceContext)
{
   //implementation
}
Run Code Online (Sandbox Code Playgroud)

我需要模拟XrmServiceContext以便设置期望并验证单元测试的行为。

我如何模拟此类以便在我的fooService测试中定义行为?

c# nunit unit-testing moq dynamics-crm-2011

0
推荐指数
1
解决办法
251
查看次数

如何使用rest builder创建请求?

我已经分叉并运行了CRMRestBuilder.

在此输入图像描述

运行解决方案后,我得到了这个:

在此输入图像描述

然后我浏览了Xrm.RESTBuilder.htm,并得到以下异常:

在此输入图像描述

如何配置它以适应我的环境?我究竟做错了什么?

javascript jquery dynamics-crm dynamics-crm-2016

0
推荐指数
1
解决办法
233
查看次数

如何在blob存储中创建文件夹

我有一个文件,如Parent.zip与解压缩时,会产生这些文件:child1.jpg,child2.txt,child3.pdf.

运行Parent.zip下面的函数时,文件正确解压缩为:

some-container/child1.jpg
some-container/child2.txt
some-container/child3.pdf
Run Code Online (Sandbox Code Playgroud)

如何将文件解压缩到其父文件夹?期望的结果是:

some-container/Parent/child1.jpg
some-container/Parent/child2.txt
some-container/Parent/child3.pdf
Run Code Online (Sandbox Code Playgroud)

如上所示,文件夹Parent已创建.

我用它来创建blob中的文件:

            using (var stream = entry.Open ()) {
                //check for file or folder and update the above blob reference with actual content from stream
                if (entry.Length > 0) {
                    await blob.UploadFromStreamAsync (stream);
                }
            }
Run Code Online (Sandbox Code Playgroud)

这是完整的来源:

[FunctionName ("OnUnzipHttpTriggered")]
public static async Task<IActionResult> Run (
    [HttpTrigger (AuthorizationLevel.Function, "get", "post", Route = null)] HttpRequest req,
    ILogger log) {
    log.LogInformation ("C# …
Run Code Online (Sandbox Code Playgroud)

.net c# azure azure-storage-blobs azure-functions

0
推荐指数
1
解决办法
914
查看次数

如何在计时器触发的函数上强制执行单例行为?

我希望Azure函数查看SFTP文件夹,然后将新文件移动到其父文件夹。

我的脚手架看起来像这样。

public static class OnMoveFilesHttpTriggered
{
    [FunctionName("OnMoveFilesHttpTriggered")]
    public static void Run([TimerTrigger("0 */5 * * * *")]TimerInfo myTimer, ILogger log)
    {
        log.LogInformation($"C# Timer trigger function executed at: {DateTime.Now}");
    }
}
Run Code Online (Sandbox Code Playgroud)

我们如何强制在任何给定时间运行此函数的一个且只有一个实例?

.net c# azure azure-functions visual-studio-2017

0
推荐指数
1
解决办法
524
查看次数

如何从另一个字典中减去一个字典?

我们如何减去两个字典,得到具有差异的第三个字典?

我有一本字典Dictionary<string, int>()

+-------+----+
| alex  | 10 |
| liza  | 10 |
| harry | 20 |
+-------+----+
Run Code Online (Sandbox Code Playgroud)

从这个字典中,我想减去这个字典:

+-------+---+
| alex  | 5 |
| liza  | 4 |
| harry | 1 |
+-------+---+
Run Code Online (Sandbox Code Playgroud)

我正在寻找的结果是:

+-------+----+
| alex  |  5 |
| liza  |  6 |
| harry | 19 |
+-------+----+
Run Code Online (Sandbox Code Playgroud)

我们如何减去两个字典,得到具有差异的第三个字典?

.net c# dictionary

0
推荐指数
1
解决办法
126
查看次数

如何按名称顺序连接目录中所有文件的内容?

我有一堆文本文件,需要将它们连接成 1 个字符串:

在此输入图像描述

最终结果是内容的串联20211026_113900.sql + 20211027_083900.sql + 20211027_093900.sql

我们如何连接文件的内容以确保按字母顺序排列?

20211026_113900.sql

从 mytable1 中选择名称 GO

20211027_083900.sql

从 mytable2 GO 中选择名称

20211027_093900.sql

从 mytable3 GO 中选择名称

我期待的最终结果是:

从 mytable1 中选择名称 GO 从 mytable2 中选择名称 GO 从 mytable3 中选择名称 GO

powershell concatenation

0
推荐指数
1
解决办法
665
查看次数

如何安装实体框架核心?

我正在尝试安装以下 nuget 包:

install-package microsoft.entityframeworkcore.sqlserver

但是我遇到了这个异常:

Restoring packages for C:\Users\alex.ggg\source\repos\ccp\ccp.Rag\ccp.Rag.csproj...
install-package : NU1202: Package Microsoft.EntityFrameworkCore.SqlServer 6.0.0 is not 
compatible with netcoreapp3.1 (.NETCoreApp,Version=v3.1). Package 
Microsoft.EntityFrameworkCore.SqlServer 6.0.0 supports: net6.0 (.NETCoreApp,Version=v6.0)
At line:1 char:1
+ install-package microsoft.entityframeworkcore.sqlserver -ProjectName  ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.Powe 
   rShellCmdlets.InstallPackageCommand
 
install-package : Package restore failed. Rolling back package changes for 'ccp.Rag'.
At line:1 char:1
+ install-package microsoft.entityframeworkcore.sqlserver -ProjectName  ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
    + FullyQualifiedErrorId …
Run Code Online (Sandbox Code Playgroud)

c# entity-framework-core

0
推荐指数
1
解决办法
348
查看次数

我如何打印我的表格?

Windows.Form当用户点击按钮时,我需要打印VB.Net的图像.有这么好的方法吗?

vb.net

-1
推荐指数
1
解决办法
4万
查看次数