24 Şubat 2014 Pazartesi

BadImageFormatException

64 bit işletim sistemi üzerinde 32 bit oracle client kurulduğunda web uygulaması ile
oracle veritabanına erişmeye calıştığımda aldığım hata:

System.InvalidOperationException: Attempt to load Oracle client libraries threw BadImageFormatException.  This problem will occur when running in 64 bit mode with the 32 bit Oracle client components installed web,


Çözüm: -->  IIS ayarlarında, application pool'da Enable 32-Bit Applicaitons değerini "True" yapmak.

8 Şubat 2013 Cuma

Automapper - Index was outside the bounds of the array


Index was outside the bounds of the array.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IndexOutOfRangeException: Index was outside the bounds of the array.

 
Automapper'de map işlemi sırasında yukarıdaki gibi bir hata olıuşursa
Source veya Destination nesnesinde tanımlı byte [] dizisine byte [0] şeklinde bir atama yapılmıştır.

Çözüm:  byte[0] değeri  içermedeğini kontrol et.




14 Ocak 2013 Pazartesi

Asp.Net MVC3 Value Cannot Be Null Hatası

MVC3'de  dropdown kontrolüne viewbag ile taşınan liste, post işlemi sırasında
value cannot be null, paramater name: items

Oluşan hata:

Line 27:         </div>
Line 28:         <div class="editor-field">
Line 29:   @Html.DropDownListFor(Model => Model.carId,

new SelectList(ViewBag.Cars as System.Collections.IEnumerable, "CarId", "CarName"),
Line 30:             "Select a Car", new { id = "ddlCars" })
Line 31:         </div>

yukarıda görüldüğü gibi,  post işlemi yapılır yapılmaz hataya düşüyor.

Çözüm:
  http://stackoverflow.com/questions/5207355/dropdownlist-items-null-when-posting-to-edit-form

adresinden de görüleceği üzere,

ilgili action'da dönen değer view'da görüntülenmeden önce liste bir kez daha doldurulmalı.

 [HttpPost]
        public ActionResult Add(ViewModelKart kart)
        {
            if (ModelState.IsValid)
            {
                return RedirectToAction("Index""Home");
            } 
            ViewBag.Cars = db.GetCarList();
 
            return View(kart);
        }


24 Nisan 2012 Salı

Tasarım Kalıpları (Design Patterns)

Bu yazı dizisinde, yazılım geliştirirken karşılaştığım problemleri ve bu problemlerin çözümü için uyguladığım tasarım desenlerini anlatmaya çalışacağım.