小编Yan*_*nko的帖子

如何获取Sitecore 7.2 C#中常规链接的URL路径

我对Sitecore和C#都很陌生,过去几天我一直在努力解决问题,所以我希望你们中的一个人可以帮助我.

我刚从Sitecore 6升级到7,并且有一些变化.以下代码用于在Sitecore 6中工作,但是您获取LinkField的URL的方式已不再适用.

 protected string writeBalloon(Item targetItem)
    {
        string balloonString = "";

        Sitecore.Data.Fields.LinkField linkfield = targetItem.Fields["Link"];

        balloonString += "<a class='balloon-link' href='" + linkfield.Url + "'>";
        balloonString += "<div class='balloon'>";

        balloonString += "<h3>";
        balloonString += targetItem.Fields["Title"];
        balloonString += "</h3>";
        balloonString += "<p>";
        balloonString += targetItem.Fields["Text"];

        balloonString += "</p>";
        balloonString += "</div>";
        balloonString += "</a>";

        return balloonString;
    }
Run Code Online (Sandbox Code Playgroud)

我想我已经阅读/尝试了谷歌关于此事的所有文章,但我似乎仍然无法做到正确.

c# sitecore sitecore7 sitecore7.2

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

Azure:代理已收到关闭信号。当代理程序服务停止或手动启动的代理程序被取消时,可能会发生这种情况

构建失败并收到以下错误:

代理已收到关闭信号。当代理服务停止或手动启动的代理被取消时,可能会发生这种情况。

azure azure-devops azure-pipelines-release-pipeline

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

在WIX项目中包含修改后的FilesInUse对话框

我有一个修改过的FilesInUse对话框.只是将它包含在项目中并在UI中更改引用也没有用 - 我在构建安装项目时得到"ICE20:标准对话框:'对话表中找不到'FilesInUse'"错误.

浏览网络我发现了一条建议 - 为ICE20压制ICE验证.好吧,使用这样的设置构建项目工作正常,msi也可以正常工作,但我不确定这是一个很好的解决方案.

另一个建议是修改FilesInUse并从引用中删除WixUIExtension,但据我所知这样,我最终会将所有需要的对话框文件复制到我的项目中.这是我想避免的.

那么,可以做些什么来正确地在WIX项目中包含我的自定义FilesInUse?

wix wix-extension wix3.5

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

无法使用C#删除目录和文件

我创建了安装程序,需要删除一些文件和文件夹(如果它们已经存在)并替换为新的。

当用户单击安装时,安装程​​序会提示输入 UAC。选择“是”后,安装程序将调用删除现有文件和文件夹的方法。但它无法删除文件和文件夹。我使用的代码是 DI.Delete(path)。它给出了这个错误

Access to the path 'CodeCreate.aspx' is denied.
   at System.IO.Directory.DeleteHelper(String fullPath, String userPath, Boolean recursive)
   at System.IO.Directory.Delete(String fullPath, String userPath, Boolean recursive)
   at System.IO.DirectoryInfo.Delete(Boolean recursive)
   at CustomizationCA.CustomActions.DeleteExistingFilesAndFolder(Session session)
Run Code Online (Sandbox Code Playgroud)

如果我以管理员身份运行命令提示符,然后使用“msiexec /i Setup.msi”命令,它会删除这些文件和文件夹。

当使用 Directory.Delete(path,true); 时 我将此视为例外

