Why does AttachDBFile make everything slower? In my ASP.NET app, I had tested a query against a 200.000 rows table with two connection strings, one connect to a remote SQL Server and once use AttachDBFile to attach to a database file in App_Data. 

The query with the first connection is much faster than the later. Anybody could shed some light on this for me?
You are comparing two different servers. Likely different hardware specs, possibly different versions. Possibly even querying different data. Apples and oranges. The attach is probably a red herring (there is a cost in attach and querying cold data, but will amortize over many queries. You do measure hot cached and repeated runs, don't you?)

Read How to analyse SQL Server performance to root-cause the performance problem.