小编Mas*_*low的帖子

是否可以在Github上提供ClickOnce安装程序?

我想知道您是否可以为项目创建ClickOnce安装程序,然后在GitHub上托管安装文件夹(通过下载页面)?

我猜默认ClickOnce将安装文件发布到一个子文件夹,我认为Github下载页面不支持该子文件夹,但也许有另一种方式.

.net clickonce github

14
推荐指数
2
解决办法
2744
查看次数

导入另一个msbuild文件时,评估的顺序是什么?

我有一个共享的属性文件 shared.properties.proj

<Project  xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <SharedAssemblySearch>$(MSBuildProjectDirectory)\..\Shared Assemblies</SharedAssemblySearch>
    <ParentDir>..</ParentDir>
    <SharedAssemblySearch Condition="!Exists('$(SharedAssemblySearch)')">$(ParentDir)\$(SharedAssemblySearch)</SharedAssemblySearch>
    <SharedAssemblySearch Condition="!Exists('$(SharedAssemblySearch)')">$(ParentDir)\$(SharedAssemblySearch)</SharedAssemblySearch>
    <SharedAssemblySearch Condition="!Exists('$(SharedAssemblySearch)')">$(ParentDir)\$(SharedAssemblySearch)</SharedAssemblySearch>
    <SharedAssemblySearch Condition="!Exists('$(SharedAssemblySearch)')">$(ParentDir)\$(SharedAssemblySearch)</SharedAssemblySearch>
    <SharedAssemblySearch Condition="!Exists('$(SharedAssemblySearch)')">$(ParentDir)\$(SharedAssemblySearch)</SharedAssemblySearch>
    <SharedAssemblySearch Condition="!Exists('$(SharedAssemblySearch)')">$(ParentDir)\$(SharedAssemblySearch)</SharedAssemblySearch>
    <SharedAssemblyPath Condition="Exists('$(SharedAssemblySearch)')">$(SharedAssemblySearch)</SharedAssemblyPath>
    <SharedAssemblySearch Condition="!Exists('$(SharedAssemblySearch)')">..\SharedAssemblies</SharedAssemblySearch>
    <SharedAssemblySearch Condition="!Exists('$(SharedAssemblySearch)')">$(ParentDir)\$(SharedAssemblySearch)</SharedAssemblySearch>
    <SharedAssemblySearch Condition="!Exists('$(SharedAssemblySearch)')">$(ParentDir)\$(SharedAssemblySearch)</SharedAssemblySearch>
    <SharedAssemblySearch Condition="!Exists('$(SharedAssemblySearch)')">$(ParentDir)\$(SharedAssemblySearch)</SharedAssemblySearch>
    <SharedAssemblySearch Condition="!Exists('$(SharedAssemblySearch)')">$(ParentDir)\$(SharedAssemblySearch)</SharedAssemblySearch>
    <SharedAssemblyPath Condition="Exists('$(SharedAssemblySearch)')">$(SharedAssemblySearch)</SharedAssemblyPath>
 </PropertyGroup>
</project>
Run Code Online (Sandbox Code Playgroud)

我正在搜索任何级别的父目录包含名为的目录Shared Assemblies.或者SharedAssemblies

我想将此代码放在sln的中心位置,以便所有项目都可以导入它.sln中的项目并非都处于同一层次结构中.

样品 .csproj

    <?xml version="1.0" encoding="utf-8"?>
    <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Shared.Properties.proj))\Shared.Properties.proj"
   Condition=" '$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Shared.Properties.proj))' != '' "/>
    <ItemGroup>
    <Reference Include="EntityFramework">
      <HintPath>$(SharedAssemblyPath)\NuGet\EntityFramework.4.3.0\lib\net40\EntityFramework.dll</HintPath>
     </Reference>
    </ItemGroup>
  <Target Name="CheckReferencePaths" BeforeTargets="ResolveAssemblyReferences">
    <Message Importance="high" Text="Doing CheckReferencePaths" />
    <ItemGroup>
     <SharedAssemblyPathItem Include="$(SharedAssemblyPath)" />
    </ItemGroup>
    <Warning …
Run Code Online (Sandbox Code Playgroud)

msbuild-propertygroup msbuild-4.0

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

在使用模糊类型时,如何使用Visual Studio调试器的程序集名称限定.NET类型以消除歧义?

我正在使用VS调试器的"立即窗口"来调用类上的静态API,该类是在2个不同的程序集中定义的模糊类型.

调用失败,出现以下消息:类型foo中都存在blah.dll,并bar.dll

这个消息很有意义,因为确实如此.我的问题是如何在调试器中解决这个问题,以指定我想用于绑定此类型的程序集?

有没有办法用它定义的程序集名称限定类型?

