从Visual Studio构建依赖项

时间:2011-09-16 14:44:14

标签: visual-studio-2010 msbuild build

将新项目添加到大型解决方案后,我收到错误,表明构建不正确。一直依靠Visual Studio来实现它,我将非常感谢您的帮助。

以下是配置管理器中的图片。最后的项目(Parties.Presentation.Wpf)依赖于名为“Core.Presentation.Wpf”的程序集,如下面的代码所示:

using Smack.Core.Presentation.Wpf.Services;
using Smack.Parties.Presentation.ViewModels.PimVms;

namespace Smack.Parties.Presentation.Wpf.ApplicationControl
{
    public class PimVisualizerService : WpfUiVisualizerService
    {

        public PimVisualizerService(WpfTypeRegistrationService registrationServiceService)
            : base(registrationServiceService) { _registrationService.Register<PimShellVm>("blah"); }

    }
}

不确定它是否都是R#,但在我尝试构建之前,没有指出错误,我可以导航到Core程序集中的基类。

但是我无法构建它,我收到了这个错误:

Error   1   The type or namespace name 'Core' does not exist in the namespace 'Smack' (are you missing an assembly reference?)  
C:\Users\L&M\Documents\Projects\Smack\trunk\src\Parties.Presentation.Wpf\ApplicationControl\PimVisualizerService.cs 1   13  
Parties.Presentation.Wpf

这是构建依赖问题吗?我该如何解决?

干杯,
Berryl

enter image description here

更新

好的,根据the last answer to this question,从'MixedPlatforms'更改为'AnyCPU'让我再次构建。

我会稍微开放一下,看看是否有人拥有比我更多的构建经验,这可能是一个黑客或正确的事情。我很好奇为什么WPF项目首先默认为x86。

1 个答案:

答案 0 :(得分:0)

如果您有实际(非偶然)x86依赖关系并尝试在x64上运行它,那么构建'任何CPU'就会中断。它可能默认为'x86',因为它是/是最常见的平台目标。

不幸的是,没有一种零维护方法来解决这个问题。因为出于依赖性原因,我要向公司客户发送的工作被强制为'x86',我将从.csproj文件中删除'Any CPU'配置,并确保默认设置为'x86 ',但添加一个新项目将有一个'任何CPU'配置,解决方案将翻转到'混合平台',解决方案中设置'任何CPU'和'x86'。