Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build: individual project build failures #30501

Closed
Wraith2 opened this issue Aug 6, 2019 · 14 comments · Fixed by dotnet/corefx#40070
Closed

Build: individual project build failures #30501

Wraith2 opened this issue Aug 6, 2019 · 14 comments · Fixed by dotnet/corefx#40070

Comments

@Wraith2
Copy link
Contributor

Wraith2 commented Aug 6, 2019

Setup. On a clean up to date master I did build -clean, build -allconfigurations so everything Is clean and restored, no errors so baseline is good. From this point trying to build an individual project, example build src\System.Data.SqlClient or src\System.Data.Common (I have tried others, all the same) I get the error.

E:\Programming\csharp7\corefx\.dotnet\sdk\3.0.100-preview7-012821\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(234,5): error NETSDK1004: Assets file 'E:\Programming\csharp7\corefx\artifacts\obj\System.Data.Common.Tests\project.assets.json' not found. Run a NuGet package restore to generate this file. [E:\Programming\csharp7\corefx\src\System.Data.Common\tests\System.Data.Common.Tests.csproj]

I've also seen this error in both visual studio and the corefx build output at various points.
NU1105 Unable to find project information for 'E:\Programming\csharp7\corefx\src\Common\tests\CoreFx.Private.TestUtilities\CoreFx.Private.TestUtilities.csproj'. Inside Visual Studio, this may be because the project is unloaded or not part of current solution so please run a restore from command-line. Otherwise the project file may be invalid or missing targets required for restore. System.Data.SqlClient.ManualTesting.Tests E:\Programming\csharp7\corefx\src\System.Data.SqlClient\tests\ManualTests\System.Data.SqlClient.ManualTesting.Tests.csproj

In visual studio 2019 latest stable I also get a number of other errors, this might not be supported but it points at the sdk again so I thought it worth including.
NETSDK1042 Could not load PlatformManifest from 'E:\Programming\csharp7\corefx\artifacts\bin\testhost\netcoreapp-Windows_NT-Debug-x64\shared\Microsoft.NETCore.App\5.0.0\PlatformManifest.txt' because it did not exist. Address C:\Program Files\dotnet\sdk\3.0.100-preview7-012821\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ConflictResolution.targets

This means that the only way to iterate an individual library is to do a full rebuild which is undesirable and slow.
/cc @ViktorHofer for test project nuget restore issue, not sure who'd look at the rest.

@stephentoub
Copy link
Member

cc: @ViktorHofer, @ericstj

@ericstj
Copy link
Member

ericstj commented Aug 6, 2019

These are all related to test restore.

@Wraith2 are you trying to build source projects or tests? You mentioned source projects but then the errors list test projects.

Do you happen to have DotNetBuildFromSource set in your environment? That would cause these errors. Otherwise we'd probably need to look at some logs to understand what's going on.

@ViktorHofer
Copy link
Member

Test projects aren't being restored when specifying allconfigurations. That's the reason. We could probably add the restore target when building leaf projects from root. That should be easy to do.

@Wraith2
Copy link
Contributor Author

Wraith2 commented Aug 6, 2019

I'm trying to work on a specific source project but I know not to try and use outdated dependencies so when I update my master I always clean and rebuild. The full rebuild works but building a single src folder does not. It looks like Viktor knows the issue, would building a single target update the dependencies then? so build -allconfigurations followed by build -c Release?

@ViktorHofer
Copy link
Member

To solve your specific issue you can either do a build -restore or wait for me to make a change in the build scripts

@davidsh
Copy link
Contributor

davidsh commented Aug 6, 2019

I never use 'build' once I build from the root.

I used to use 'msbuild' for individual projects. Now I use 'dotnet msbuild'. It works fine. Here is an example of building the product source for System.Data.SqlClient:
image

@davidsh
Copy link
Contributor

davidsh commented Aug 6, 2019

And building and running tests works also with 'dotnet msbuild':

image

...

image

@ViktorHofer
Copy link
Member

Right that scenario always works but @Wraith2's concern is that the root lead project build is broken.

@Wraith2
Copy link
Contributor Author

Wraith2 commented Aug 6, 2019

That is a concern but if I have a workaround that lets me build and run tests on the project I'm working with then it unblocks me. What is the preferred/suggested method of working on a single project currently? dotnet msbuild or build?

@ViktorHofer
Copy link
Member

Probably most of us use dotnet msbuild. The advantage of build from root is that you don't need to have a global sdk installed.

@Gnbrkm41
Copy link
Contributor

Having the same kind of problem while attempting to build via VS2019 16.3 P2:

NETSDK1042 Could not load PlatformManifest from 'C:\Users\gotos\source\repos\corefx\artifacts\bin\testhost\netcoreapp-Windows_NT-Debug-x86\shared\Microsoft.NETCore.App\5.0.0\PlatformManifest.txt' because it did not exist.

It seems that the workaround is to use dotnet msbuild in the test directory to build/run individual projects, however this isn't an option for me since this happens when I try to use the test explorer as well, thus preventing me from using the explorer; is there any workarounds? I've done build & build -buildtests -test previously, then launched VS via build -vs System.Data.Common.

@steveharter
Copy link
Member

I can confirm same issue as @Gnbrkm41 using most current master branch; unable to run tests within VS.

It's defaulting to x86 instead of x64 for the folder location.

@Wraith2
Copy link
Contributor Author

Wraith2 commented Aug 19, 2019

It might be this dotnet/sdk#3543 in which case specifying a rid might fix it.

@Gnbrkm41
Copy link
Contributor

Maybe it's worth opening a new issue?

@msftgits msftgits transferred this issue from dotnet/corefx Feb 1, 2020
@msftgits msftgits added this to the 5.0 milestone Feb 1, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants