顯示具有 Visual Studio 標籤的文章。 顯示所有文章
顯示具有 Visual Studio 標籤的文章。 顯示所有文章
2018-05-12 23:53

Visual Studio 快捷鍵

Ctrl + L刪除行
Ctrl + X剪下行(游標不選取文字)
Ctrl + C複製行(游標不選取文字)
Ctrl + J呼叫出類別成員
Ctrl + K,C註解選取範圍
Ctrl + K,U取消註解選取範圍
Ctrl + R,R重新命名變數
F2重新命名變數
Ctrl + Enter上方插入一列
Ctrl + Shift + Enter下方插入一列
Ctrl + 减號回到上次游標位置
CTRL + SHIFT + 减號反之
Ctrl + F3找當前選取
F3找下一個
Shift + F3找上一個
Ctrl + F尋找文字
Ctrl + Shift + F跨檔案尋找文字
Ctrl + H取代文字
Ctrl + Shift + H跨檔案取代文字
Ctrl + J顯示物件的成員清單
Ctrl + K, D格式化文件
Ctrl + K, F格式化選取範圍
Ctrl + E, S顯示空白字元
Ctrl + E, \刪除行尾空白
Ctrl + Alt + ]對齊等號
Ctrl + ]切換至對應刮號
F12轉至定義
Ctrl + F12轉至實做
Alt + F12查看定義
F5偵錯建置
Ctrl + F5建置
Ctrl + U小寫
Ctrl + Shift + U大寫
Alt + 上選取行上移
Alt + 下選取行下移
Ctrl + K, K切換書籤
Ctrl + .開啟智慧標籤選單
Shift + Alt + F10開啟智慧標籤選單
2018-04-11 12:30

用 Visual Studio 自動壓縮發佈的程式

針對只能用隨身碟安裝程式,又不想用 Web Deploy 這麼複雜工具,簡單的用壓縮檔來是處理,利用 Visual Studio 的檔案發佈再進行壓縮封裝,在原本的 pubxml 檔的後面加上 ZipPublishOutput Target 來接續發佈處理,這樣在 Visual Studio 在執行發佈時就可以產生壓縮封裝。

<?xml version="1.0" encoding="utf-8"?>
<!--
"C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" MySolution.sln /t:Rebuild /p:VisualStudioVersion=14.0;Configuration=Release;DeployOnBuild=true;PublishProfile=Release.pubxml
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <WebPublishMethod>FileSystem</WebPublishMethod>
    <LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
    <LastUsedPlatform>Any CPU</LastUsedPlatform>
    <SiteUrlToLaunchAfterPublish />
    <LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
    <ExcludeApp_Data>True</ExcludeApp_Data>
    <publishUrl>obj\Publish</publishUrl>
    <DeleteExistingFiles>True</DeleteExistingFiles>
    <AutoParameterizationWebConfigConnectionStrings>False</AutoParameterizationWebConfigConnectionStrings>
  </PropertyGroup>

  <Target Name="ZipPublishOutput" AfterTargets="GatherAllFilesToPublish;WebFileSystemPublish">
    <Message Text="== 封裝 7-Zip 安裝包 ===============================" Importance="high" />
    <PropertyGroup>
      <Today>$([System.DateTime]::Today.ToString("yyyyMMdd"))</Today>
      <zip>"C:\Program Files\7-Zip\7z.exe"</zip>
      <ReleasePath>$(ProjectDir)obj\Release\Package\PackageTmp</ReleasePath>
      <PackagePath>D:\MySolution_$(Today).exe</PackagePath>
    </PropertyGroup>

    <Exec Command='DEL $(PackagePath)' />
    <Exec Command='$(zip) a -t7z -mx9 -sfx7z.sfx -bd $(PackagePath) * | findstr /v "^$"' WorkingDirectory="$(ReleasePath)" />
  </Target>
</Project>