久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

在構建代理上運行代碼分析 (FxCop > 10) 而不安裝

Running Code Analysis (FxCop gt; 10) on build agent without installing Visual Studio(在構建代理上運行代碼分析 (FxCop 10) 而不安裝 Visual Studio)
本文介紹了在構建代理上運行代碼分析 (FxCop > 10) 而不安裝 Visual Studio的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

在 FxCop 10 之后,Microsoft 停止為 FxCop 提供單獨的安裝程序.官方目前只能在安裝 Visual Studio 2013/2015/2017 后運行代碼分析(FxCop 12.0/14.0/15.0).但是,我們堅持不要在構建代理上安裝 Visual Studio(安裝需要與我們在開發人員計算機上獲得的內容保持同步等).

After FxCop 10 Microsoft stopped shipping a separate installer for FxCop. Officially one can currently only run code analysis (FxCop 12.0 / 14.0 / 15.0) after installing Visual Studio 2013 / 2015 / 2017. However, we are adamant about not installing Visual Studio on the build agents (the installation needs then to be kept in-sync with what we have got on the developer computers etc.).

那么我將如何讓 FxCop 12.0/14.0/15.0 在構建代理上工作,最好不安裝任何其他東西?不過,我會接受將一些二進制文件和 msbuild 文件添加到源代碼控制中.否則:有沒有辦法只使用 Visual Studio 2013/2015/2017 安裝程序安裝 FxCop 的東西?

So how would i go about getting FxCop 12.0 / 14.0 / 15.0 to work on a build agent, preferrably without installing anything else? I would accept adding a few binaries and msbuild files to source control, though. Otherwise: Is there a way to only install the FxCop stuff using Visual Studio 2013 / 2015 / 2017 installer?

注意:我們使用 Teamcity 作為構建服務器.

Note: we are using Teamcity as build server.

由于特定環境和 FxCop 版本有多個有效答案,我冒昧地將它們鏈接到此處以便于訪問:

As there are multiple valid answers for specific environments and FxCop versions, I've taken the liberty of linking them here for easier access:

  • FxCop 15.0 (Visual Studio 2017)
  • FxCop 14.0 (Visual Studio 2015)
  • FxCop 12.0 (Visual Studio 2013)
  • SonarQube

推薦答案

在不安裝 Visual Studio 2017 的情況下運行 FxCop 15.0

先決條件:

  • MSBuild 15.0 --> 安裝 Microsoft Build Tools 2017,您可能還想查看此處
  • Visual C++ Redistributable for Visual Studio 2017 x86或這里 帶有 C++ 的 Visual Studio 2017.---- 注意:總是需要 x86 版本,根據構建,可能還需要 x64 redist.如果它丟失,則錯誤消息可能很神秘,例如 System.IO.FileNotFoundException: 無法加載文件或程序集 'Microsoft.VisualStudio.CodeAnalysis.Interop.dll' 或其依賴項之一.找不到指定的模塊.).除了安裝整個 redist,您還可以單獨復制必要的 DLL,但此時我不知道需要哪些.找出確切缺失的部分非常棘手且耗時.
  • MSBuild 15.0 --> Install Microsoft Build Tools 2017, you might also want to see here
  • Visual C++ Redistributable for Visual Studio 2017 x86 or here OR Visual Studio 2017 with C++. ---- Note: the x86 version is always required, depending on the build x64 redist may be required as well. If it is missing the error message can be cryptic, for example System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualStudio.CodeAnalysis.Interop.dll' or one of its dependencies. The specified module could not be found.). Instead of installing the entire redist you could also copy the necessary DLLs separately, but at this point i don't know which are needed. It's quite tricky and time consuming to find out which ones are exactly missing.

取決于您要構建的內容:

Depending on what you want to build:

  • 適當的 Windows SDK,例如 Windows 10 SDK
  • 適當的 .net SDK/目標(.NET Framework 4.6 SDK 包含在 Windows 10 SDK 中)

這些是我必須添加到源代碼管理的文件:(請注意這可能違反某些許可協議)

These are the files that i had to add to source control: (Please consider that this might violate some license agreements)

