Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Consider app.config remapping of assembly "WebGrease, Culture=neutral, PublicKeyToken=31bf3856ad364e35" from Version "1.5.1.25624" [] to Version "1.6.5135.21930"


I am facing the issue while buid gulp.

gulp.task('build-solution', () => {
		const solution = `./${config.solutionName}.sln`;

		return gulp.src(solution)
			.pipe(msbuild({
				...defaultMsbuildConfig,
				
			}));
	});


What I have tried:

I have removed restore and it fails
Posted
Updated 5-Oct-20 4:18am

1 solution

First try deleting bin & obj folder and rebuild. If this does'nt solve, your versions are still a mess and need to resolve.

Here, same issue and accepted solution: How to solve warning: Consider app.config remapping of assembly | The ASP.NET Forums[^]


For this situation, this packages must be uninstalled and reinstalled to solve the problem, below is the reason which you could refer to:

Quote:
The reason packages must be uninstalled and reinstalled is:
-When installing a package, we determine the target framework of your project
-We then match that up with the package contents, finding the appropriate \lib\ folder (and \content\ folder)
-Assembly references are added with Hint Paths that point to the package's \lib\ folder, with the right subfolder (\lib\net40 for example)
-Content files are copied from the packages \content\ folder, with the right subfolder (\content\net40 for example)
-We record the targetFramework used to install the package within the packages.config file
-After you change your project's target framework, the Hint Paths still point to net40
-When you uninstall packages, we check the targetFramework that was recorded in packages.config to see what target framework's libs/content to remove from your project
-When you reinstall the package, we detect your updated target framework and reference/copy the right libs/content

Highlevel, seems you need to remove the older reference, then added the correct reference.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900