我真的需要更多关于造成这种情况的想法,目前它正在推动我的发展.
我有一个Xaml用户控件,其中包含另一个用户控件,如下所示:
<UserControl x:Class="MyModule.View.MainView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:igDock="http://infragistics.com/DockManager"
xmlns:views="clr-namespace:MyModule.View"
>
<StackPanel x:Name="panel">
<views:MyHeaderView/>
<igDock:XamDockManager x:Name="dockingManager"/>
</StackPanel>
</UserControl>
Run Code Online (Sandbox Code Playgroud)
这是在Prism模块中(因此是MyModule名称),但我不认为这是特别不寻常的.
现在,只要我在标题视图中添加名称,代码就无法编译,例如
<views:MyHeaderView x:Name="header"/>Run Code Online (Sandbox Code Playgroud)
我得到的错误很简单:
"The type name 'View' does not exist in the type MyModule.MyModule'"
我已经尝试将包含的用户控件移动到另一个命名空间,创建一个空白的用户控件并尝试使用它(相同的结果)并删除XamDockManager,但似乎没有任何区别.
任何人都可以对此有所了解吗?
我一直在尝试使用WCF创建一个相对简单的自托管RESTful服务,但我想添加自定义身份验证.为此,我试图重写UserNamePasswordValidator.不幸的是,虽然这被称为验证用户名/密码组合,但如果用户名/密码没有通过,服务器将返回403 Forbidden,而不是401 Unauthorized,正如我所期望的那样.这将导致一个大问题,因为如果用户第一次无法进行身份验证,除非他们重新启动浏览器,否则不会再次提示他们输入凭据.那么,我做错了什么?
这是我到目前为止:
(实际ServiceContract包含一个返回字符串的方法)
class Program
{
static void Main(string[] args)
{
WebServiceHost host = null;
try
{
host = new WebServiceHost(typeof (MyService));
const string uri = "http://127.0.0.1/MyService";
var wb = new WebHttpBinding
{
Security =
{
Mode = WebHttpSecurityMode.TransportCredentialOnly,
Transport = {ClientCredentialType = HttpClientCredentialType.Basic}
}
};
var ep = host.AddServiceEndpoint(typeof (IMyService), wb, uri);
host.Credentials.UserNameAuthentication.UserNamePasswordValidationMode = UserNamePasswordValidationMode.Custom;
host.Credentials.UserNameAuthentication.CustomUserNamePasswordValidator = new PasswordValidator();
host.Open();
Console.WriteLine("Press any key to terminate");
Console.ReadKey();
}
finally
{
if (host != null) …Run Code Online (Sandbox Code Playgroud) 一个警告开始 - 我实际上不知道我想做什么是可能的,特别是因为我不熟悉LDAP/Active Directory或JIRA.
我正在尝试将我闪亮的JIRA新安装与我现有的活动目录集成.我想要做的是设置一些特定的JIRA组(例如在London\Security Groups\JIRA*中),然后让JIRA只导入拥有这些组成员资格的用户.但是,在JIRA的目录设置页面中,我不明白该怎么做.这似乎表明,我可以导入用户和组,而不是用户从组.
我错过了什么?(除了AD的专家级知识!)
更新
在我的域名下,我有一个像这样的组织结构:
London\Users
London\Security Groups\JIRA
&(objectCategory=Person)(sAMAccountName=*)"memberof=CN=jira-users,ou=London,ou=Security Groups,ou=JIRA,dc=mycompany,dc=local
在后一个组织单位下,我有一个名为"jira-users"的安全组.前者包含所有用户.
到目前为止,我已经尝试了以下查询,但没有一个有效:
(所有前缀memberof=CN=JIRA,ou=London,ou=Security Groups,dc=mycompany,dc=local)
&(objectCategory=Person)"
memberof=CN=jira-users,ou=London,ou=Security Groups,ou=JIRA,dc=mycompany,dc=local
(以前缀为前缀memberof=CN=jira-users,OU=JIRA,OU=Security Groups,OU=London,DC=mycompany,DC=local)
(&(objectCategory=Person)(memberof=CN=jira-users,OU=JIRA,OU=Security Groups,OU=London,DC=mycomapny,DC=local))
已完成
有效的查询是这样的:
London\Users
London\Security Groups\JIRA
我没有意识到,对于逻辑上从左到右,London\Security Groups\JIRA的文件夹结构,组织单元需要以相反的顺序列出.
进一步更新
这仅在出于某种原因使用DirectorySearcher类时才有效,例如
DirectoryEntry rootEntry = new DirectoryEntry("LDAP://dc=mycompany,dc=local");
DirectorySearcher srch = new DirectorySearcher(rootEntry);
srch.SearchScope = SearchScope.Subtree;
srch.Filter = "(&(objectCategory=Person)(sAMAccountName=*)(memberof=CN=jira-users,ou=London,ou=Security Groups,ou=JIRA,dc=mycompany,dc=local))";
SearchResultCollection results = srch.FindAll();
Run Code Online (Sandbox Code Playgroud)
这不适用于LDAP资源管理器工具,也不适用于JIRA本身.
最后更新
所以......对于JIRA,你需要颠倒顺序并删除通配符.最后的工作查询是:
&(objectCategory=Person)(sAMAccountName=*)"
我正在使用SSRS Web服务生成HTML4.0格式报告,然后我尝试使用System.Net.Mail发送它们(我知道SSRS内置报告调度,但我们需要处理所有预定的进程在一个中心位置).所以,我正在生成html文件,然后尝试构造这样的邮件消息:
using (var sw = new StreamReader(htmlFile))
{
mail_body = sw.ReadToEnd();
}
var mail = new MailMessage
{
From = new MailAddress(mail_from),
Subject = mail_subject,
IsBodyHtml = true,
Body = mail_body
};
Run Code Online (Sandbox Code Playgroud)
唯一的问题是,当我这样做时,虽然我在浏览器中打开它时html文件看起来很好,但在Outlook中它最终会被横向压扁.
这就是我的html文件在IE中的样子:

但是当我使用上面的方法发送电子邮件后,在Outlook中它最终看起来像这样:

看起来似乎有某种线宽限制,但我不确定这种情况发生在什么程度.
有没有人对可能导致这种情况的原因有任何见解?
谢谢!