(最近有讀者朋友表示,希望能加一些示意圖來描述分析過程中用到的原理知識。好的,之後我會註意,謝謝這位讀者) 背景 有位朋友找我,希望我能幫看一下他的一個service。從他的描述看,並沒有資源方面的泄漏,程式目前也能正常工作。他是在用dotnet-counters moniter時發現gc2、也就是 ...
前兩天同事更新包後,發現相關的授權還沒到位(沒買這個版本),所以需要降級回原有版本。
本來我本地沒有拉取最新時,編譯是沒問題的,但是更新後再修改回來,就有問題了。
Severity Code Description Project File Line Suppression State
Error NU1605 Warning As Error: Detected package downgrade: ExcelUtilCore from 1.1.0 to 1.0.2. Reference the package directly from the project to select a different version.
網上搜了半天,大部分是.NET平臺升級的包問題,關於1605的信息很少,而且也不准確,所以記錄一下。
1,為什麼會報錯
在項目的property里,預設1605是當報錯的
2,處理方法
在設置這裡去掉1605重新編譯沒有用,此時會生成如下代碼
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<WarningsAsErrors>$(WarningsAsErrors)</WarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<WarningsAsErrors>$(WarningsAsErrors)</WarningsAsErrors>
</PropertyGroup>
<WarningsAsErrors>$(WarningsAsErrors)</WarningsAsErrors> 並不是我們需要的,需要添加<NoWarn>NU1605</NoWarn>才能編譯通過。
所以正確的配置如下
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<NoWarn>NU1605</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<NoWarn>NU1605</NoWarn>
</PropertyGroup>