Exception thrown by custom action:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Security.SecurityException: The source was not found, but some or all event logs could not be searched.  Inaccessible logs: Security.
   at System.Diagnostics.EventLog.FindSourceRegistration(String source, String machineName, Boolean …
Run Code Online (Sandbox Code Playgroud)

c# directory installation wix wix3.5

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

为什么卸载后不会删除"开始"菜单快捷方式?

当我安装.msi文件时,我在开始菜单和桌面上生成快捷方式,但是当我卸载桌面快捷方式时,会删除但是开始菜单.我的代码是吼叫.请帮我解决我的问题.我花了差不多一天的时间.

<Directory Id="ProgramMenuFolder">
   <Directory Id="ProgramMenuSubfolder" Name="Kiosk">
      <Component Id="ApplicationShortcuts" Guid="12345678-1234-1234-1234-333333333333">
         <Shortcut Id="ApplicationShortcut1" Name="Kiosk" Description="Solusoft Product" Target="[INSTALLDIR]AMP\1.0.0.0\mpkiosk.exe" WorkingDirectory="INSTALLDIR"/>
         <RegistryValue Root="HKCU" Key="Software\Kiosk" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
         <RemoveFolder Id="ApplicationShortcut1" On="uninstall"/>
      </Component>
   </Directory>
</Directory>
Run Code Online (Sandbox Code Playgroud)

windows-installer wix

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

如何在构建脚本中使用XCopy而不是在Windows中复制

之前我的dot-net项目部署到我的远程服务器,我在一个nant构建配置文件中使用了copy命令.该命令如下所示.

<target name="Deploy">
    <copy  todir="${path.to.the.directory}" overwrite="true">
        <fileset basedir="${Bin.Path}">
            <include name="*.*" />          
        </fileset>
    </copy>
</target>
Run Code Online (Sandbox Code Playgroud)

现在,当我的项目增长时,我的$ [bin.path]文件夹中有两个新文件夹,现在我无法使用复制命令将我的可执行文件复制到输出文件夹.

有人可以建议我做什么.

搜索后我发现我可以使用XCopy.但我没有得到如何将其集成到我的构建脚本中,类似于上面显示的那样.

谢谢你的帮助.

xml nant xcopy build command-prompt

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

Sitecore ECM:订阅模块

我需要将订阅表单插入CMS网页.我想重新使用已经开发的默认源代码,并在安装后附带ECM包.

在Layout/EmailCampaign文件夹中有一个用户控件:Subscription Form.ascx在OnInit方法中,他们调用另一个方法来检索一些参数.

需要身份验证,显示列表,目标受众列表等参数.

是否有人知道我在哪里定义这些参数?它们一直是空的或空的.

谢谢,

sitecore sitecore6 sitecore-ecm

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

Sitecore Web Forms for Marketers模块安装错误

我在为Intranet安装Sitecore Web Forms for Marketers模块时收到以下错误消息:

Sitecore.Exceptions.InvalidItemNameException: An item name must satisfy the pattern: ^(?=.{1,100}$)[\w\*\$][\w\s\$\-]*(\(\d{1,}\)){0,1}$ (controlled by the setting ItemNameValidation) 
  at Sitecore.Data.Items.ItemUtil.AssertItemName(String name) 
  at Sitecore.Data.Items.Item.set_Name(String value) 
  at Sitecore.Install.Items.ItemInstaller.VersionInstaller.InstallVersion(Item version) 
  at Sitecore.Install.Items.ItemInstaller.VersionInstaller.PasteVersion(XmlNode versionXml, Item target, VersionInstallMode mode, IProcessingContext context) 
  at Sitecore.Install.Items.ItemInstaller.InstallEntry(PackageEntry entry) 
  at Sitecore.Install.Items.ItemInstaller.Flush() 
  at Sitecore.Install.Items.LegacyItemUnpacker.Flush() 
  at Sitecore.Install.Framework.SinkDispatcher.Flush() 
  at Sitecore.Install.Utils.EntrySorter.Flush() 
  at Sitecore.Install.Framework.EntryBuilder.Flush() 
  at Sitecore.Install.Zip.PackageReader.Populate(ISink`1 sink) 
  at Sitecore.Install.Utils.EntrySorter.Populate(ISink`1 sink) 
  at Sitecore.Install.Installer.InstallPackage(String path, ISource`1 source, IProcessingContext context) 
  at Sitecore.Install.Installer.InstallPackage(String path, IProcessingContext context) 
  at Sitecore.Shell.Applications.Install.Dialogs.InstallPackage.InstallPackageForm.AsyncHelper.<INSTALL>b__0() 
  at Sitecore.Shell.Applications.Install.Dialogs.InstallPackage.InstallPackageForm.AsyncHelper.CatchExceptions(ThreadStart start)
Run Code Online (Sandbox Code Playgroud)

sitecore sitecore6 web-forms-for-marketers

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

从字段中获取名称/值在Sitecore 7中键入"名称查找值列表"

我正在使用Sitecore 7.1.我使用了一个字段类型 "名称查找值列表".我希望在MVC中代码后面的字段类型中存储catch名称/值.如何捕获键值项.

sitecore namevaluecollection asp.net-mvc-3 sitecore7 sitecore7.1

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

为什么 WiX 安装项目生成 wixlib 而不是 MSI?

我是 WIX 的新手,正在尝试创建 MSI 来安装服务。安装项目正在生成 .wixlib 对象而不是 msi。我正在研究这个例子

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    <!-- TODO: Put your code here. -->
<Product Name="Smart Elf Service"
       Id="*"
       UpgradeCode="927E7BBE-58C0-4832-A821-24A6B19AEE63"
       Version="1.0.0.0"
       Manufacturer="Me!"
       Language="1033">
<Package
  Manufacturer="Me!"
  InstallerVersion="100"
  Languages="1033" />
  <Directory Id="TARGETDIR" Name="SourceDir">
    <Directory Id="ProgramFilesFolder" Name="Program Files(x86)">
      <Directory Id="CorporationFolder" Name="Corporation">
        <Directory Id="SmartElfFolder" Name="SmartElf Service">
          <Component Id="SmartElfService">
            <File Id="SmartElfServiceBinary" Name="ElfVerificationService.exe" Source ="..\ElfVerificationService\bin\debug\ElfVerificationService.exe" KeyPath="yes" Vital="yes"/>
            <ServiceInstall
              Id="SI_SmartElfService"
              Vital="yes"
              Name="sesvc"
              DisplayName="SmartElf Service"
              Start="auto"
              ErrorControl="normal"
              Type="ownProcess"
            />

            <ServiceControl
              Id="SC_SmartElfService"
              Name="sesvc"
              Start="install"
              Stop="both"
              Remove="uninstall"
              Wait="yes"
            />
          </Component>
        </Directory>
      </Directory> …
Run Code Online (Sandbox Code Playgroud)

windows-installer wix visual-studio-2012

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

使用PHP和JQUERY对网站构建器进行编码

我正在寻找可以帮助我理解如何创建网站构建器的建议,参考资料和文章.我的用户将选择一个模板,然后在类似于WIX.com的编辑器中进行编辑.我有兴趣为他们提供具有类似功能的平台.

如果有任何可用的文章或资源可以让我了解应用程序的优缺点.

再次感谢你的帮助.

php builder

-2
推荐指数
1
解决办法
965
查看次数