Archive

Archive for the ‘C#’ Category

The type ‘System.Func‘ exists in both ‘c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.5\System.Core.dll’ and ‘c:\WINDOWS\microsoft.net\Framework64\v4.0.30319\mscorlib.dll’

May 31st, 2010 ayah No comments

if your having trouble like this with your Visual Studio 2010 while you have to target .net 3.5, you can do following steps

1. Unload your project within visual studio 2010

2. Edit your project

3. add below code within your project

<Reference Include=”System” />
<Reference Include=”System.Core”>
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>

Categories: C#, asp.net Tags: , ,

Elmah + System.Data.SQLite, Version=1.0.61.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139′ or one of its dependencies. The located assembly’s manifest definition does not match the assembly reference. (Exception from HRESULT: 0×80131040)

May 22nd, 2010 ayah No comments

if your having this message, just add below code in your web.config

<dependentAssembly>
<assemblyIdentity name=”System.Data.SQLite” publicKeyToken=”db937bc2d44ff139″/>
<bindingRedirect oldVersion=”1.0.61.0″ newVersion=”1.0.66.0″/>
</dependentAssembly>

It tells you to redirect all of your SQLite DLL version 1.0.61.0 into somethin newer,for this example 1.0.66.0

For further info, check this

1.DLL redirection in web.config
2.Issue regarding elmah

Categories: C#, Uncategorized, asp.net Tags: ,

Subsonic 3 – Column Name bugs (i)

October 31st, 2009 ayah No comments

As you all know, Subsonic 3 already released several months ago. Until now, team already released 3 minor version of Subsonic 3, so current version is Subsonic 3.0.3.

Unlike previous version, Subsonic 3 implements full LINQ provider which support only by .NET Framework 3.5. Thats why, Subsonic 3 only supported by .NET Framework 3.5 above.

Although it’s already released up to 3 minor version, there are several very annoying bugs. One of them is Subsonic 3 doesn’t support if column name in database doesn’t match with property name.

For this, I use following table script with MySQL database server
[sourcecode language="SQL"]CREATE TABLE `product_test` (

`product_test_id` int(11) NOT NULL AUTO_INCREMENT,

`product_name` varchar(45) NOT NULL,

`product_date` datetime NOT NULL,

PRIMARY KEY (`product_test_id`)

) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1; [/sourcecode]
The SQL Statement that I’ve got when I’m trying to query using Subsonic is like this

SELECT NULL

FROM `product_test` AS t0

LIMIT 0,1

And the code is like this

var firstProductTest = productTestAll.FirstOrDefault();
Assert.AreEqual(1, firstProductTest.ProductTestId);
Assert.AreEqual(“PAMPERS”, firstProductTest.ProductName);

But if I tried to get records from product_test using, it only gives me 0 records, weird….

Categories: C#, MySQL, asp.net Tags: