Nant를 사용하여 msbuild에서 .vdproj를 빌드하는 중에 오류가 발생했습니다.

StackOverflow https://stackoverflow.com/questions/1472095

문제

저는 빌드 릴리스에 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/buildingmsifilesfromnantandandupdatingthevdprojsversioninInInsOntOnsOntOnsOntuesDay.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>

참고로 이는 .NET 4.0에서는 아직 지원되지 않습니다.

확장하기 위해 크리즈포스트 - 명령 줄을 통해 vs2010 devenv를 사용하여 vdproj 프로젝트 구축은 작동하지 않습니다. 2010 년 이전은 잘 작동합니다 링크 텍스트)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top