English 中文(简体)
HintPath v. Reference 视力演播室
原标题:HintPath vs ReferencePath in Visual Studio

确切地说,<代码>HintPath在.csproj文档和之间有何区别。 ReferencePath in a .csproj.user file? 我们再一次试图承诺达成一项公约,使依赖性低土地的人处于“释放”的状态,所有项目都特别释放。 由于不同的开发商拥有不同的多重结构,相对的参考资料赢得了拖拉工作,因此我们形成了一种利用环境变数的办法,该变数指特定开发商的排放量,从而形成一种绝对的参考。 因此,在添加提及之后,我们人工编辑项目文件,以改变使用环境变量的绝对道路的提法。

我已注意到,可以通过<代码>HintPath和ReferencePath来做到这一点,但我可以发现两者之间的唯一区别是:HintPath在项目装入电算法时,可在建筑时间解决,。 我并不真正确定这些影响是什么。 我注意到,VS有时重写了.csproj.user,我必须改写,但我不敢肯定会引发什么。

我听到说,最好不要在<代码>.csproj.user档案中检查,因为这一文件涉及用户,因此,我只想这样做,但我也听说,如果同一DL,例如位于项目产出目录中,那么-specised DLL isn t “guaranteed”。 这方面的任何想法?

最佳回答
问题回答

www.un.org/Depts/DGACM/index_spanish.htm 见Microsoft.Common.targets。

这个问题的答案载于您目标框架版本的<代码>Microsoft.Common.targets。

关于4.0版(和4.5 !)大会SearchPaths-element的定义类似:

    <!--
    The SearchPaths property is set to find assemblies in the following order:

        (1) Files from current project - indicated by {CandidateAssemblyFiles}
        (2) $(ReferencePath) - the reference path property, which comes from the .USER file.
        (3) The hintpath from the referenced item itself, indicated by {HintPathFromItem}.
        (4) The directory of MSBuild s "target" runtime from GetFrameworkPath.
            The "target" runtime folder is the folder of the runtime that MSBuild is a part of.
        (5) Registered assembly folders, indicated by {Registry:*,*,*}
        (6) Legacy registered assembly folders, indicated by {AssemblyFolders}
        (7) Resolve to the GAC.
        (8) Treat the reference s Include as if it were a real file name.
        (9) Look in the application s output folder (like bindebug)
    -->
<AssemblySearchPaths Condition="  $(AssemblySearchPaths)  ==   ">
  {CandidateAssemblyFiles};
  $(ReferencePath);
  {HintPathFromItem};
  {TargetFrameworkDirectory};
  {Registry:$(FrameworkRegistryBase),$(TargetFrameworkVersion),$(AssemblyFoldersSuffix)$(AssemblyFoldersExConditions)};
  {AssemblyFolders};
  {GAC};
  {RawFileName};
  $(OutDir)
</AssemblySearchPaths>

对“网络框架3.5”的定义相同,但该评论是错误的。 2.0项定义略有不同,使用(OutputPath)而不是(OutDir)美元。

在我的机器上,我有以下版本的微软文档。 共同目标:

C:WindowsMicrosoft.NETFrameworkv2.0.50727Microsoft.Common.targets
C:WindowsMicrosoft.NETFrameworkv3.5Microsoft.Common.targets
C:WindowsMicrosoft.NETFrameworkv4.0.30319Microsoft.Common.targets

C:WindowsMicrosoft.NETFramework64v2.0.50727Microsoft.Common.targets
C:WindowsMicrosoft.NETFramework64v3.5Microsoft.Common.targets
C:WindowsMicrosoft.NETFramework64v4.0.30319Microsoft.Common.targets

这是2008年、2010年和2013年视像室安装在视窗7上。

产出目录被检索的事实可能是一种微薄的疏漏(如原来的海报所示),因为它可能掩盖不正确的健康。 解决办法建立在你的当地机器之上,但当你在干净的双倍结构(例如建筑机器)的基础上发展时,便会中断。

我本人的经验是,最好坚持两种集会的提法:

  • A local assembly in the current build directory
  • An assembly in the GAC

我发现(如你所描述的)其他方法过于容易破碎,或无法满足维修要求。

我不希望全球艾滋病理事会参加的任何集会,都必须生活在执行指南中。 任何装 t或装 t的组装(由自动建筑活动管理)。

这给我带来了迄今为止的任何问题。 虽然我确信那里有工作不便的情况,但解决任何问题的通常办法是“看看看看看,看看看看GAC”。 8 D

希望帮助!





相关问题
Manually implementing high performance algorithms in .NET

As a learning experience I recently tried implementing Quicksort with 3 way partitioning in C#. Apart from needing to add an extra range check on the left/right variables before the recursive call, ...

Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How do I compare two decimals to 10 decimal places?

I m using decimal type (.net), and I want to see if two numbers are equal. But I only want to be accurate to 10 decimal places. For example take these three numbers. I want them all to be equal. 0....

Exception practices when creating a SynchronizationContext?

I m creating an STA version of the SynchronizationContext for use in Windows Workflow 4.0. I m wondering what to do about exceptions when Post-ing callbacks. The SynchronizationContext can be used ...

Show running instance in single instance application

I am building an application with C#. I managed to turn this into a single instance application by checking if the same process is already running. Process[] pname = Process.GetProcessesByName("...

How to combine DataTrigger and EventTrigger?

NOTE I have asked the related question (with an accepted answer): How to combine DataTrigger and Trigger? I think I need to combine an EventTrigger and a DataTrigger to achieve what I m after: when ...

热门标签