小编ala*_*lan的帖子

Visual Studio - 找不到页面

今天我选择了"工作项目",因为我有一百万次,但这次我在"团队资源管理器"选项卡的顶部遇到了这个错误:

"找不到页面[某些长GUID]."

这也发生在"等待变更"中.

tfs visual-studio

40
推荐指数
2
解决办法
1万
查看次数

变换后XSLT空白xmlns =""

我正在使用XSLT从一个XML标准转换到另一个XML标准.特定的XML标准包含作为命名空间一部分的根元素和作为另一个名称空间的一部分的子节点.

转换成功地反映了这些名称空间,但子项的子项现在包含空白xmlns属性.我怎么能阻止这个xmlns=""

XSLT代码段:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"
>

  <xsl:output method="xml" indent="yes"/>

  <xsl:template match="@* | node()">
    <xsl:apply-templates select="REQUEST_GROUP" />
  </xsl:template>

  <xsl:template match="REQUEST_GROUP">
    <ONCORE_ERECORD xmlns="http://test.com">
      <xsl:apply-templates select="REQUEST/PRIA_REQUEST/PACKAGE"/>
      <PAYMENT PaymentType="ACH" />
     <TRANSACTION_INFO _AgentKey="" _AgentPassword="" />
    </ONCORE_ERECORD>
 </xsl:template>

  <xsl:template match="PACKAGE">
    <DOCUMENT_RECORDATION xmlns="http://test2.org">
        <xsl:apply-templates select="PRIA_DOCUMENT"/>
    </DOCUMENT_RECORDATION>
  </xsl:template>

  <xsl:template match="PRIA_DOCUMENT">
    <PRIA_DOCUMENT _PRIAVersion="1.2">
      <xsl:attribute name="_Type">
        <xsl:value-of select="@RecordableDocumentType"/>
      </xsl:attribute>
      <xsl:attribute name="_Code"/>

  <xsl:apply-templates select="GRANTOR" />
  <xsl:apply-templates select="GRANTEE" />
  <xsl:choose>
    <xsl:when test="count(PROPERTY) = 0">
      <PROPERTY>
        <xsl:attribute name="_StreetAddress">
          <xsl:value-of select="@StreetAddress"/>
        </xsl:attribute>
        <xsl:attribute name="_StreetAddress2">
          <xsl:value-of select="@StreetAddress2"/>
        </xsl:attribute>
        <xsl:attribute name="_City"> …
Run Code Online (Sandbox Code Playgroud)

xslt transform

17
推荐指数
2
解决办法
1万
查看次数

仅当变量为nil时才分配空字符串(三元运算符)

我正在尝试实现以下C#代码的等价物:

someStringValue = someStringValue ?? string.Empty;
Run Code Online (Sandbox Code Playgroud)

if if someStringValue为null,将赋值string.Empty(空字符串"":).我如何在Objective-C中实现这一目标?是我唯一的选择:

if(!someStringValue)
   someStringValue = @"";
Run Code Online (Sandbox Code Playgroud)

解决方案感谢@Dave DeLong:

someStringValue = someStringValue ?: @"";
Run Code Online (Sandbox Code Playgroud)

cocoa-touch objective-c variable-assignment nsstring

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

"请在继续之前纠正." - Web.config错误

我尝试在本地启动一个网站项目,但在错误对话框中收到以下消息:

请在继续之前纠正.(您可以重命名当前的web.config并添加一个新的).

通常,此错误之前是对原因的一般描述,但事实并非如此.知道奇怪的,非常明显的问题,例如这些问题通常与损坏的IDE生成的文件有关.我试着删除.suo,.vssscc并从解决方案和项目目录相关的其他生成的文件,但是问题不断.

visual-studio

17
推荐指数
6
解决办法
6932
查看次数

MVC - 用户必须在IIS Recycle上重新进行身份验证

我需要一个应用程序池回收对我的Web应用程序的用户完全透明.

目前,在IIS 7应用程序池回收时,所有登录到我的Web应用程序的用户都被踢出并需要重新登录(Context.User.Identity.IsAuthenticated设置为false).我使用SQL状态服务器,我使用表单身份验证,并且都配置为使用cookie.我的印象是.NET和/或IIS处理cookie的身份验证.

但是,每次回收应用程序池时,Context.User.Identity.IsAuthenticated都设置为false(我不知道发生了什么)我的用户被踢出并需要重新登录.我可以看到会话id在整个登录期间保持不变,我也可以在数据库/状态服务器中查看此会话信息.

