aspnet / DependencyInjection

[Archived] Contains common DI abstractions that ASP.NET Core and Entity Framework Core use. Project moved to https://github.com/aspnet/Extensions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

i have a question

lukangkang opened this issue · comments

严重性 代码 说明 项目 文件 行 禁止显示状态
错误 KRB1001 Package references have not been pinned. Run './build.cmd /t:Pin'.
Also, you can run './build.cmd /t:Restore' which will pin and restore packages. 'build.cmd' can be found in 'D:\Research\DependencyInjection'. DI.Abstractions D:\Research\DependencyInjection\Directory.Build.targets 12
when i'm going to build solution,this mistake is coming?How can i resolve it?

Run build.cmd first

when i run build.cmd, it doesn't work.
Then i run build.sh through gitbash in my PC, it seems to be a success,but a waring is coming.
https://github.com/lukangkang/surpass/blob/master/jietu.png
(Please copy the link to a new window,Otherwise, GitHub will report 404)

Then i tried to follow the cue and add the path to my system PATH,but it's still useless.

What happens when you run build.cmd

The window flashed past.
When I run as an administrator, the result is the same
@ECHO OFF PowerShell -NoProfile -NoLogo -ExecutionPolicy unrestricted -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = ''; [System.Threading.Thread]::CurrentThread.CurrentUICulture = '';& '%~dp0build.ps1' %*; exit $LASTEXITCODE"
this is the code in build.cmd,do I need to change anything?

Run it from the command line...

  1. Open a command prompt window
  2. Navigate to the path where you cloned the GitHub repository
  3. Run "build"

If you get errors, please copy & paste the exact messages you get

commented

Hi, I have the similar problem to build any of .net core projects (DI, Configuration, Hosting etc).

The suggest commands build.cmd /t:Pin, build.cmd /t:Restore and build.cmd all not work, same error like below.

PS C:\Codes\Configuration> .\build.cmd
Downloading KoreBuild 2.1.0-preview1-15493
Using KoreBuild 2.1.0-preview1-15493
WARNING: dotnet found on the system PATH is 'C:\Program Files\dotnet\dotnet.exe' but KoreBuild will use
'C:\Users\heku\.dotnet\x64\dotnet.exe'.
WARNING: Adding 'C:\Users\heku\.dotnet\x64' to system PATH permanently may be required for applications like Visual
Studio or VS Code to work correctly.
Adding C:\Users\heku\.dotnet\x64 to PATH
.NET Core runtime 2.0.0 is already installed. Skipping installation.
dotnet-install: Downloading link: https://dotnetcli.azureedge.net/dotnet/Sdk/2.1.0-preview1-007042/dotnet-sdk-2.1.0-preview1-007042-win-x64.zip
dotnet-install: Extracting zip from https://dotnetcli.azureedge.net/dotnet/Sdk/2.1.0-preview1-007042/dotnet-sdk-2.1.0-preview1-007042-win-x64.zip
dotnet-install: Adding to current process PATH: "C:\Users\heku\.dotnet\x64\". Note: This change will not be visible if PowerShell was run as a child process.
dotnet-install: Installation finished
>>> dotnet.exe msbuild @C:\Codes\Configuration\artifacts\msbuild\msbuild.rsp
Invoke-RepositoryBuild : Program 'dotnet.exe' failed to run: The specified executable is not a valid application for th
is OS platform.At C:\Users\heku\.dotnet\buildtools\korebuild\2.1.0-preview1-15493\scripts\common.psm1:7 char:5
+     & $cmd @args
+     ~~~~~~~~~~~~.
At C:\Codes\Configuration\build.ps1:173 char:5
+     Invoke-RepositoryBuild $Path @MSBuildArgs
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ResourceUnavailable: (:) [Invoke-RepositoryBuild], ApplicationFailedException
    + FullyQualifiedErrorId : NativeCommandFailed,Invoke-RepositoryBuild

It seems it downloads a x64 version dotnet CLI to my x86 OS, is this a bug? Any suggestion?

Here is my environment info.

C:\Users\heku>dotnet --info
.NET Command Line Tools (2.0.0)

Product Information:
 Version:            2.0.0
 Commit SHA-1 hash:  cdcd1928c9

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.15063
 OS Platform: Windows
 RID:         win10-x86
 Base Path:   C:\Program Files\dotnet\sdk\2.0.0\

Microsoft .NET Core Shared Framework Host

  Version  : 2.0.0
  Build    : e8b8861ac7faf042c87a5c2f9f2d04c98b69f28d

I have posted my problem to dotnet/aspnetcore#2191

@heku use a 64 bit OS if you want to build ASP.NET Core repositories.

commented

@davidfowl Thank you, may I know if this is by design?

Everyone that builds these repositories use a 64bit OS, that includes us an most of the OSS contributors. We wouldn't optimize for both unless there was a large number of people on 32 bit OSes trying to build these repos (and there isn't).

commented

@davidfowl Got it, thank you for help.

@heku try setting the KOREBUILD_DOTNET_ARCH environment variable to x86 before running build.cmd.

If you're using Command Prompt

set KOREBUILD_DOTNET_ARCH=x86

If you're using PowerShell

$env:KOREBUILD_DOTNET_ARCH='x86'

cref https://github.com/aspnet/BuildTools/blob/08465c77b2a0a265163bafa4013434dd998e0e1e/files/KoreBuild/scripts/KoreBuild.psm1#L465-L470

@heku I stand corrected.

commented

@davidfowl Never mind, I always appreciate your help.
@natemcmaster Awesome! Let me have a try.

Closing because this appears to be resolved.

@natemcmaster Would it be possible to expose a 32-bit version of build.cmd on all repos? Though it may hit only a small number of people, we should make it as easy as possible to have anyone contribute.

IMO it would be better to just detect when a machine is 32-bit only. I think this can be determined from env variables like PROCESSOR_ARCHITECTURE and PROCESSOR_ARCHITEW6432