發表文章

目前顯示的是 2016的文章

Cordova 打包 iOS APP 時遇到 Check dependencies 錯誤

錯誤訊息:Check dependencies XXX has conflicting provisioning settings. XXX is automatically signed for development, but a conflicting code signing identity iPhone Distribution has been manually specified. Set the code signing identity value to "iPhone Developer" in the build settings editor, or switch to manual signing in the project editor. Code signing is required for product type 'Application' in SDK 'iOS 10.2' 解決方法 點一下左側專案 General > Automatically manage signing(取消選取) Build Settings > Code Signing Identity 選擇 iOS Developer 開啟上方工具列的 Product > Clean (按下後, 錯誤就消失了) General > Automatically manage signing(選取)

Visual Studio 發行時 TypeScript 發生複製錯誤

發行時遇到複製錯誤的訊息 看了一下是 js 原檔找不到 因為我有在"tsconfig.json"裡面設定"outFile" 所以不會將個別的ts轉成js 也就造成 js 原檔找不到而造成複製錯誤的問題 查了一下 Visual Studio 2015 內建的TypeScript是1.8版 目前 TypeScript 最新版本是 2.0.6.0 去 TypeScript 官方網站下載後再更新就沒有問題了

Entity Delete 因為實體未公開其關聯性的外部索引鍵屬性而發生錯誤

錯誤訊息: 'System.Data.Entity.Infrastructure.DbUpdateException' 類型的例外狀況發生於 EntityFramework.dll,但使用者程式碼未加以處理 其他資訊: 儲存實體時,因為實體未公開其關聯性的外部索引鍵屬性而發生錯誤。EntityEntries 屬性將傳回 Null,因為無法指出單一實體為例外狀況的來源。若公開實體類型中的外部索引鍵屬性,可以使處理儲存時的例外狀況變得比較簡單。如需詳細資料,請參閱 InnerException。 解決方法: 開啟關聯資料表的 "外部索引鍵關聯性 (Foreign Key Relationship)" 小視窗 設定 "強制使用外部索引鍵條件約束 (Enforce Foreign Key Constraint)" 為 否(No)

C# MVC NReco PDF Generator 部署問題

將專案部署後開啟產生PDF的網頁一直出錯 先檢查部署路徑下的bin資料夾有沒有以下這三個檔案 bin\wkhtmltopdf.exe bin\msvcp120.dll bin\msvcr120.dll 如果沒有,就從原本的bin資料夾找到這三個檔案 並且移過去到部署的bin資料夾底下

C# MVC Session lost

開發C# MVC檔案下載時,執行後發現Session都會不見 其中有用到NReco.PdfGenerator的套件 不知道是不是套件的關係導致Application_Start重啟 後來看到這篇 來源 在web.config加入 <configuration> <system.web>     <sessionState mode="StateServer"       stateConnectionString="tcpip=localhost:42424"       cookieless="false"       timeout="20"/>   </system.web> </configuration> 就解決了 測試過後, Application_Start只會重啟一次,後來都沒有重啟

Elmah SQL Server 動態建立連線字串

專案名稱: Project1 在Project1裡建立檔案:TestLog1.cs namespace Project1 {     public class TestLog1 : Elmah.SqlErrorLog     {           public override string ConnectionString          {              get {                  SqlConnectionStringBuilder sqlBuilder = new SqlConnectionStringBuilder();                  sqlBuilder.DataSource = '伺服器名稱';                  sqlBuilder.InitialCatalog = '資料庫名稱';                  sqlBuilder.UserID = '帳號';                  sqlBuilder.Password = '密碼';                  return sqlBuilder.ToString() ;             ...

jQuery Validation 重新驗證

動態載入後重新驗證 $.validator.unobtrusive.parse($('form')); $('form').validate() 若是要初始化錯誤狀態 $.fn.resetValidation = function () {         var $form = $('form');         $form.validate().resetForm();         $form.find("[data-valmsg-summary=true]")             .removeClass("validation-summary-errors")             .addClass("validation-summary-valid")             .find("ul").empty();         $form.find("[data-valmsg-replace]")             .removeClass("field-validation-error")             .addClass("field-validation-valid")             .empty();         return $form; }; 來源:  Reset MVC form with jquery

Google 日曆 URL 加入活動

主要網址 http://www.google.com/calendar/event? action: 這段必備 action=TEMPLATE text: 標題 範例: text=abcd details: 說明 範例: details=abcd dates: 日期時間 YYYYMMDDToHHMMSSZ/YYYYMMDDToHHMMSSZ 注意: 這是 GMT +0 的時間 範例: 2016/01/01 16:00:00~2016/01/02 17:00:00 dates=20160101T160000Z/20160102T170000Z location: 地點 範例: location=abc trp: 是否忙碌 範例: trp=true 或是trp=false sprop: sprop=http://www.google.com sprop=name:Google 綜合以上就是 http://www.google.com/calendar/event?action=TEMPLATE&text=abcd&details=abcd&dates=20160101T160000Z/20160102T170000Z&location=abc&trp=true&sprop=http://www.google.com&sprop=name:Google

IIS handlers accessPolicy 錯誤

圖片
HTTP 錯誤 500.19 - Internal Server Error <handlers accessPolicy="Read, Write, Exccute, Script"> 解決方法 去安裝IIS的地方 另外安裝

ASP.NET jQuery Validate

在ASP.NET MVC 上可以用jQuery驗證 要在NuGet加裝 jQuery Validation