【问题标题】:msbuild package not found error when dot in solution name解决方案名称中的点时找不到 msbuild 包错误
【发布时间】:2016-06-19 03:57:04
【问题描述】:

从命令行构建我的解决方案时

msbuild "app1.Web.test.sln /target:package

我收到以下错误

错误:MSB4057“在项目中找不到目标”

所以我搜索了一个解决方案,并找到了与我的场景类似的以下链接。

link

根据链接中提供的解决方案,我尝试了以下命令

msbuild app1.Web.test.sln /t:app1_Web_test:Package

下面的 sn-p 保存在我的解决方案文件夹中,名称为 before.app1.Web.test.sln.targets

 <?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">   <Target Name="app1_Web_test:WebPublish">
        <MSBuild
            Condition="'%(ProjectReference.Identity)' == '$(SolutionDir)app1.Web.test.sln'"
            Projects="@(ProjectReference)"
            Targets="package"
            BuildInParallel="True"
            ToolsVersion="4.0"
            Properties="BuildingSolutionFile=true; CurrentSolutionConfigurationContents=$(CurrentSolutionConfigurationContents); SolutionDir=$(SolutionDir); SolutionExt=$(SolutionExt); SolutionFileName=$(SolutionFileName); SolutionName=$(SolutionName); SolutionPath=$(SolutionPath)"
            SkipNonexistentProjects="%(ProjectReference.SkipNonexistentProjects)" /> 

但问题仍然存在。

谁能弄清楚哪里出错了?

【问题讨论】:

    标签: .net visual-studio-2010 msbuild package web-deployment


    【解决方案1】:

    您的项目是否在解决方案的文件夹中?

    我目前在尝试构建位于我的解决方案的文件夹中的项目时遇到问题。他们使用 devenv 在 Visual Studio 中构建良好,但在 Azure 中使用 MSBuild 时失败。

    当我将 csproj 项目从解决方案中的文件夹移动到根级别时,它会找到它。

    有没有办法在\t:参数中指定文件夹?

    该文件夹不是真正的文件系统文件夹,只是树结构的一部分,显示了我的解决方案 sln 文件。

    【讨论】:

    • 我最终将我的 csproj 移动到 te 解决方案的根级别。
    猜你喜欢
    • 1970-01-01
    • 2011-02-05
    • 2012-06-19
    • 1970-01-01
    • 2021-09-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-05-24
    相关资源
    最近更新 更多