.NET 4.0 has a new GAC, why?

Yes since there are 2 distinct Global Assembly Cache (GAC), you will have to manage each of them individually. In .NET Framework 4.0, the GAC went through a few changes. The GAC was split into two, one for each CLR. The CLR version used for both .NET Framework 2.0 and .NET Framework 3.5 is CLR … Read more

Release generating .pdb files, why?

Because without the PDB files, it would be impossible to debug a “Release” build by anything other than address-level debugging. Optimizations really do a number on your code, making it very difficult to find the culprit if something goes wrong (say, an exception is thrown). Even setting breakpoints is extremely difficult, because lines of source … Read more

Is it possible to change the location of packages for NuGet?

It’s now possible to control which folder the packages are installed into. http://nuget.codeplex.com/workitem/215 Edit: See Phil Haack’s comment on Dec 10 2010 at 11:45 PM (in the work item/the link above). The support is partially implemented in 1.0, but is not documented. According to @dfowler: Add a nuget.config file next to the solution with this: … Read more

Default SecurityProtocol in .NET 4.5

Some of the those leaving comments on other answers have noted that setting System.Net.ServicePointManager.SecurityProtocol to specific values means that your app won’t be able to take advantage of future TLS versions that may become the default values in future updates to .NET. Instead of specifying a fixed list of protocols, do the following: For .NET … Read more

Is Mono ready for prime time? [closed]

There are a couple of scenarios to consider: (a) if you are porting an existing application and wondering if Mono is good enough for this task; (b) you are starting to write some new code, and you want to know if Mono is mature enough. For the first case, you can use the Mono Migration … Read more

Upload files with HTTPWebrequest (multipart/form-data)

Took the code above and fixed because it throws Internal Server Error 500. There are some problems with \r\n badly positioned and spaces etc. Applied the refactoring with memory stream, writing directly to the request stream. Here is the result: public static void HttpUploadFile(string url, string file, string paramName, string contentType, NameValueCollection nvc) { log.Debug(string.Format(“Uploading … Read more

How do I find the .NET version?

There is an easier way to get the exact version .NET version installed on your machine from a cmd prompt. Just follow the following instructions; Open the command prompt (i.e Windows + R → type “cmd”). Type the following command, all on one line: reg query “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP” (This will list all the .NET … Read more

Logging best practices [closed]

Update: For extensions to System.Diagnostics, providing some of the missing listeners you might want, see Essential.Diagnostics on CodePlex (http://essentialdiagnostics.codeplex.com/) Frameworks Q: What frameworks do you use? A: System.Diagnostics.TraceSource, built in to .NET 2.0. It provides powerful, flexible, high performance logging for applications, however many developers are not aware of its capabilities and do not make … Read more

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