Tuesday, April 23, 2019

Visual Studio Compile error The item "obj\Debug\SampleProject.Forms.MDIMain.resources" was specified more than once in the "Resources" parameter.

When merged develop branch to master branch it could happen that the project file contains repeating items. As result, compiling your visual studio project will have such compile error like:
The item "xxx" was specified more than once in the "Resources" parameter. Duplicate items are not supported by the "Resources" parameter.

The solution is easy:
1. Right click on your project and select "Unload the project"
2. Right click on your project and select "Edit YourProject.csproj"
3. Locate the repeating items and remove them.
4. Reload the project

Then these compile error will be resolved.



Resolve issues while openning old project in Visual Studio 2015/2017

When you opened your old project in Visual studio 2015/2017, you will find a lot of missing packages. When you tried to install any one of those missing packages, the visual studio will warn you that the soltuion is not saved.

How to resolve this?

My easy solution is:

1. Under File, choose save your solution.
2. Open Tools, Nuget Package Manager, Package Manger Console, and enter following command:

Update-Package –reinstall Microsoft.AspNet.Web.Optimization

Note Microsoft.AspNet.Web.Optimization can be any one of your missing package, then all missing package will be reinstalled automatically.

Reference:
https://developercommunity.visualstudio.com/content/problem/40958/update-package-reinstall-forces-all-packages-to-re.html