質問

私は、ビルドのリリースのためのNAntを使用してに慣れますよ。しかし、私はasp.net MVCを使用し始めている、と私の選択肢は.vdprojとインストールのためのセットアップを行います。

しかし、私は呼び出すとき:     

< exec program="${dotnet.dir}/msbuild.exe" commandline='"./Wum.sln" /v:q /nologo /p:Configuration=Release' />

NAntの中で、私の結果は次のとおりです。     

[exec] D:\My Documents\Visual Studio 2008\Projects\Wum\Wum.sln : warning MS
B4078: The project file "Wum.Setup\Wum.Setup.vdproj" is not supported by MSBuild
and cannot be built.

誰かがいくつかの手がかり、またはソリューションがありますか?

私はdevenvをを使用している場合は、

、私は問題があるでしょうか?

役に立ちましたか?

解決

MSBuildのは.vdprojプロジェクトをビルドすることはできません。あなたは、このためのVisual Studio(devenv.com)を使用する必要があります。

他のヒント

ここでは、私はMSBuildのファイルを.vdprojしないだろうと最近devenvを使用してこれをしたかです。この記事では、実際に最初の.vdprojファイルの更新を手伝ってくれました: http://www.hanselman.com/blog /BuildingMSIFilesFromNAntAndUpdatingTheVDProjsVersionInformationAndOtherSinsOnTuesday.aspxする

<target name="someTarget">
    <!-- full path to setup project and project file (MSI -> vdproj) -->
    <property name="DeploymentProjectPath" value="fullPath\proj.vdproj" />
    <!-- full path to source project and project file (EXE -> csproj) -->
    <property name="DependencyProject" value="fullPath\proj.csproj" />
    <script language="C#">
    <code>
      <![CDATA[
        public static void ScriptMain(Project project)
        {
            //Purpose of script: load the .vdproj file, replace ProductCode and PackageCode with new guids, and ProductVersion with 1.0.SnvRevisionNo., write over .vdproj file

            string setupFileName = project.Properties["DeploymentProjectPath"];
            string productVersion = string.Format("1.0.{0}", project.Properties["svn.revision"]);
            string setupFileContents;

            //read in the .vdproj file          
            using (StreamReader sr = new StreamReader(setupFileName))
            {
                setupFileContents = sr.ReadToEnd();
            }

            if (!string.IsNullOrEmpty(setupFileContents))
            {
                Regex expression2 = new Regex(@"(?:\""ProductCode\"" = \""8.){([\d\w-]+)}");
                Regex expression3 = new Regex(@"(?:\""PackageCode\"" = \""8.){([\d\w-]+)}");
                Regex expression4 = new Regex(@"(?:\""ProductVersion\"" = \""8.)(\d.\d.\d+)");
                setupFileContents = expression2.Replace(setupFileContents,"\"ProductCode\" = \"8:{" + Guid.NewGuid().ToString().ToUpper() + "}");
                setupFileContents = expression3.Replace(setupFileContents,"\"PackageCode\" = \"8:{" + Guid.NewGuid().ToString().ToUpper() + "}");
                setupFileContents = expression4.Replace(setupFileContents,"\"ProductVersion\" = \"8:" + productVersion);

                using (TextWriter tw = new StreamWriter(setupFileName, false))
                {
                    tw.WriteLine(setupFileContents);
                }
            }
        }
       ]]>
    </code>
    </script>

    <!-- must build the dependency first (code project), before building the MSI deployment project -->
    <exec program="Devenv.exe" commandline='"fullPath\solution.sln" /rebuild "Release" /project "${DependencyProject}" /out "fullPath\somelog.log"'/>
    <exec program="Devenv.exe" commandline='"fullPath\solution.sln" /rebuild "Release" /project "${DeploymentProjectPath}" /out "fullPath\somelog.log"'/>
</target>

FYIこれはまだ.NET 4.0でサポートされていません。

ただ、のCRise のさんの投稿に拡張する - 動作しない、コマンドラインからVS2010のdevenvをを使用してvdprojプロジェクトを構築します。前-2010は、私は信じて正常に動作します(参照リンクテキストの)

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top