Strange behaviour when using dynamic types as method parameters

What you need to remember is that dynamic resolution basically does the same process as static resolution, but at runtime. Anything that couldn’t be resolved by the CLR won’t be resolved by the DLR. Let’s take this small program, inspired by yours, and that doesn’t use dynamic at all: namespace ConsoleApplication38 { public interface IActualInterface … Read more

Fluent NHibernate – Create database schema only if not existing

You can just use SchemaUpdate instead, it will update the schema if it exists and create it if it does not: public NhibernateSessionFactory(IPersistenceConfigurer config) { _sessionFactory = Fluently.Configure(). Database(config). Mappings(m => m.FluentMappings.AddFromAssemblyOf<MappingsPersistenceModel>()). ExposeConfiguration(cfg => new SchemaUpdate(cfg).Execute(false, true)). BuildSessionFactory(); } One caveat: SchemaUpdate does not do destructive updates (dropping tables, columns, etc.). It will only add … Read more

Assigning a GUID in C#

If you already have a string representation of the Guid, you can do this: Guid g = new Guid(“11223344-5566-7788-99AA-BBCCDDEEFF00”); And if you want a brand new Guid then just do Guid g = Guid.NewGuid();

The directory ‘/website/App_Code/’ is not allowed because the application is precompiled

Depending on your case, there are three possible scenarios: see this link http://www.beansoftware.com/ASP.NET-FAQ/Directory-App_Code-Not-Allowed.aspx Basically, If you precompiled your app, there shoudn’t be an App_Code folder. If you added it later, you should delete it. OR May be Somehow a precompiled.config file has made it to production. Deleting that file should resolve the App_Code directory error.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)