--更新以提供完整的工人阶级示例,以及 2 个示例文档--
www.sklinar.co.uk/wp-content/uploads/mydoc.docx - 原始文档,带有 INCLUDETEXT 指令以合并到 Footer.Docx 中
www.sklinar.co.uk/wp-content/uploads/footer.docx
我已将 a 添加ImagePart
到我的文档中,并使用FeedData()
它来提供流内容。
但我能在我的文档中看到的只是一个红色框。
我的初始代码创建 aRun
并将 aDrawing
作为它的子项:
--对于这个例子,我使用了硬编码的 FileStream 来清除可疑的图像--
为了使其正常工作,我每次都使用相同的页脚,并且当前使用正确的页脚进行硬编码:
runToAmend.InsertAfterSelf(CreateImageRun(sourceDocument,run,target.MainDocumentPart.FooterParts.ElementAt(2)));
是runToAmend
从当前文档中的运行中获取的 - 它包含一个字段,然后将其删除,并将图片(以及从另一个文档中获取的其他文本)放置在其位置。
public Run CreateImageRun(WordprocessingDocument sourceDoc, Run sourceRunFromOriginalDocument, FooterPart footerPart)
{
ImageData shape = sourceRun.Descendants<ImageData>().FirstOrDefault();
ImagePart p = sourceDoc.MainDocumentPart.GetPartById(shape.RelationshipId) as ImagePart;
ImagePart newPart = footerPart.AddImagePart(ImagePartType.Jpeg);
using (Stream stream = new FileStream(@"C:\Users\SAS\Desktop\IMG_20130803_104521.jpg",FileMode.Open,FileAccess.Read))
{
stream.Position = 0;
newPart.FeedData(stream);
}
string partId = footerPart.GetIdOfPart(newPart);
Drawing newImage = CreateImage(partId);
return …
Run Code Online (Sandbox Code Playgroud) 有没有IIS Advanced Logger的经验?
我已将其设置为与 Application Insights 一起使用,但无法访问性能计数器。http://blogs.microsoft.co.il/idof/2013/08/20/fixing-iis-advanced-logging-performance-counters-errors/,但建议将用户添加到正确的用户组,而不是有用。
我们使用自定义应用程序 ID (IISServiceUser),它现在具有权限。但仍然出现以下错误。
Failed to initialize performance counter \Process(w3wp)\Private Bytes. Data for this performance counter data will not be recorded until the counter is available. PdhCollectQueryData: 0x0X800007D5.
Run Code Online (Sandbox Code Playgroud)
想法??
我正在尝试Console.WriteLine(..)
在Docker日志中获取日志输出(),但利用率为零。
我试过了:
Console.WriteLine(..)
Trace.WriteLine(..)
冲洗控制台,冲洗轨迹。
调试时,我可以在VS输出窗口中看到这些输出,因此它们会放在一起。
我在Windows Container上,使用microsoft/aspnet:4.7.1-windowsservercore-1709
和net4.7
这些是我在容器启动时获得的日志
docker logs -f exportapi
ERROR ( message:Cannot find requested collection element. )
Applied configuration changes to section "system.applicationHost/applicationPools" for "MACHINE/WEBROOT/APPHOST" at configuration commit path "MACHINE/WEBROOT/APPHOST"
Run Code Online (Sandbox Code Playgroud) 如何自动提取Fluently.自动配置与DB的连接?
我们的设置详述如下.
我们有以下静态方法来创建会话工厂:
public static ISessionFactory CreateSessionFactory()
{
return Fluently.Configure()
.Database(
IfxOdbcConfiguration
.Informix
.ConnectionString("DSN=ODBCCONNECTION")
.Driver<CompanyCore.Nhibernate.Core.ProfiledODBCClientDriver>()
.Dialect<InformixDialect1000>()
.ShowSql()
)
.Mappings(
m => m.FluentMappings.AddFromAssemblyOf<Task>()
)
.BuildSessionFactory();
}
Run Code Online (Sandbox Code Playgroud)
这与我们的IOC设置一起用于创建SessionFactory,但是,由于我们的数据库团队需要,每个用户必须打开他/她自己的连接作为他们的用户(使用非个性化) - 允许进程识别,看谁正在运行Informix服务器上的内容.
要创建我们使用的各个连接:
public static ISession GetMySession(ISessionFactory factory, string user)
{
CompanyCore.Nhibernate.Core.ProfiledODBCClientDriver drv = new Enact.Nhibernate.Core.ProfiledODBCClientDriver();
drv.Configure(new Dictionary<string, string>());
string conn = "DSN=ODBCCONNECTION";
IDbConnection db = drv.CreateConnection();
db.ConnectionString = conn;
db.Open();
return factory.OpenSession(db);
}
Run Code Online (Sandbox Code Playgroud)
当我们的UOW呼叫处理时,这些连接关闭.
我们调用CreateSessionFactory()
APP Start然后通过IOC传递此工厂,但此时没有非个性化用户,因此在首次加载时会导致应用程序错误.
我们已经考虑过使用标准用户可以访问首次加载等内容,但肯定有更好的方法吗?
nhibernate informix inversion-of-control unity-container fluent-nhibernate
我们有INCLUDETEXT
基于客户的条件页脚:
IF $CLIENT = "CLIENT1" "{INCLUDETEXT "CLIENT1HEADER.DOCX"}" ""
根据我们的文档,可能会有不同数量的IF/ELSE
,并且这些都可以正常工作以将正确的文件合并到正确的位置。
但是,其中一些文档可能具有客户特定的图像/品牌,也需要从INCLUDETEXT
文件中复制。
下面是被调用以替换从源文档复制到目标文档Picture
中存在的任何元素的方法IEnumerable<Run>
。
图像复制得很好,但是它似乎没有更新我的 RIDPicture
或将记录添加到 .XML.Rels 文件中。(我什至尝试添加一个ForEach
来添加到所有页眉和页脚,看看这是否有什么不同。
private void InsertImagesFromOldDocToNewDoc(WordprocessingDocument source, WordprocessingDocument target, IEnumerable<Picture> pics)
{
IEnumerable<Picture> imageElements = source.MainDocumentPart.Document.Descendants<Run>().Where(x => x.Descendants<Picture>().FirstOrDefault() != null).Select(x => x.Descendants<Picture>().FirstOrDefault());
foreach (Picture pic in pics) //the new pics
{
Picture oldPic = imageElements.Where(x => x.Equals(pic)).FirstOrDefault();
if (oldPic != null)
{
string imageId = "";
ImageData shape = oldPic.Descendants<ImageData>().FirstOrDefault();
ImagePart p = source.MainDocumentPart.GetPartById(shape.RelationshipId) …
Run Code Online (Sandbox Code Playgroud) 我们目前已将我们的代码发布到Production,因此已经削减和分支以确保我们可以支持我们当前的版本,同时仍然支持热修复而不会破坏当前版本的任何正在进行的开发.
这是我们目前的结构:
Project-
/Development
/RC1
Run Code Online (Sandbox Code Playgroud)
直到最近使用八达通,我们有以下过程:
Dev->Staging/Dev Test->UAT
Run Code Online (Sandbox Code Playgroud)
哪个工作正常,因为我们没有实际版本.
我的问题是八达通如何支持我们的新工作方式?
我们是否在Octopus中创建了一个名为RC1的新/克隆项目,并将RC1分支中的CI添加到其中?然后添加/删除适当的RC不再需要?
还是有另一种我们明显错过的方法吗?
我正在尝试从powershell在Azure中创建一个新的Web应用程序服务,但遇到以下错误:
New-AzureRmResourceGroup : 'this.Client.SubscriptionId' cannot be null.
$webAppName = "powershelldemowebapp"
$ResourceGroupName = "PowerShellResourceGroup"
$Location = "East Asia"
Login-AzureRmAccount -ServicePrincipal -Tenant 000000-0000-0000-0000-00000 -Credential $psCred
Get-AzureSubscription
Select-AzureSubscription -SubscriptionId 00000-0000-0000-000-0000
New-AzureRmWebApp -Name $webAppName -ResourceGroupName $ResourceGroupName -Location $Location
Run Code Online (Sandbox Code Playgroud) 我正在使用Repo模式,并且已经设置了测试以复制传入的HTTP请求,并在测试完成后立即处理工作单元。
看来,在执行HQL语句之后,再调用displose(依次调用flush)之后,会导致各个元素之间的更新。
非常奇怪-之前有人遇到过吗?
这是我的HQL语句及其执行:
_session.CreateQuery("select distinct t from TaskEntity as t").List<T>()
Run Code Online (Sandbox Code Playgroud)
我将其恢复为最简单的形式-请注意,HQL语句并不直接位于CreateQuery中。
这是我得到的堆栈跟踪:
一世
BM.Data.Informix.IfxParameterCollection.b(Int32 A_0)
IBM.Data.Informix.IfxParameterCollection.GetParameter(Int32 index)
System.Data.Common.DbParameterCollection.System.Collections.IList.get_Item(Int32 index)
NHibernate.Type.Int32Type.Set(IDbCommand rs, Object value, Int32 index)
NHibernate.Type.NullableType.NullSafeSet(IDbCommand cmd, Object value, Int32 index)
NHibernate.Type.NullableType.NullSafeSet(IDbCommand st, Object value, Int32 index, ISessionImplementor session)
NHibernate.Persister.Entity.AbstractEntityPersister.Dehydrate(Object id, Object[] fields, Object rowId, Boolean[] includeProperty, Boolean[][] includeColumns, Int32 table, IDbCommand statement, ISessionImplementor session, Int32 index)
NHibernate.Persister.Entity.AbstractEntityPersister.Update(Object id, Object[] fields, Object[] oldFields, Object rowId, Boolean[] includeProperty, Int32 j, Object oldVersion, Object obj, SqlCommandInfo sql, ISessionImplementor session)
NHibernate.Persister.Entity.AbstractEntityPersister.UpdateOrInsert(Object id, …
Run Code Online (Sandbox Code Playgroud) 我只是想知道是否有人能够对这个问题给出具体的答案.
我们刚刚将TFS安装到开发服务器,并且为了正确构建我们的Web项目,我们还需要在那里安装VS2010的副本(如MS所述).
有谁知道MSDN许可证是否会覆盖它,因为它不是"生产"机器?
谢谢
我收到带有对象的数据/数组.每个对象都有国家 - 城市和商店(在那个城市).
例如:
意大利 - 罗马 - shopXY
var data = [
{country: "Italy", city: "Milan", shop: "shop123"},
{country: "Italy", city: "Rome", shop: "shop2"},
{country: "USA", city: "Los Angeles", shop: "shopXY"}
]
Run Code Online (Sandbox Code Playgroud)我有3列,我想只展示一次意大利,然后当我点击它时,我展示米兰和罗马,然后根据我是否点击罗马或米兰相应的商店.
以下是好的做法:
我试图研究,但真的找不到任何东西,即使有人只是有一些提示,这将是伟大的,因为我完全失去了.谢谢!!!!
PS.我不想使用任何过滤器库,因为我自己尝试这样做.
c# ×2
nhibernate ×2
openxml ×2
openxml-sdk ×2
alm ×1
asp.net ×1
azure ×1
docker ×1
iis ×1
iis-10 ×1
informix ×1
javascript ×1
licensing ×1
mailmerge ×1
ms-office ×1
obsolete ×1
performance ×1
powershell ×1
reactjs ×1
release ×1
tfs ×1
tfs2013 ×1
wordml ×1