我不知道这是会话还是cookie问题.

请帮忙!

登录方法:

public ActionResult LogOn(string userName, string password, bool rememberMe, string returnUrl)
    {
        if (!ValidateLogOn(userName, password))
        {
            return View();
        }

        FormsAuth.SignIn(userName, true);  // uses FormsAuthentication.SetAuthCookie(username, true);
        Session["userName"] = userName;

        if (!String.IsNullOrEmpty(returnUrl))
        {
            return Redirect(returnUrl);
        }
        else
        {
            return RedirectToAction("Index", "Home");
        }
    }
Run Code Online (Sandbox Code Playgroud)

自定义控制器属性

public class CookieAuthorizeAttribute : ActionFilterAttribute
{
    public override void OnActionExecuting(ActionExecutingContext filterContext)
    {
        HttpContext lvContext = HttpContext.Current;

            if (!lvContext.User.Identity.IsAuthenticated)
            {
                lvContext.Response.Redirect("~/Account/Logon");
            }
            else
            {
                FormsIdentity identity = (FormsIdentity)HttpContext.Current.User.Identity;
                FormsAuthentication.RenewTicketIfOld(identity.Ticket);
            }

        base.OnActionExecuting(filterContext);
    }
} …
Run Code Online (Sandbox Code Playgroud)

asp.net asp.net-mvc session-state

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

WPF Stretch ListBox高度100%的Grid.Row?

我试图拉伸ListBox父网格高度的100%的高度(即父视图高度的90%); 即使listboxes是空的.我应该注意到它VerticalAlignment="Stretch"似乎不起作用,所以我已经从ListBoxStackPanel元素中删除了它.截至目前,ListBox为了容纳它所包含的项目数量,它只需要延伸.我知道行定义应该可以工作,但如果两个列表都是空的,它们都会缩小到几个像素高(与网格行一起).尽管有明确的高度声明,但有些东西会导致这些行缩小吗?

<Grid.ColumnDefinitions>
        <ColumnDefinition Width=".24*"/>
        <ColumnDefinition Width=".73*"/>
    </Grid.ColumnDefinitions>
    <Grid.RowDefinitions>
        <RowDefinition Height=".9*"/>
        <RowDefinition Height=".1*"/>
    </Grid.RowDefinitions>
    <ListBox Grid.Column="0" Grid.Row="0" Name="Subdivisions" SelectedItem="{Binding SelectedSubdivisionViewModel}" ItemsSource="{Binding Path=Subdivisions}" Grid.IsSharedSizeScope="True">
        <ListBox.ItemTemplate>
            <DataTemplate>
                <StackPanel>
                    <Border BorderBrush="#FF4788c8" BorderThickness="1,1,1,1" CornerRadius="8,8,8,8">
                        <Expander IsExpanded="{Binding IsSelected, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ListBoxItem}}}">
                            <Expander.Header>
                                <StackPanel>
                                    <Grid>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="*" SharedSizeGroup="col1" />
                                            <ColumnDefinition Width=".1*" SharedSizeGroup="col2" />
                                            <ColumnDefinition Width="*" SharedSizeGroup="col3" />
                                        </Grid.ColumnDefinitions>
                                        <Grid.RowDefinitions>
                                            <RowDefinition/>
                                            <RowDefinition/>
                                        </Grid.RowDefinitions>
                                        <TextBlock Grid.Column="0" Grid.Row="0">
                                            <TextBlock.Text>
                                                <MultiBinding StringFormat="Name: {0}">
                                                  <Binding Path="SubdivisionName" /> …
Run Code Online (Sandbox Code Playgroud)

wpf height xaml listbox expression-blend

11
推荐指数
2
解决办法
4万
查看次数

WIX 3.6安装程序 - Visual Studio 2010(HeatDirectory)

我正在为Web服务开发WIX 3.6安装程序.但是当我尝试使用HeatDirectory来获取所有必要的输出时,我遇到了一个问题,无论我尝试什么,我都会为每个收获的文件收到以下错误:

系统找不到文件'SourceDir\Some.dll ...'

错误发生在WcfService.wxs中; 奇怪的是,WcfService.wxs是由我的项目文件(下面)中的heatdirectory部分自动创建的. 如果它必须知道它们在哪里创建WcfService.wxs,它怎么会爆炸说它找不到这些.dll? 当我从我读过的任何一个教程中下载并构建一个WIX示例项目(原样)时,甚至会出现这些错误.