(source control)	oolsFxCop15
│
├[Engines]
│   │
│   ├IntrospectionAnalysisEngine.dll
│   └PhoenixAnalysisEngine.dll
├[Msbuild]
│   │
│   ├fxcoptask.dll
│   ├Microsoft.CodeAnalysis.Targets
│   ├Microsoft.VisualStudio.CodeAnalysis.dll
│   └Microsoft.VisualStudio.CodeAnalysis.Sdk.dll
├[Repository]
│   │
│   ├[Compatibility]
│   │   │
│   │   ├Desktop2.0.xml
│   │   ├Desktop2.0SP1.xml
│   │   ├Desktop2.0SP2.xml
│   │   ├Desktop3.0.xml
│   │   ├Desktop3.0SP1.xml
│   │   ├Desktop3.0SP2.xml
│   │   ├Desktop3.5.xml
│   │   └Desktop3.5SP1.xml
│   └system32.bin
├[Rules]
│   │
│   ├DataflowRules.dll
│   ├DesignRules.dll
│   ├GlobalizationRules.dll
│   ├InteroperabilityRules.dll
│   ├MaintainabilityRules.dll
│   ├MobilityRules.dll
│   ├NamingRules.dll
│   ├PerformanceRules.dll
│   ├PortabilityRules.dll
│   ├ReliabilityRules.dll
│   ├SecurityRules.dll
│   ├SecurityTransparencyRules.dll
│   └UsageRules.dll
├[x64]
│   │
│   └msdia140.dll (1349 KB)
├[Xml]
│   │
│   ├CodeAnalysisReport.xsl
│   ├FxCopReport.xsl
│   └VSConsoleOutput.xsl
├Architecture-msil.dll
├CodeAnalysis.dll
├CustomDictionary.xml
├FxCopCmd.exe
├FxCopCmd.exe.config
├FxCopCommon.dll
├FxCopSdk.dll
├Microsoft.Cci.dll
├Microsoft.VisualStudio.CodeAnalysis.Common.dll
├Microsoft.VisualStudio.CodeAnalysis.DataflowModels.dll
├Microsoft.VisualStudio.CodeAnalysis.dll
├Microsoft.VisualStudio.CodeAnalysis.Interop.dll
├Microsoft.VisualStudio.CodeAnalysis.Phoenix.dll
├Microsoft.VisualStudio.CodeAnalysis.Phoenix.xml
├msdia140.dll (1057 KB)
├mssp7en.dll
├mssp7en.lex
├phx.dll
└Runtime-vccrt-win-msil.dll

復制如下:

  • 整個 FxCop 安裝文件夾內容來自

  • entire FxCop installation folder contents from

%programfiles(x86)%Microsoft Visual Studio2017 **在此處插入版本** Team ToolsStatic Analysis ToolsFxCop

來自 Visual Studio 2017 C++ redist(或您的 Visual Studio 2017 安裝,如果您已安裝 VC++ 工作負載:%ProgramFiles(x86)%Microsoft Visual Studio2017\VCRedistMSVC14.12.25810) 或任何其他地方:(另請參閱法律信息)復制 msdia140 x86 和 x64 (我的版本是 14.12.25810.0) 到:

