asp.net-mvc – 当OutputPath设置时,“没有为项目设置OutputPath
在MVC4中,如果我为解决方案中的所有项目创建一个新的构建配置,单独构建Web .csproj时,我会得到以下结果:
msbuild Company.Directory.Web.csproj /p:Configuration=Dev
但是,OutputPath属性已设置! <?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Dev|AnyCPU'"> <DebugSymbols>true</DebugSymbols> <OutputPath>bin&;/OutputPath> <DefineConstants>DEBUG;TRACE</DefineConstants> <DebugType>full</DebugType> <PlatformTarget>AnyCPU</PlatformTarget> <ErrorReport>prompt</ErrorReport> <CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets> <CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules> <DeployIisAppPath>Port 80/directory/dev</DeployIisAppPath> </PropertyGroup> <Import Project="$(MSBuildExtensionsPath)$(MSBuildToolsVersion)Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)$(MSBuildToolsVersion)Microsoft.Common.props')" /> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <ProductVersion> </ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{285FBF79-7933-4AF9-AAAF-25EE7734AAAA}</ProjectGuid> <ProjectTypeGuids>{E3E379DF-F4C6-4180-9B81-6769533ABE47};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids> <OutputType>Library</OutputType> <AppDesignerFolder>Properties</AppDesignerFolder> <RootNamespace>Company.Directory.Web</RootNamespace> <AssemblyName>Company.Directory.Web</AssemblyName> <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> <MvcBuildViews>false</MvcBuildViews> <UseIISExpress>true</UseIISExpress> <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..&;/SolutionDir> <RestorePackages>true</RestorePackages> </PropertyGroup> <!-- ... --> 这是一个错误?我该如何解决? 解决方法
事实证明,第一个PropertyGroup很重要。 Visual Studio插入新配置(Dev)PropertyGroup之前出于某种原因。我猜它的一个bug。我固定它通过移动新配置后的其他人。
<?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Import Project="$(MSBuildExtensionsPath)$(MSBuildToolsVersion)Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)$(MSBuildToolsVersion)Microsoft.Common.props')" /> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <ProductVersion> </ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{285FBF79-7933-4AF9-AAAF-25EE7734AAAA}</ProjectGuid> <ProjectTypeGuids>{E3E379DF-F4C6-4180-9B81-6769533ABE47};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids> <OutputType>Library</OutputType> <AppDesignerFolder>Properties</AppDesignerFolder> <RootNamespace>Company.Directory.Web</RootNamespace> <AssemblyName>Company.Directory.Web</AssemblyName> <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> <MvcBuildViews>false</MvcBuildViews> <UseIISExpress>true</UseIISExpress> <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..&;/SolutionDir> <RestorePacCompanyes>true</RestorePacCompanyes> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>true</DebugSymbols> <DebugType>full</DebugType> <Optimize>false</Optimize> <OutputPath>bin&;/OutputPath> <DefineConstants>DEBUG;TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <DebugType>pdbonly</DebugType> <Optimize>true</Optimize> <OutputPath>bin&;/OutputPath> <DefineConstants>TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Dev|AnyCPU'"> <DebugSymbols>true</DebugSymbols> <OutputPath>bin&;/OutputPath> <DefineConstants>DEBUG;TRACE</DefineConstants> <DebugType>full</DebugType> <PlatformTarget>AnyCPU</PlatformTarget> <ErrorReport>prompt</ErrorReport> <CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets> <CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules> <DeployIisAppPath>Port 80/directory/dev</DeployIisAppPath> </PropertyGroup> <!-- ... --> (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
- asp.net-mvc – 未提供所需的防伪标记或无效 – 仅限Safari
- 身份验证 – 向webapi承载令牌添加额外的详细信息
- ASP.NET Core多环境配置文件问题
- asp.net-mvc-3 – 在Razor ASP.Net MVC3中使用另一个View中
- asp.net 下载文件时根据MIME类型自动判断保存文件的扩展名
- .net – WebApi传输字节数组为空
- asp.net-mvc – “test”服务器中的ASP.NET MVC运行时安装要
- asp.net – 是否有可能欺骗或重用VIEWSTATE或检测它是否受到
- asp.net – 如何在占位符中的动态生成的标签之间创建换行符
- ASP.NET MVC – 将外部模型传递给编辑器模板
- active-directory – .net5 MVC6应用程序上的Act
- VS 2015 Update 2 – 调试时不存在变量,为什么?
- asp.net-mvc – ASP.NET MVC中的静态文件路由
- asp.net – 如何在将GridView导出为PDF后更改iTe
- ASP.NET Web.Config转换问题
- ASP.NET网站与ASP.NET WebApp:性能差异是什么?
- asp.net – 如何通过代码有选择地禁用浏览器文本
- asp.net-web-api – Web API帮助页面始终为空
- 如何在asp.net中删除动态创建的控件
- asp.net-mvc – .Net Web API抛出异常/返回响应/