0
asp.net網站我要發佈asp.net網站..平時我做發佈下從命令行
- 打開asp.net項目
- 右擊解決方案exploere,然後點擊發佈網站
- 當被問及對目標路徑和我做...
但我不想遵循所有上述步驟,所有我想要的..我會點擊蝙蝠用於發佈asp.net網站
我跟所有的步驟的這裏提到的 「如何發佈帶命令提示符的Asp網站」=>http://hajloo.wordpress.com/2011/05/02/how-to-publish-asp-web-sites-with-command-prompt/
<?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
我google了一下關於那個錯誤我試過以下解決方案
- 註冊與IIS的框架:ASPNET_REGIIS -i =>沒有幫助
- 之所以選擇建設 - >在目標框架選擇了.NET框架4 =>沒有幫助
請建議我.. 可能嗎 ?如果是,在即時通訊做錯了或什麼,我缺少
感謝
你從常規運行此命令提示符還是,如文章所述,您需要使用VS工具目錄下的Visual Studio命令提示符? – 2014-09-24 14:20:30
StartMenu>所有程序> Microsoft Visual Studio 2010> Visual Studio工具> Visual Studio x64跨工具命令提示符(2010) – user4059149 2014-09-24 14:23:21
'targetFramework'已添加到.net 4.5中。根據文件路徑,您使用的是使用.net 4.0的VS2010。嘗試從'web.config'中刪除該屬性。 – Mads 2014-09-24 14:30:24