VS2010-使用< Import/>在安装项目之间共享属性? [英] VS2010 - Using <Import /> to share properties between setup projects?

查看:113
本文介绍了VS2010-使用< Import/>在安装项目之间共享属性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我仅复制粘贴三个属性来替换语句时,为什么它对<Import />文件不起作用?

Why doesn't it work to <Import /> this file, when it works when I replace the statement with just copy-pasting the three properties?

../../Setup.Version.proj

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <PropertyGroup>
        <InstallerMajorVersion>7</InstallerMajorVersion>
        <InstallerMinorVersion>7</InstallerMinorVersion>
        <InstallerBuildNumber>7</InstallerBuildNumber>
    </PropertyGroup>
</Project>

作品:

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <PropertyGroup>
        <InstallerMajorVersion>7</InstallerMajorVersion>
        <InstallerMinorVersion>7</InstallerMinorVersion>
        <InstallerBuildNumber>7</InstallerBuildNumber>
        <OutputName>asdf-$(InstallerMajorVersion).$(InstallerMinorVersion).$(InstallerBuildNumber)</OutputName>
        <OutputType>Package</OutputType>

不起作用:

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <Import Project="../../Setup.Version.proj" />
    <PropertyGroup>
        <OutputName>asdf-$(InstallerMajorVersion).$(InstallerMinorVersion).$(InstallerBuildNumber)</OutputName>
        <OutputType>Package</OutputType>

在这里,这些变量只是散为空字符串... :(我确定导入项目的路径是正确的.

Here the variables just evaulate to empty strings... :( I'm certain the path to the imported project is correct.

推荐答案

之所以不起作用,是因为Visual Studio已缓存了包含的文件,因此,对我所做的任何更改直到重新加载后才生效解决方案或重新启动Visual Studio.这似乎是VS 2010的局限性.重新加载VS 2010后,一切正常.

The reason it didn't work is that Visual Studio had cached the included file, so that any changes I made to it didn't take effect until I reloaded the solution or restarted Visual Studio. This seems to be a limitation of VS 2010. After reloading VS 2010, everything worked as expected.

这篇关于VS2010-使用&lt; Import/&gt;在安装项目之间共享属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