from Visual Studio 2017 C++ redist (or your Visual Studio 2017 Installation, if you've got VC++ workload installed: %ProgramFiles(x86)%Microsoft Visual Studio2017\VCRedistMSVC14.12.25810) or any other place: (also see legal information) copy msdia140 x86 and x64 (mine have the version 14.12.25810.0) to:

msdia140.dll (1.12 MiB)

msdia140.dll (1.12 MiB)

amd64msdia140.dll (1.42 MiB)

amd64msdia140.dll (1.42 MiB)

所有文件從 %programfiles(x86)%\Microsoft Visual Studio2017 **INSERT EDITION HERE** MSBuildMicrosoftVisualStudiov15.0CodeAnalysis

Msbuildfxcoptask.dll

Msbuildfxcoptask.dll

MsbuildMicrosoft.CodeAnalysis.Targets

MsbuildMicrosoft.CodeAnalysis.Targets

MsbuildMicrosoft.VisualStudio.CodeAnalysis.dll

MsbuildMicrosoft.VisualStudio.CodeAnalysis.dll

MsbuildMicrosoft.VisualStudio.CodeAnalysis.Sdk.dll

MsbuildMicrosoft.VisualStudio.CodeAnalysis.Sdk.dll

另外我將項目msbuild文件(*.csproj)調整如下:

Additionally i adjusted the project msbuild file (*.csproj) as follows:

<!-- Microsoft.CSharp.targets import is contained in csproj by default. This just goes to show the sequence -->
<Import Project="$(MSBuildToolsPath)Microsoft.CSharp.targets"/>

<!-- now this must be added -->
<Import Project="$(ProjectBuildScriptDir)Custom.CodeAnalysis.targets"/>

這就是我們的 Custom.CodeAnalysis.targets 包含的內容:

And this is what our Custom.CodeAnalysis.targets contains:

<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

    <!-- Code analysis settings. -->
    <PropertyGroup>
        <!-- this must reference the path where you copied the FxCop stuff to -->
        <FxCopDir>..FxCop15</FxCopDir> 
        <CodeAnalysisCulture>en-US</CodeAnalysisCulture>
        <CodeAnalysisRuleSet>$(SolutionDir)FxCop.ruleset</CodeAnalysisRuleSet>
        <!-- you can and should use another condition here. Otherwise code analysis will be run on every build in VS as well. -->
        <!-- in my build setup i do something like Condition=IsRunningOnTeamCity => true -->
        <RunCodeAnalysis>true</RunCodeAnalysis> 
        <CodeAnalysisTreatWarningsAsErrors Condition="'$(IsRunningOnTeamCity)' != 'true'">true</CodeAnalysisTreatWarningsAsErrors>
    </PropertyGroup>

    <Import Project="$(FxCopDir)MsbuildMicrosoft.CodeAnalysis.Targets" />

    <Target Name="CodeAnalysisLogHeader" BeforeTargets="RunCodeAnalysis" Condition="$(RunCodeAnalysis) == 'true' OR $(RunCodeAnalysisOnce) == 'true'">
        <Message Text="Text, Executing Code Analysis (FxCop) on $(MsBuildProjectName)" Importance="High" />
    </Target>

</Project>

Visual Studio 路徑注意事項:

Visual Studio 安裝路徑取決于版本.它包括專業版和企業版.AFAIR 社區版有不同的路徑,但也不支持 FxCop.歡迎指正:-)

Notes for Visual Studio Paths:

The path to the visual studio installation is edition dependent. It includes Professional and Enterprise. AFAIR the community edition has a different path, but also does not support FxCop. Corrections welcome :-)

這篇關于在構建代理上運行代碼分析 (FxCop > 10) 而不安裝 Visual Studio的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Is there a way to know if someone has bookmarked your website?(有沒有辦法知道是否有人為您的網站添加了書簽?)
Use of Different .Net Languages?(使用不同的 .Net 語言?)
Determining an #39;active#39; user count of an ASP.NET site(確定 ASP.NET 站點的“活動用戶數)
Best way to keep track of current online users(跟蹤當前在線用戶的最佳方式)
Recommend an Open Source .NET Statistics Library(推薦一個開源的.NET統計庫)
Create a summary description of a schedule given a list of shifts(給定輪班列表,創建時間表的摘要描述)
主站蜘蛛池模板: 亚洲乱码一区二区三区在线观看 | 国产精品久久久久久久久 | 日韩不卡在线观看 | 精品欧美一区二区三区免费观看 | 日韩毛片在线观看 | 99亚洲精品视频 | 亚洲一区日韩 | av 一区二区三区 | 久久久久国产一区二区三区不卡 | 久久大全| 黄色亚洲 | 精品免费国产一区二区三区 | 成人小视频在线 | 国产成人综合久久 | 亚洲 欧美 日韩 在线 | 国产精品日日做人人爱 | h视频在线观看免费 | 免费一区 | 午夜视频在线视频 | 亚洲一区免费 | 伊人精品久久久久77777 | 日本成人午夜影院 | 国产精品自拍av | 羞羞视频在线观看网站 | 国产美女精品视频 | 国产精品免费观看 | 免费电影av | 日韩免费高清视频 | 欧美日本在线观看 | 九色在线视频 | 久久免费精品视频 | 九九久久久 | 欧美黄色片在线观看 | 成人午夜精品 | 一级一片在线观看 | 日韩电影一区二区三区 | 日韩欧美福利视频 | 国产高清视频在线观看 | 成人久久久久 | 亚洲欧美一区二区三区在线 | 日本三级电影免费 |