Reputation: 303
I am battling with an application that I had working fine on my PC. I then rebuilt my PC and cloned the application from my GitHub and I am fighting a build failure VisualStudio due to project references.
Almost every article I have looked up on this suggests that something needs to be amended in my .csproj file, however, this file on my application seems generic.
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<UseIISExpress>true</UseIISExpress>
</PropertyGroup>
<ProjectExtensions>
<VisualStudio>
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
<WebProjectProperties>
<StartPageUrl>
</StartPageUrl>
<StartAction>CurrentPage</StartAction>
<AspNetDebugging>True</AspNetDebugging>
<SilverlightDebugging>False</SilverlightDebugging>
<NativeDebugging>False</NativeDebugging>
<SQLDebugging>False</SQLDebugging>
<ExternalProgram>
</ExternalProgram>
<StartExternalURL>
</StartExternalURL>
<StartCmdLineArguments>
</StartCmdLineArguments>
<StartWorkingDirectory>
</StartWorkingDirectory>
<EnableENC>True</EnableENC>
<AlwaysStartWebServerOnDebug>True</AlwaysStartWebServerOnDebug>
</WebProjectProperties>
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
</Project>
I have tried update-package reinstall from the console. I have also tried bluntly removing the packages folder completely, but still no success. The error I get from VS is as follows:
This project references NuGet package(s) that are missing on this computer.
Use NuGet Package Restore to download them.
For more information, see http://go.microsoft.com/fwlink/?LinkID=322105.
The missing file is ..\packages\Microsoft.Net.Compilers.1.0.0\build\Microsoft.Net.Compilers.props.
Riddles2017 C:\Users\Lemus\Source\Repos\The-Fox-The-Chicken-and-The-Corn\Riddles2017.csproj 268
Can anyone point me in the right direction on this? My GitHub link is: https://github.com/lemusthelroy/The-Fox-The-Chicken-and-The-Corn.git
Upvotes: 0
Views: 98
Reputation: 115037
Where is your Solution File stored? Nuget restores its packages relative to the solution file. The repo seems to be missing a solution file and looking at the error message, it expects the solution to live in the parent directory of the location you've cloned to. A bit of a weird choice, but that's what it looks like. So, open the Solution, save the solution (from the file menu) and store it in the parent directory of the project. Then restore the nuget packages.
You may want to change the folder structure in your git repo to include the solution file, optionally clearing the repo completely and pushing it afresh.
Alternatively save the solution file in the same directory as the project and update the project files (using notepad if you have to) to change all references to "..\packages
" to read ".\packages
", then restore the nuget packages.
As you can see in the error message it's looking for:
The missing file is ..\packages\Microsoft.Net.Compilers.1.0.0\build\Microsoft.Net.Compilers.props.
Relative to:
Riddles2017 C:\Users\Lemus\Source\Repos\The-Fox-The-Chicken-and-The- Corn\Riddles2017.csproj 268
So the expected structure is:
c:\users\lemus\Source\Repos
+- Mysolution.sln
+- \packages\
+- \Microsoft.Net.Compilers.1.0.0\
+- \The-Fox-The-Chicken-and-The-Corn\
+- Riddles2017.csproj
As opposed to your current structure:
C:\Users\Lemus\Source\Repos\
+- \The-Fox-The-Chicken-and-The-Corn\
+- Mysolution.sln
+- \packages\
+- \Microsoft.Net.Compilers.1.0.0\
+- Riddles2017.csproj
Looking at your project file this would require changing:
Upvotes: 1