目标:尽可能多地自动化.dll包含(即利用收获来处理依赖项目等)

我正在运行Win 7 64位,项目是.NET 4.

Product.wxs:

    <?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <Product Id="*" Name="CompleteInstall" Language="1033" Version="1.0.0.0" Manufacturer="Technologies" UpgradeCode="b2ae6aa5-263f-4f9a-a250-8599a7f2cb03">
    <Package InstallerVersion="200" Compressed="yes" />

    <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
    <MediaTemplate />

    <Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="ProgramFiles64Folder">
        <Directory Id="CommonDir1" Name="Common Directory 1">
          <Directory Id="CommonDir2" Name="Common Directory 2">
            <Directory Id="INSTALLFOLDER" Name="Install Directory"/>
          </Directory>
        </Directory>
      </Directory>
    </Directory>

    <Feature Id="ProductFeature" Title="CompleteInstall" Level="1">
      <ComponentGroupRef Id="WcfService_Project" />
    </Feature>

    <Property Id="WIXUI_INSTALLDIR">INSTALLFOLDER</Property>
    <UIRef Id="WixUI_InstallDir" />
  </Product> …
Run Code Online (Sandbox Code Playgroud)

windows-installer wix visual-studio-2010 heat wix3.6

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

xsl:apply-template仅适用于具有特定属性值的节点

我有一个XML文档,我接受了XSLT.结构类似于:

<root>
  <item value="1">
     <object/>
  </item>
  <item value="2" />
     <object/>
  </item>
</root>
Run Code Online (Sandbox Code Playgroud)

我的目标是最终得到一个转换后的XML,类似于:

<root>
 <parent>
  <object-one value-one="1"/>
 </parent>
 <parent>
  <object-two value-two="2"/>
 </parent>
</root>
Run Code Online (Sandbox Code Playgroud)

我的XSLT类似于:

<xsl:apply-templates select="object" />


<xsl:template match="object">
    <xsl:call-template name="1" />
    <xsl:call-template name="2" />
</xsl:template>

<xsl:template name="1" match="object[item/@value = '1'">
  <xsl:element name="object-one" namespace="http://something.org">
    <xsl:attribute name="_Description">
      <xsl:value-of select="@_Type"/>
    </xsl:attribute>
    <xsl:attribute name="_Type">
      <xsl:value-of select="@_Amount"/>
   </xsl:attribute>
  </xsl:element>
</xsl:template>

 <xsl:template name="2" match="object[item/@value = '2'">
  <xsl:element name="object-two" namespace="http://something.org">
    <xsl:attribute name="OriginalAmount">
      <xsl:value-of select="@_Amount"/>
    </xsl:attribute>
  </xsl:element>
</xsl:template>
Run Code Online (Sandbox Code Playgroud)

问题是所有项目节点都应用了相同的模板.如何仅将模板应用于特定节点?

xslt transform

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

本地ASP.NET MVC突然非常慢; 加载时间> 1分钟

在过去的几周里,当浏览本地托管的ASP.NET 3.5 MVC Web应用程序(C#)时,我遇到了突然而显着的性能下降.给定页面的加载时间平均为20秒(无论内容如何); 启动通常超过一分钟.这些应用程序在生产甚至测试系统上运行得很快(测试系统与我的开发环境相当).

我正在运行IIS 6.0,VS2008,Vista Ultimate,SQL2005,.NET 3.5,MVC 1.0,我们使用VisualSVN 1.7.

我的SQL DB是本地的,IPv6似乎不是原因.我使用环回,机器名称和'localhost'在调试模式之外浏览Firefox和IE8,并且每次都得到完全相同的结果(因此DNS似乎也不是问题).

以下是我的dotTrace输出的屏幕截图.

http://www.glowfoto.com/static_image/28-100108L/3123/jpg/06/2010/img4/glowfoto

此问题使得几乎无法调试/测试任何Web应用程序.任何建议非常感谢!

解决方案: 完全重新安装Windows,IIS,Visual Studio等.它不是首选的解决方案,但它确实有效.

c# asp.net-mvc iis-6 sql-server-2005 visual-studio-2008

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

日期差异格式为天数小时分秒

有没有办法获得两个日期之间的剩余时间(差异)?

例如,我想让它返回6天,10小时,3分钟和37秒.

sql-server

9
推荐指数
1
解决办法
2万
查看次数