你好 我已經安裝了visual studio express C++項目,包含了包含頭文件和庫的路徑 現在我喜歡將這個項目複製到包含頭文件和庫的相同路徑中 但是,手動進入.vcproj文件並開始更改名稱 有更好的方法嗎?複製visual studio項目的最快方式/腳本是什麼?
4
A
回答
9
也許最簡單快速的方法是使用Windows資源管理器來製作整個項目的副本。您很可能需要爲複製的.vcproj文件分配一個新的唯一GUID。爲此,請在記事本中打開文件,並從guidgen.exe
或類似應用程序中粘貼新的ProjectGUID
。完成之後,只需在Visual Studio中打開重複的項目並重新命名即可。
另外,你可以嘗試像CopyWiz(雖然我從來沒有使用它,有一個免費的試用版可用來查看它是否適用於你)。
除非您正在嘗試爲新項目創建模板,在這種情況下有a better way。
1
如果在PowerShell中運行(在Win 7和其他版本中提供),請編寫這個適用於我的程序 即使它不能正確工作,它也可能是一個很好的起點。
# set the initial values.
[System.Reflection.Assembly]::LoadWithPartialName(「System.Windows.Forms」)
[Windows.Forms.MessageBox]::Show(「This script assumes that each project lives in a directory with the same name as the project, as VC defaults to. Input a) the directory holding both the existing project and the new project. This is the directory CONTAINING the directory with the name of the existing project. It must include the final backslash. b) the name of the existing project. c) the name of the new project」, 「」, [Windows.Forms.MessageBoxButtons]::OK, [Windows.Forms.MessageBoxIcon]::Information)
($myroot=(Read-Host "Enter path of directory holding new and existing projects."))
($projectname=(Read-Host "Enter the name of the project to copy. Must be a single word"))
($newname=(Read-Host "Enter the name of the new project. Must be a single word"))
# make a copy of the original
Set-Location $myroot
Copy-Item "$myroot$projectname" "$myroot$newname" -recurse
# find and rename all files containing the original project name
# run without recurse first or an error occurs
Get-ChildItem $myroot$newname\ -force| Where-Object {$_.name -like "*$projectname*"}| rename-item -newname { $_.name -replace "$projectname","$newname" }
Get-ChildItem $myroot$newname\ -force -recurse| Where-Object {$_.name -like "*$projectname*"}| rename-item -newname { $_.name -replace "$projectname","$newname" }
# find all references within the code to the projectname and change those
Set-Location $myroot$newname
Get-ChildItem -recurse | where {$_.extension -eq ".cpp"-or $_.extension -eq ".h" -or $_.extension -eq ".sln" -or $_.extension -eq ".vcxproj" -or $_.extension -eq ".rc"} `
|foreach-object {(get-content $_.fullname) | foreach-object {$_ -replace "$projectname", "$newname"} | set-content $_.fullname}
# delete sdf and suo files
remove-item $myroot$newname\$newname.suo -force
remove-item $myroot$newname\$newname.sdf -force
#done
相關問題
- 1. 什麼是項目的最佳版本控制方式
- 2. 什麼是最快速的工作方式PHP腳本
- 3. Visual Studio腳本項目
- 4. Visual Studio複製項目
- 5. 什麼是比較兩個項目列表的最快方式?
- 6. 什麼是從寵物項目中學習的最快方式?
- 7. 在Visual Studio中摺疊所有項目的最佳/最快/最簡單的方法是什麼?
- 8. 跨Visual Studio版本遷移舊版項目時,最佳方法是什麼?
- 9. 更直接的複製Visual Studio項目的方式?
- 10. 爲什麼我不能複製我的visual studio項目
- 11. 有什麼方法可以恢復項目的visual studio文件?
- 12. 什麼是在Visual Studio中導航到類頂部的最快捷方式
- 13. 什麼是Visual Studio中項目的最佳默認位置?
- 14. 什麼是快捷方式在Visual Studio 2013
- 15. 在MonoDevelop和Visual Studio上使用生成後腳本生成項目的最佳方法是什麼?
- 16. 在Visual Studio中切換十六進制顯示的快捷方式是什麼?
- 17. WPF:將項目添加到ListView的最有效/最快的方式是什麼?
- 18. 複製的項目錯誤Visual Studio 2012
- 19. 複製相關的項目在Visual Studio
- 20. 什麼是支持數據庫項目的Visual Studio 2010的最低版本
- 21. Visual Studio擴展代碼生成...什麼是最好的方式
- 22. 在Visual Studio中調試程序的最佳方式是什麼?
- 23. 什麼是Visual Studio 2008解決方案中的最佳項目數量?
- 24. PHP5 CLI制定基本目錄的最佳方式是什麼?
- 25. 什麼是複製我的陣列的最快方法?
- 26. 在Python中檢查重複項的最快方法是什麼?
- 27. 在Visual Studio 11中複製一行代碼的快捷方式
- 28. Visual Studio安裝項目 - 創建EXE文件的快捷方式
- 29. 的Visual Studio部署項目可選桌面快捷方式
- 30. 什麼是再次通過腳本的最佳方式?
對於那些誰不知道GUIDGEN.EXE的位置: 「C:\ Program Files文件\微軟的SDK \的Windows \ v6.0A \ BIN」(我的系統是Windows 7專業版64位,VS 2005,2008年&2010安裝) – kubilay 2012-09-27 14:51:42