繁体   English   中英

从命令行发布 asp.net 网站

[英]Publish asp.net Website from CommandLine

我想发布 asp.net 网站 .. 通常我会这样做

  • 打开asp.net项目
  • 右键单击解决方案探索并单击发布网站
  • 询问目的地路径,我完成了...

但我不想按照我想要的所有上述步骤..我将点击 .bat 发布 asp.net 网站

我按照这里提到的所有步骤“如何使用命令提示符发布 Asp 网站”=> http://hajloo.wordpress.com/2011/05/02/how-to-publish-asp-web-sites-with-命令提示符/

 <?xml version="1.0" encoding="utf-8"?> <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Target Name="PrecompileWeb"> <AspNetCompiler VirtualPath="/Web" PhysicalPath="F:\\Build_Automation\\trunk\\src\\Portal\\Web\\" TargetPath="F:\\Build_Automation\\trunk\\src\\Portal\\PrecompiledWeb\\Web\\" Force="true" Debug="true" FixedNames="True" /> </Target> </Project>

但我收到错误

 C:\\>msbuild my.xml /p:Configuration=Release Microsoft (R) Build Engine version 4.0.30319.34209 [Microsoft .NET Framework, version 4.0.30319.34209] Copyright (C) Microsoft Corporation. All rights reserved. Build started 9/24/2014 6:52:33 PM. Project "C:\\my.xml" on node 1 (default targets). PrecompileWeb: C:\\Windows\\Microsoft.NET\\Framework\\v2.0.50727\\aspnet_compiler.exe -v /Web -p "C:\\Users\\Administrator\\Documents\\Visual Studio 2010\\WebSites\\xxxx\\xxxx\\\\" -f -d -fixednames C:\\Users\\Administrator\\Desktop\\PPatch\\test\\ C:\\Users\\Administrator\\Documents\\Visual Studio 2010\\WebSites\\xxxx\\xxxx\\web.co nfig(8): error ASPCONFIG: Unrecognized attribute 'targetFramework'. Note that a ttribute names are case-sensitive. [C:\\my.xml] Done Building Project "C:\\my.xml" (default targets) -- FAILED. Build FAILED. "C:\\my.xml" (default target) (1) -> (PrecompileWeb target) -> C:\\Users\\Administrator\\Documents\\Visual Studio 2010\\WebSites\\xxxx\\xxxx\\web. config(8): error ASPCONFIG: Unrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive. [C:\\my.xml] 0 Warning(s) 1 Error(s) Time Elapsed 00:00:02.17

我用谷歌搜索了那个错误,我尝试了以下解决方案

  • 使用 IIS 注册框架:aspnet_regiis -i => 没有帮助
  • 选择 Build -> 在 Target Framework 中选择了 .NET Framework 4 => 没有帮助

请建议我.. 有可能吗? 如果是的话,我哪里做错了或我错过了什么

谢谢

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM