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

項目使用 Visual Studio 構建良好,但從命令行失敗

Project builds fine with Visual Studio but fails from the command line(項目使用 Visual Studio 構建良好,但從命令行失敗)
本文介紹了項目使用 Visual Studio 構建良好,但從命令行失敗的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我有一個解決方案,在通過 Visual Studio 2015 運行時構建良好,但是當我從命令行運行時遇到錯誤

I have a solution which builds fine when running through Visual Studio 2015 but when I run from the command line I run into the error

錯誤 CS1056:此行出現(xiàn)意外字符$"

error CS1056: Unexpected character '$' on this line

var CutOffTextFragment = deadLineTime.Deadline.Minute == 0 ? $"{deadLineTime.Deadline:htt}" : $"{deadLineTime.Deadline:h:mmtt}"

deadLineTime.Deadline 是一個 DateTime 對象,代碼將返回 XAM/PM 或 X:XXAM/PM

deadLineTime.Deadline is a DateTime object, the code will return either XAM/PM or X:XXAM/PM

我認為這是因為構建腳本沒有使用 C#6.目前此腳本無法更改為使用 c# 6

I think this is occuring becuase the build script is not using C#6. At present this script cant be changed to use c# 6

如果是這種情況,任何人都可以幫我貶低代碼以便它與 C# 5 一起使用

If this is the case, can anyone help me depreciate the code so it works with C# 5

推薦答案

$可以轉換成string.format.

$ can be converted to string.format.

var CutOffTextFragment = deadLineTime.Deadline.Minute == 0 
                         ? 
                         string.Format("{0:htt}",deadLineTime.Deadline) 
                         : 
                         string.Format("{0:h:mmtt}", deadLineTime.Deadline);

這篇關于項目使用 Visual Studio 構建良好,但從命令行失敗的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

相關文檔推薦

Is there a C# library that will perform the Excel NORMINV function?(是否有執(zhí)行 Excel NORMINV 函數(shù)的 C# 庫?)
Select x random elements from a weighted list in C# (without replacement)(從 C# 中的加權列表中選擇 x 個隨機元素(無需替換))
Create a summary description of a schedule given a list of shifts(給定輪班列表,創(chuàng)建時間表的摘要描述)
C# Normal Random Number(C# 普通隨機數(shù))
Standard deviation of generic list?(通用列表的標準偏差?)
AsyncCTP: Creating a class that is IAwaitable(AsyncCTP:創(chuàng)建一個 IAwaitable 的類)
主站蜘蛛池模板: 亚洲福利视频一区 | 日韩欧美中文 | 国产又粗又猛又黄又爽的视频 | 亚洲欧美日韩成人 | 午夜精品久久久久久久 | 免费的黄色小视频 | 日日干天天干 | 亚洲黄色一级 | 福利在线看 | 综合激情网站 | 日韩欧美在线看 | 蜜桃色999 | 日韩亚洲欧美在线观看 | 国产成人精品免费视频 | 国产日韩欧美亚洲 | 久久久一本 | 91麻豆精品国产91久久久久久久久 | 国产福利视频在线 | 中文在线免费观看 | 亚洲乱码在线 | 久久久网站 | 日韩中文字幕一区二区 | 久草视频观看 | 久久精品99久久久久久 | 久草免费福利视频 | 免费av在线 | 成人三级视频 | 亚洲天堂免费 | 国产天堂网 | 理论片中文字幕 | 欧美性猛交一区二区三区精品 | 国产精品毛片一区视频播 | 蜜桃视频成人 | 国产在线网站 | 日本久久综合 | 男女久久久| 国产成人综合在线 | 免费黄色片网站 | 色播av| 手机看片欧美 | 四虎成人在线 |