gpt4 book ai didi

TFS - 错误 : "The type or namespace name ' blabla' does not exist in the namespace 'blublu' (are you missing an assembly reference? )

转载 作者:行者123 更新时间:2023-12-04 16:53:18 25 4
gpt4 key购买 nike

我有一个问题,不幸的是我没有找到可以解决我的问题的解决方案,可以找到其他解决方案,但没有人适合我。

当我在本地构建我的解决方案时,一切都很完美,但是当我使用此解决方案启动构建定义时,我遇到了一些问题。
首先是几个错误,例如:

 Console.cs (5): The type or namespace name 'Core' does not exist in the namespace 'Toto' (are you missing an assembly reference?)
Enti\Extensions.cs (602): The type or namespace name 'Attribute' could not be found (are you missing a using directive or an assembly reference?)

和其他与上一个相同的错误。

为了帮助我,我也有这些警告,以下是其中之一(其他类似):
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets (1605): Could not resolve this reference. Could not locate the assembly "Comarch.B2.Core". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.

我试过的:
  • 例如,诸如“Core”之类的引用文献都很好地放在了
    项目引用;
  • 删除和添加警告引用
  • 检查版本 Framework dotNET 路径长度
    ( http://www.gitshah.com/2011/06/visual-studio-2010-fixing-referenced.html )

  • 例如上面的第一个错误:
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using .Core.Interfaces.Dictionaries;

    namespace Toto.Presentation.Extensions.Interfaces
    {
    public class Console
    {
    ...
    }
    }

    然后是我的 LOG 的一个片段:
    >  C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets(1605,5):
    > warning MSB3245: Could not resolve this reference. Could not locate
    > the assembly "Common". Check to make sure the assembly exists on disk.
    > If this reference is required by your code, you may get compilation
    > errors.
    > [c:\bw\41\src\F\TFS\te\Pro\Extensions\Toto.Presentation.Extensions.Interfaces\Toto.Presentation.Extensions.Interfaces.csproj]
    > For SearchPath "{HintPathFromItem}".
    > Considered "..\..\..\..\..\..\..\..\..\..\Toto.Common.dll", but it didn't exist.
    > For SearchPath "{TargetFrameworkDirectory}".
    > Considered "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Toto.Common.winmd",
    > but it didn't exist.
    > Considered "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Toto.Common.dll",
    > but it didn't exist.
    > Considered "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Toto.Common.exe",
    > but it didn't exist.

    非常感谢你帮助我,我前两天纠结了。

    最佳答案

    要解决此错误,您需要确保此程序集将存在于构建代理的正确路径中。

    在您的项目的 .csproj 文件中,它定义了您引用的项目及其所在的位置。

    <Reference Include="xxx">
    <HintPath>..\..\xxx\xxx.dll</HintPath>
    </Reference>

    在您的项目中,HintPath 似乎是 "..\..\..\..\..\..\..\..\..\..\Toto.Common.dll" .您可以检查您的构建代理服务器,是否下载了此 dll。如果没有,请查看 存储库映射 您的构建定义。
    "..\"表示返回上一级。它有 10 "..\" ,因此需要从 .csproj 文件所在的位置返回到 10 个级别。

    我建议您重新定位您的 Toto.Common.dll。您可以将您的项目/解决方案和引用的 dll 放在一个文件夹中,然后在您的项目中再次引用使用。然后在存储库映射中,映射此文件夹。另一个条件是您想在另一个项目构建后获取此 dll。您需要映射这两个项目并在您的定义中构建它们。

    关于TFS - 错误 : "The type or namespace name ' blabla' does not exist in the namespace 'blublu' (are you missing an assembly reference? ),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43386245/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com