谢谢Bhavin.

debugging visual-studio

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

你如何让System.Web.Script.javascriptSerializer忽略一个属性?

[Serializable]
public class ModelResource:ISerializable
{
   public Int64 Ore { get; private set; }
   public Int64 Crystal { get; private set; }
   public Int64 Hydrogen { get; private set; }
   //needs to be ignored
   public Int64 Total { get { return Ore + Hydrogen + Crystal; } }
   public string ResourceType { get; private set; }
   public Int64 HerculesNeeded { get { return Total / 25000; } }
   public Int64 AtlasNeeded { get { return Total / 5000; } }

   public …
Run Code Online (Sandbox Code Playgroud)

c# serialization javascriptserializer

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

看起来正面消极的看后面前瞻

搜索在谷歌所有vsvim前瞻或回顾后,并在之后的wiki,我似乎无法弄清楚如何,或者如果它甚至支持前瞻或回顾后(阳性或阴性),以及如何如果是使用它们.

我已经尝试了几种不同的语法一样\ze \@= (?<=let \w\+)( \(?<=let \w\+\)(,我已经看到了vim的答案,但他们都不是工作在VS vim的匹配问题(也没有替代)

你怎么看VsVim的外观?

vsvim

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

选择TD的文本包含foo的任何TR

我很确定这可以在不进入函数的情况下完成,但我想抓住任何TR,其中有一个<td>Mail ...</td><td>Foo ... </td>作为示例.

我一直认为应该是这样的

$('tr[./text()^="foo"]')但铬不喜欢它.或者$('tr[./td/text()^="Mail"]')但是没有运气可以通过一个简单的选择器来完成?

jquery-selectors

10
推荐指数
2
解决办法
3万
查看次数

你能用MEF水合静电吗?

我可以在类的静态构造函数中加水吗?

public class Connect:IDTExtensibility2, IDTCommandTarget
  static Connect()
    {
        //hydrate static properties?
    }
    [Import]
    public static Action<ProjectLogicChecks> Display { get; set; }

[Export(typeof(Action<ProjectLogicChecks>))]
    private static void DisplayResults( CheckProcesses _checkResults)
{
    MessageBox.Show(_checkResults.ProjectLogicCheck.AssemblyName + " has problems=" +
                    _checkResults.ProjectLogicCheck.HasProblems);
}
Run Code Online (Sandbox Code Playgroud)

.net static-methods mef

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

如何在bash中测试字符串是否以另一个字符串开头?

非常相似但不重复:https://stackoverflow.com/a/2172367/57883

我在Git Bash 3.1中(至少那是当我在git bash中键入bash时出现的提示.

$ test [["DEV-0" == D*]] || echo 'fail'打印失败.

if [['DEV-0-1' == DEV* ]]; then echo "yes";[[DEV-0-1: command not found 我试图测试是否git branch返回以DEV开头的东西.但我似乎无法应用答案.是因为我所有的尝试都在左边使用字符串文字而不是变量值?

我也在ideone http://ideone.com/3IyEND上尝试过它

没有运气 自从我提出linux提示以来已经有14年了.

我在字符串中缺少的是什么?

bash git-bash

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

如何将MSB3245(无法解析引用)警告视为错误?

我的问题是基于另一个问题,但我想做相反的事情:告诉msbuild将警告视为错误,而不是抑制特定的msbuild警告.

但是,到目前为止我所看到的/p:WarningsAsErrors只是说csc警告和错误.我试着放弃MSB和谷歌搜索可能会在那里工作的数字,但没有运气.

有没有办法将msbuild(命令行)中的"未找到程序集引用"警告视为错误?

msbuild

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

将光标设置到textarea中特定行的特定位置

我试图在某种程度上复制Microsoft Office的Outlook等程序中出现的"自动更正"功能.

对于初学者,只要用户在一行的开头键入"a"(字母a和空格),我想将该文本更改为"*Agent ["

如果你在textarea中从上到下打字,我写下面的内容可以正常工作.但是,如果您在textarea中的任何其他位置键入文本,则会更改文本,然后光标移动到textarea的末尾.

我希望光标始终放在更改文本的末尾.

我有变量中的行号,currentLineNumber我知道光标需要在该行的第8个字符之后,但我不确定如何告诉它去那里

理想情况下喜欢喜欢的东西

function setCursor(row, position) {
 //.... code to set cursor 
}
Run Code Online (Sandbox Code Playgroud)

我该怎么做才能做到这一点?我对javascript或jQuery解决方案持开放态度(虽然我发现jQuery有点难以阅读和理解)

如果有更好的方法来实现我的整体需求,我也会对此持开放态度.

如果你不明白这个问题,这里有一个jsFiddle

javascript jquery textarea cursor textselection

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