Click here to Skip to main content
15,886,095 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
HI All

We are migrating our Sitecore project to VS2019 and while using gulp publish I am facing an error with error MSB4057: The target "Restore" does not exist in the project.

So I am unable to proceed further.

Please any one help me.
Error :

D:\****\*****.csproj : error MSB4057: The target "Restore" does not exist in the project.
[01:56:10] MSBuild failed with code 1!
[01:56:10] 'build-solution' errored after 1.33 s
[01:56:10] Error: MSBuild failed with code 1!
at ChildProcess.<anonymous> (D:\BN-G\r***\node_modules\gulp-msbuild\lib\msbuild-runner.js:97:25)
at ChildProcess.emit (events.js:315:20)
at ChildProcess.EventEmitter.emit (domain.js:506:15)
at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
at Process.callbackTrampoline (internal/async_hooks.js:120:14)
[01:56:10] '_Publish-All-Projects' errored after 19 s

What I have tried:

we have changed all the Msbuilder config changes by adding 2019
return path.join('C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/', 'MSBuild', 'Current', 'Bin', 'amd64', 'MSBuild.exe');
.
It working for the indudvally but clicking publish all project it shows error .
Posted
Updated 30-Sep-20 0:07am
v2

1 solution

I have heard about it related to Nuget packages. Deleting bin & obj folders and doing a rebuild worked for them.

Given the change, if the older version is still being referenced or exists, it could raise it.

Try:
1. Delete bin folder
2. Delete obj folder
3. Rebuild
4. Given you are trying to publish (see if you want to do in Release config)

If the issue still exists, try to nail down the versions of all references.
 
Share this answer
 
Comments
BoopathyNehru 16-Sep-20 11:54am    
I have tried by deleting the bin folder . But facing the same issue.
Sandeep Mewara 16-Sep-20 13:43pm    
just bin or obj too?
BoopathyNehru 30-Sep-20 6:05am    
i have tried both but not working
BoopathyNehru 30-Sep-20 6:08am    
Need to deleted 70 + Projects ?
BoopathyNehru 30-Sep-20 6:07am    
I am having 70 + Projects and need to deleted every project ?

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