Selectively suppress custom Obsolete warnings

Use #pragma warning disable: using System; class Test { [Obsolete(“Message”)] static void Foo(string x) { } static void Main(string[] args) { #pragma warning disable 0618 // This one is okay Foo(“Good”); #pragma warning restore 0618 // This call is bad Foo(“Bad”); } } Restore the warning afterwards so that you won’t miss “bad” calls.

Visual Studio Post Build Event – Copy to Relative Directory Location

Here is what you want to put in the project’s Post-build event command line: copy /Y “$(TargetDir)$(ProjectName).dll” “$(SolutionDir)lib\$(ProjectName).dll” EDIT: Or if your target name is different than the Project Name. copy /Y “$(TargetDir)$(TargetName).dll” “$(SolutionDir)lib\$(TargetName).dll”

NUnit vs. Visual Studio 2008’s test projects for unit testing [closed]

Daok named all the pro’s of Visual Studio 2008 test projects. Here are the pro’s of NUnit. NUnit has a mocking framework. NUnit can be run outside of the IDE. This can be useful if you want to run tests on a non-Microsoft build server, like CruiseControl.NET. NUnit has more versions coming out than visual studio. You … Read more

Difference between Rebuild and Clean + Build in Visual Studio

Rebuild = Clean + Build (usually) Notable details: For a multi-project solution, “rebuild solution” does a “clean” followed by a “build” for each project (possibly in parallel). Whereas a “clean solution” followed by a “build solution” first cleans all projects (possibly in parallel) and then builds all projects (possibly in parallel). This difference in sequencing … Read more

I want to delete all bin and obj folders to force all projects to rebuild everything

This depends on the shell you prefer to use. If you are using the cmd shell on Windows then the following should work: FOR /F “tokens=*” %%G IN (‘DIR /B /AD /S bin’) DO RMDIR /S /Q “%%G” FOR /F “tokens=*” %%G IN (‘DIR /B /AD /S obj’) DO RMDIR /S /Q “%%G” If you … Read more

How do you force Visual Studio to regenerate the .designer files for aspx/ascx files?

If you open the .aspx file and switch between design view and html view and back it will prompt VS to check the controls and add any that are missing to the designer file. In VS2013-15 there is a Convert to Web Application command under the Project menu. Prior to VS2013 this option was available … Read more

The name ‘ConfigurationManager’ does not exist in the current context

It’s not only necessary to use the namespace System.Configuration. You have also to add the reference to the assembly System.Configuration.dll , by Right-click on the References / Dependencies Choose Add Reference Find and add System.Configuration. This will work for sure. Also for the NameValueCollection you have to write: using System.Collections.Specialized;

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