What are the various “Build action” settings in Visual Studio project properties and what do they do?

None: The file is not included in the project output group and is not compiled in the build process. An example is a text file that contains documentation, such as a Readme file. Compile: The file is compiled into the build output. This setting is used for code files. Content: Allows you to retrieve a … Read more

How do you count the lines of code in a Visual Studio solution?

I’ve found powershell useful for this. I consider LoC to be a pretty bogus metric anyway, so I don’t believe anything more formal should be required. From a smallish solution’s directory: PS C:\Path> (gci -include *.cs,*.xaml -recurse | select-string .).Count 8396 PS C:\Path> That will count the non-blank lines in all the solution’s .cs and … Read more

Can you force Visual Studio to always run as an Administrator in Windows 8?

In Windows 8, Windows 10, and Windows 11, you have to right-click devenv.exe and select “Troubleshoot compatibility”. Select “Troubleshoot program” Check “The program requires additional permissions” Click “Next” Click “Test the program…” Wait for the program to launch Click “Next” Select “Yes, save these settings for this program” Click “Close” If, when you open Visual … Read more

Error message “No exports were found that match the constraint contract name”

I solved this problem by clearing Visual Studio Component Model Cache. Just delete or rename this folder: %LocalAppData%\Microsoft\VisualStudio\11.0\ComponentModelCache or %LocalAppData%\Microsoft\VPDExpress\11.0\ComponentModelCache and restart Visual Studio. The version of Visual Studio you have is specified by the number e.g. Visual Studio 2012 is 11.0 (as shown above) Visual Studio 2013 is 12.0 Visual Studio 2015 is 14.0 … Read more

Could not find a part of the path … bin\roslyn\csc.exe

TL; DR run this in the Package Manager Console: Update-Package Microsoft.CodeDom.Providers.DotNetCompilerPlatform -r More information This problem is not related to Visual Studio itself, so answers suggesting adding build steps to copy files over are rather a workaround. Same with adding compiler binaries manually to the project. The Roslyn compiler comes from a NuGet package and … Read more

Difference between Build Solution, Rebuild Solution, and Clean Solution in Visual Studio?

Build solution will perform an incremental build: if it doesn’t think it needs to rebuild a project, it won’t. It may also use partially-built bits of the project if they haven’t changed (I don’t know how far it takes this) Rebuild solution will clean and then build the solution from scratch, ignoring anything it’s done … Read more

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