Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ssis/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
MSBuild使用嵌入资源发布网站_Msbuild - Fatal编程技术网

MSBuild使用嵌入资源发布网站

MSBuild使用嵌入资源发布网站,msbuild,Msbuild,我正在使用命令行调用msbuild,以使用以下命令生成网站的发布版本: msbuild.exe /t:ResolveReferences;Compile;_CopyWebApplication /p:OutDir=dir/bin/ /p:WebProjectOutputDir=dir/ /p:Debug=false /p:Configuration=Release Website.csproj 除了网站.dll中不存在嵌入的资源外,此功能工作正常。如果我通过VisualSt

我正在使用命令行调用msbuild,以使用以下命令生成网站的发布版本:

msbuild.exe /t:ResolveReferences;Compile;_CopyWebApplication /p:OutDir=dir/bin/ 
    /p:WebProjectOutputDir=dir/ /p:Debug=false /p:Configuration=Release 
    Website.csproj

除了
网站.dll
中不存在嵌入的资源外,此功能工作正常。如果我通过VisualStudio进行发布,它将包含嵌入的资源。是否缺少一个标志?

需要一个额外的目标,如下所示:

msbuild.exe /t:PrepareResources;ResolveReferences;Compile;_CopyWebApplication 
    /p:OutDir=dir/bin/ /p:WebProjectOutputDir=dir/ /p:Debug=false 
    /p:Configuration=Release Website.csproj
看来

/t:PrepareResources
调用已添加到msbuild调用中的所有目标,请尝试

下面是被称为

PrepareResources 
    PrepareResourceNames
        AssignTargetPaths
        SplitResourcesByCulture
        CreateManifestResourceNames
        CreateCustomManifestResourceNames
    ResGen
        ResolveAssemblyReferences
        SplitResourcesByCulture
        BeforeResGen
        CoreResGen
        AfterResGen
    CompileLicxFiles

你是如何解决这个问题的。您是否捕获了VS构建输出?如何?我使VS输出生成过程“详细”:工具>选项>项目和解决方案>生成和运行>MSBuild项目生成输出详细信息。然后,我查看了与资源相关的每个目标,并将其添加进去。顺便说一句,我发现现在似乎需要不止一个论点。我已经更新了上面的答案。它们都是从.csproj下的单个目标调用的吗?您可能可以调用一个抽象目标,而不是所有单个的onestry microsoft.common.targets和microsoft.chsarp.targets