nuget package .dll not copying to bin with msbuild despite dll.refresh file

365 Views Asked by At

i'm sure it's me doing something wrong and could do with someone smarter than myself having a look at this.

the problem im having is that MSBuild targeting .NET 4.7.2 fails to copy dll referenced in bin/nager.publicsuffix.dll.refresh file so the build fails with type missing error (obviously because the .dll is missing), but builds ok in visual studio and builds fine in msbuild if i copy/paste the dll from packages\Nager.PublicSuffix.2.4.0\lib\netstandard2.0\Nager.PublicSuffix.dll and the repo i was using built fine with msbuild before moving to a new machine. both visual studio 2022 and visualstudio 2022 build tools both have everything installed

MSBuild Output

MSBuild version 17.8.3+195e7f5a3 for .NET Framework
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\MSBuild.exe /verbosity:diagnostic C:\Development\test\test.sln
Build started 15/11/2023 11:51:51.
Process = "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\MSBuild.exe"
MSBuild executable path = "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\MSBuild.e
xe"
Command line arguments = ""C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\MSBuild.e
xe"  "C:\Development\test\test.sln" /verbosity:diagnostic"
Current directory = "C:\Windows\System32"
MSBuild version = "17.8.3+195e7f5a3"
Some command line switches were read from the auto-response file "C:\Program Files (x86)\Microsoft Visual Studio\2022\B
uildTools\MSBuild\Current\Bin\MSBuild.rsp". To disable this file, use the "-noAutoResponse" switch.

Search paths being used for $(MSBuildExtensionsPath) are C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools
\MSBuild;$(MSBuildProgramFiles32)\MSBuild
Search paths being used for $(MSBuildExtensionsPath) are C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools
\MSBuild;$(MSBuildProgramFiles32)\MSBuild
Trying to import C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\$(MSBuildToolsVersion)\Solution
File\ImportAfter\* using extensions path C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild
Assembly loaded during Evaluation: Microsoft.IO.Redist, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd
51 (location: C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\Microsoft.IO.Redist.dl
l, MVID: d528d43e-4d35-4c28-8aa6-a5ce49a5eba7, AppDomain: [Default])
Property reassignment: $(_GenerateRestoreGraphProjectEntryInputProperties)="
      ExcludeRestorePackageImports=true;
      _RestoreSolutionFileUsed=true;
      SolutionDir=C:\Development\test\;
      SolutionName=test;
      SolutionFileName=test.sln;
      SolutionPath=C:\Development\test\test.sln;
      SolutionExt=.sln;
    " (previous value: "ExcludeRestorePackageImports=true") at C:\Program Files (x86)\Microsoft Visual Studio\2022\Buil
dTools\Common7\IDE\CommonExtensions\Microsoft\NuGet\NuGet.targets (84,5)
The target "_CheckForInvalidConfigurationAndPlatform" listed in a BeforeTargets attribute at "C:\Program Files (x86)\Mi
crosoft Visual Studio\2022\BuildTools\Common7\IDE\CommonExtensions\Microsoft\NuGet\NuGet.targets (601,11)" does not exi
st in the project, and will be ignored.
Initial Properties:
_DirectorySolutionPropsBasePath =
_DirectorySolutionPropsFile = Directory.Solution.props
_DirectorySolutionTargetsBasePath =
_DirectorySolutionTargetsFile = Directory.Solution.targets
_GenerateRestoreGraphProjectEntryInputProperties =
      ExcludeRestorePackageImports=true;
      _RestoreSolutionFileUsed=true;
      SolutionDir=C:\Development\test\;
      SolutionName=test;
      SolutionFileName=test.sln;
      SolutionPath=C:\Development\test\test.sln;
      SolutionExt=.sln;

_RestoreSolutionFileUsed = true
AndroidTargetsPath = C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Microsoft\MDD\Android\V150\
AspNetConfiguration = Debug
Configuration = Debug
CurrentSolutionConfigurationContents = <SolutionConfiguration>
  <ProjectConfiguration Project="{E90A1B7E-D6A4-49C7-AB1C-5B6A442541B1}" AbsolutePath="C:\Development\test" BuildProjec
tInSolution="True">Debug|AnyCPU</ProjectConfiguration>
</SolutionConfiguration>
FrameworkSDKRoot = C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\
GetReferenceNearestTargetFrameworkTaskSupportsTargetPlatformParameter = true
HideWarningsAndErrors = false
iOSTargetsPath = C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Microsoft\MDD\iOS\V150\
IsRestoreTargetsFileLoaded = true
MSBuildAllProjects = C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\Common7\IDE\CommonExtensions\Micros
oft\NuGet\NuGet.targets
MSBuildAssemblyVersion = 17.0
MSBuildBinPath = C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin
MSBuildDisableFeaturesFromVersion = 999.999
MSBuildExtensionsPath = C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild
MSBuildExtensionsPath32 = C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild
MSBuildFileVersion = 17.8.3.51904
MSBuildFrameworkToolsPath = C:\Windows\Microsoft.NET\Framework\v4.0.30319\
MSBuildFrameworkToolsPath32 = C:\Windows\Microsoft.NET\Framework\v4.0.30319\
MSBuildFrameworkToolsPath64 = C:\Windows\Microsoft.NET\Framework64\v4.0.30319\
MSBuildFrameworkToolsPathArm64 = C:\Windows\Microsoft.NET\FrameworkArm64\v4.0.30319\
MSBuildFrameworkToolsRoot = C:\Windows\Microsoft.NET\Framework\
MSBuildNodeCount = 1
MSBuildProgramFiles32 = C:\Program Files (x86)
MSBuildProjectDefaultTargets = Build
MSBuildProjectDirectory = C:\Development\test
MSBuildProjectDirectoryNoRoot = Development\test
MSBuildProjectExtension = .metaproj
MSBuildProjectFile = test.sln.metaproj
MSBuildProjectFullPath = C:\Development\test\test.sln.metaproj
MSBuildProjectName = test.sln
MSBuildRuntimeType = Full
MSBuildRuntimeVersion = 4.0.30319
MSBuildSDKsPath = C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Sdks
MSBuildSemanticVersion = 17.8.3+195e7f5a3
MSBuildStartupDirectory = C:\Windows\System32
MSBuildToolsPath = C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin
MSBuildToolsPath32 = C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin
MSBuildToolsPath64 = C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\amd64
MSBuildToolsRoot = C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild
MSBuildToolsVersion = Current
MSBuildVersion = 17.8.3
NuGetInteractive =
NuGetRestoreTargets = C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\..\Common7\IDE\CommonExten
sions\Microsoft\NuGet\NuGet.targets
PackageDownloadSupported = true
Platform = Any CPU
RestoreBuildInParallel = true
RestoreContinueOnError = WarnAndContinue
RestoreRecursive = true
RestoreTaskAssemblyFile = NuGet.Build.Tasks.dll
RestoreUseSkipNonexistentTargets = true
RoslynTargetsPath = C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\Roslyn
SDK35ToolsPath = C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\
SDK40ToolsPath = C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8.1 Tools\
SolutionDir = C:\Development\test\
SolutionExt = .sln
SolutionFileName = test.sln
SolutionName = test
SolutionPath = C:\Development\test\test.sln
TargetFrameworkVersion = v4.0
ValidateRuntimeIdentifierCompatibility = false
VCTargetsPath = C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Microsoft\VC\v170\
VCTargetsPath10 = C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\
VCTargetsPath11 = C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\
VCTargetsPath12 = C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\
VCTargetsPath14 = C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\
VisualStudioVersion = 17.0
VsInstallRoot = C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools
WindowsSDK80Path =

Initial Items:
SolutionConfiguration
    Debug|Any CPU
        Content = <SolutionConfiguration>
  <ProjectConfiguration Project="{E90A1B7E-D6A4-49C7-AB1C-5B6A442541B1}" AbsolutePath="C:\Development\test" BuildProjec
tInSolution="True">Debug|AnyCPU</ProjectConfiguration>
</SolutionConfiguration>
        Platform = Any CPU
        Configuration = Debug
    Release|Any CPU
        Content = <SolutionConfiguration />
        Platform = Any CPU
        Configuration = Release

test: Defaulting .NET Framework v4.7.2 to the .NET Framework v4.0 version of aspnet_compiler.exe. To change the version
 of the tool used, please set the "ToolPath" parameter with the correct path to the tool.
test: Defaulting .NET Framework v4.7.2 to the .NET Framework v4.0 version of aspnet_compiler.exe. To change the version
 of the tool used, please set the "ToolPath" parameter with the correct path to the tool.
Project "C:\Development\test\test.sln" on node 1 (default targets).
Target "ValidateSolutionConfiguration: (TargetId:2)" in file "C:\Development\test\test.sln.metaproj" from project "C:\D
evelopment\test\test.sln" (entry point):
Task "Error" skipped, due to false condition; (('$(CurrentSolutionConfigurationContents)' == '') and ('$(SkipInvalidCon
figurations)' != 'true')) was evaluated as (('<SolutionConfiguration>
  <ProjectConfiguration Project="{E90A1B7E-D6A4-49C7-AB1C-5B6A442541B1}" AbsolutePath="C:\Development\test" BuildProjec
tInSolution="True">Debug|AnyCPU</ProjectConfiguration>
</SolutionConfiguration>' == '') and ('' != 'true')).
Task "Warning" skipped, due to false condition; (('$(CurrentSolutionConfigurationContents)' == '') and ('$(SkipInvalidC
onfigurations)' == 'true')) was evaluated as (('<SolutionConfiguration>
  <ProjectConfiguration Project="{E90A1B7E-D6A4-49C7-AB1C-5B6A442541B1}" AbsolutePath="C:\Development\test" BuildProjec
tInSolution="True">Debug|AnyCPU</ProjectConfiguration>
</SolutionConfiguration>' == '') and ('' == 'true')).
Using "Message" task from assembly "Microsoft.Build.Tasks.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5
f7f11d50a3a".
Task "Message" (TaskId:2)
  Task Parameter:Text=Building solution configuration "Debug|Any CPU". (TaskId:2)
  Building solution configuration "Debug|Any CPU". (TaskId:2)
Done executing task "Message". (TaskId:2)
Done building target "ValidateSolutionConfiguration" in project "test.sln".: (TargetId:2)
Target "ValidateToolsVersions: (TargetId:3)" in file "C:\Development\test\test.sln.metaproj" from project "C:\Developme
nt\test\test.sln" (entry point):
Task "Error" skipped, due to false condition; ('$(MSBuildToolsVersion)' == '2.0' and ('$(ProjectToolsVersion)' != '2.0'
 and '$(ProjectToolsVersion)' != '')) was evaluated as ('Current' == '2.0' and ('' != '2.0' and '' != '')).
Done building target "ValidateToolsVersions" in project "test.sln".: (TargetId:3)
Target "ValidateProjects: (TargetId:4)" in file "C:\Development\test\test.sln.metaproj" from project "C:\Development\te
st\test.sln" (entry point):
Task "Warning" skipped, due to false condition; ( ('$(Configuration)' == 'Release') and ('$(Platform)' == 'Any CPU') )
was evaluated as ( ('Debug' == 'Release') and ('Any CPU' == 'Any CPU') ).
Done building target "ValidateProjects" in project "test.sln".: (TargetId:4)
Target "Build: (TargetId:5)" in file "C:\Development\test\test.sln.metaproj" from project "C:\Development\test\test.sln
" (entry point):
Using "MSBuild" task from assembly "Microsoft.Build.Tasks.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5
f7f11d50a3a".
Task "MSBuild" (TaskId:3)
  Task Parameter:BuildInParallel=True (TaskId:3)
  Task Parameter:
      Projects=
          C:\Development\test\test.metaproj
                  AdditionalProperties=Configuration=Debug; Platform=Any CPU
                  Configuration=Debug
                  Platform=AnyCPU
                  SkipNonexistentProjects=Build
                  ToolsVersion=Current (TaskId:3)
  Task Parameter:
      Properties=
          BuildingSolutionFile=true
          CurrentSolutionConfigurationContents=<SolutionConfiguration>
    <ProjectConfiguration Project="{E90A1B7E-D6A4-49C7-AB1C-5B6A442541B1}" AbsolutePath="C:\Development\test" BuildProj
  ectInSolution="True">Debug|AnyCPU</ProjectConfiguration>
  </SolutionConfiguration>
          SolutionDir=C:\Development\test\
          SolutionExt=.sln
          SolutionFileName=test.sln
          SolutionName=test
          SolutionPath=C:\Development\test\test.sln (TaskId:3)
  Global Properties: (TaskId:3)
    BuildingSolutionFile=true (TaskId:3)
    CurrentSolutionConfigurationContents=<SolutionConfiguration>
    <ProjectConfiguration Project="{E90A1B7E-D6A4-49C7-AB1C-5B6A442541B1}" AbsolutePath="C:\Development\test" BuildProj
  ectInSolution="True">Debug|AnyCPU</ProjectConfiguration>
  </SolutionConfiguration> (TaskId:3)
    SolutionDir=C:\Development\test\ (TaskId:3)
    SolutionExt=.sln (TaskId:3)
    SolutionFileName=test.sln (TaskId:3)
    SolutionName=test (TaskId:3)
    SolutionPath=C:\Development\test\test.sln (TaskId:3)
  Additional Properties for project "C:\Development\test\test.metaproj": (TaskId:3)
    Configuration=Debug (TaskId:3)
    Platform=Any CPU (TaskId:3)
Project "C:\Development\test\test.sln" (1) is building "C:\Development\test\test.metaproj" (2) on node 1 (default targe
ts).
Target "GetFrameworkPathAndRedistList: (TargetId:6)" in project "C:\Development\test\test.metaproj" (target "Build" dep
ends on it):
Using "GetFrameworkPath" task from assembly "Microsoft.Build.Tasks.Core, Version=15.1.0.0, Culture=neutral, PublicKeyTo
ken=b03f5f7f11d50a3a".
Task "GetFrameworkPath" (TaskId:4)
  Output Item(s): _CombinedTargetFrameworkDirectoriesItem=C:\Windows\Microsoft.NET\Framework\v4.0.30319 (TaskId:4)
  Output Item(s): _CombinedTargetFrameworkDirectoriesItem=C:\Windows\Microsoft.NET\Framework\v3.5 (TaskId:4)
  Output Item(s): _CombinedTargetFrameworkDirectoriesItem=C:\Windows\Microsoft.NET\Framework\v3.0 (TaskId:4)
  Output Item(s): _CombinedTargetFrameworkDirectoriesItem=C:\Windows\Microsoft.NET\Framework\v2.0.50727 (TaskId:4)
Done executing task "GetFrameworkPath". (TaskId:4)
Using "CreateItem" task from assembly "Microsoft.Build.Tasks.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b0
3f5f7f11d50a3a".
Task "CreateItem" (TaskId:5)
  Task Parameter:
      Include=
          C:\Windows\Microsoft.NET\Framework\v4.0.30319\RedistList\*.xml
          C:\Windows\Microsoft.NET\Framework\v3.5\RedistList\*.xml
          C:\Windows\Microsoft.NET\Framework\v3.0\RedistList\*.xml
          C:\Windows\Microsoft.NET\Framework\v2.0.50727\RedistList\*.xml (TaskId:5)
  Output Item(s):
      InstalledAssemblyTables=
          C:\Windows\Microsoft.NET\Framework\v2.0.50727\RedistList\FrameworkList.xml
                  OriginalItemSpec=C:\Windows\Microsoft.NET\Framework\v2.0.50727\RedistList\*.xml (TaskId:5)
Done executing task "CreateItem". (TaskId:5)
Done building target "GetFrameworkPathAndRedistList" in project "test.metaproj".: (TargetId:6)
Target "Build: (TargetId:7)" in project "C:\Development\test\test.metaproj" (entry point):
Task "MSBuild" (TaskId:6)
  Task Parameter:BuildInParallel=True (TaskId:6)
  Task Parameter:
      Properties=
          BuildingSolutionFile=true
          CurrentSolutionConfigurationContents=<SolutionConfiguration>
    <ProjectConfiguration Project="{E90A1B7E-D6A4-49C7-AB1C-5B6A442541B1}" AbsolutePath="C:\Development\test" BuildProj
  ectInSolution="True">Debug|AnyCPU</ProjectConfiguration>
  </SolutionConfiguration>
          SolutionDir=C:\Development\test\
          SolutionExt=.sln
          SolutionFileName=test.sln
          SolutionName=test
          SolutionPath=C:\Development\test\test.sln (TaskId:6)
Done executing task "MSBuild". (TaskId:6)
Task "CreateItem" (TaskId:7)
  Task Parameter:Include=..\test\\Bin\*.refresh (TaskId:7)
  Output Item(s):
      Project_E90A1B7E-D6A4-49C7-AB1C-5B6A442541B1_References_RefreshFile=
          ..\test\Bin\Nager.PublicSuffix.dll.refresh
                  OriginalItemSpec=..\test\\Bin\*.refresh (TaskId:7)
Done executing task "CreateItem". (TaskId:7)
Using "ReadLinesFromFile" task from assembly "Microsoft.Build.Tasks.Core, Version=15.1.0.0, Culture=neutral, PublicKeyT
oken=b03f5f7f11d50a3a".
Task "ReadLinesFromFile" (TaskId:8)
  Task Parameter:File=..\test\Bin\Nager.PublicSuffix.dll.refresh (TaskId:8)
  Output Item(s): Project_E90A1B7E-D6A4-49C7-AB1C-5B6A442541B1_References_ReferenceRelPath=packages\Nager.PublicSuffix.
  2.4.0\lib\netstandard2.0\Nager.PublicSuffix.dll (TaskId:8)
Done executing task "ReadLinesFromFile". (TaskId:8)
Using "CombinePath" task from assembly "Microsoft.Build.Tasks.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b
03f5f7f11d50a3a".
Task "CombinePath" (TaskId:9)
  Task Parameter:Paths=packages\Nager.PublicSuffix.2.4.0\lib\netstandard2.0\Nager.PublicSuffix.dll (TaskId:9)
  Task Parameter:BasePath=..\test\ (TaskId:9)
  Output Item(s):
      Project_E90A1B7E-D6A4-49C7-AB1C-5B6A442541B1_References=
          ..\test\packages\Nager.PublicSuffix.2.4.0\lib\netstandard2.0\Nager.PublicSuffix.dll
                  OriginalItemSpec=packages\Nager.PublicSuffix.2.4.0\lib\netstandard2.0\Nager.PublicSuffix.dll (TaskId:
  9)
Done executing task "CombinePath". (TaskId:9)
Task "Copy" skipped, due to false condition; (!Exists('%(Project_E90A1B7E-D6A4-49C7-AB1C-5B6A442541B1_References.Identi
ty)')) was evaluated as (!Exists('..\test\packages\Nager.PublicSuffix.2.4.0\lib\netstandard2.0\Nager.PublicSuffix.dll')
).
Using "GetReferenceAssemblyPaths" task from assembly "Microsoft.Build.Tasks.Core, Version=15.1.0.0, Culture=neutral, Pu
blicKeyToken=b03f5f7f11d50a3a".
Task "GetReferenceAssemblyPaths" (TaskId:10)
  Task Parameter:TargetFrameworkMoniker=.NETFramework,Version=v4.7.2 (TaskId:10)
  Output Property: Project_E90A1B7E-D6A4-49C7-AB1C-5B6A442541B1__TargetFrameworkDirectories=C:\Program Files %28x86%29\
  Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\ (TaskId:10)
  Output Property: Project_E90A1B7E-D6A4-49C7-AB1C-5B6A442541B1__FullFrameworkReferenceAssemblyPaths=C:\Program Files %
  28x86%29\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\ (TaskId:10)
Done executing task "GetReferenceAssemblyPaths". (TaskId:10)
Using "ResolveAssemblyReference" task from assembly "Microsoft.Build.Tasks.Core, Version=15.1.0.0, Culture=neutral, Pub
licKeyToken=b03f5f7f11d50a3a".
Task "ResolveAssemblyReference" (TaskId:11)
  Task Parameter:FullFrameworkFolders=C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.
  7.2\ (TaskId:11)
  Task Parameter:
      SearchPaths=
          {RawFileName}
          {TargetFrameworkDirectory}
          {GAC} (TaskId:11)
  Task Parameter:FindSerializationAssemblies=True (TaskId:11)
  Task Parameter:FindSatellites=True (TaskId:11)
  Task Parameter:
      Assemblies=
          C:\Development\test\packages\Nager.PublicSuffix.2.4.0\lib\netstandard2.0\Nager.PublicSuffix.dll
                  OriginalItemSpec=packages\Nager.PublicSuffix.2.4.0\lib\netstandard2.0\Nager.PublicSuffix.dll (TaskId:
  11)
  Task Parameter:FindRelatedFiles=True (TaskId:11)
  Task Parameter:TargetFrameworkMoniker=.NETFramework,Version=v4.7.2 (TaskId:11)
  Task Parameter:FindDependencies=True (TaskId:11)
  Task Parameter:TargetFrameworkDirectories=C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramewo
  rk\v4.7.2\ (TaskId:11)
C:\Development\test\test.metaproj : warning MSB3268: The primary reference "C:\Development\test\packages\Nager.PublicSu
ffix.2.4.0\lib\netstandard2.0\Nager.PublicSuffix.dll" could not be resolved because it has an indirect dependency on th
e framework assembly "netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" which could not b
e resolved in the currently targeted framework. ".NETFramework,Version=v4.7.2". To resolve this problem, either remove
the reference "C:\Development\test\packages\Nager.PublicSuffix.2.4.0\lib\netstandard2.0\Nager.PublicSuffix.dll" or reta
rget your application to a framework version which contains "netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyTo
ken=cc7b13ffcd2ddd51".
Done executing task "ResolveAssemblyReference". (TaskId:11)
Using "Copy" task from assembly "Microsoft.Build.Tasks.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f
11d50a3a".
Task "Copy" (TaskId:12)
Done executing task "Copy". (TaskId:12)
Using "AspNetCompiler" task from assembly "Microsoft.Build.Tasks.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToke
n=b03f5f7f11d50a3a".
Task "AspNetCompiler" (TaskId:13)
  Task Parameter:PhysicalPath=..\test\ (TaskId:13)
  Task Parameter:Force=True (TaskId:13)
  Task Parameter:Debug=True (TaskId:13)
  Task Parameter:ToolPath=C:\Windows\Microsoft.NET\Framework\v4.0.30319 (TaskId:13)
  Task Parameter:FixedNames=False (TaskId:13)
  Task Parameter:TargetPath=PrecompiledWeb\localhost_59420\ (TaskId:13)
  Task Parameter:Updateable=True (TaskId:13)
  Task Parameter:VirtualPath=/localhost_59420 (TaskId:13)

  C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_compiler.exe -v /localhost_59420 -p ..\test\ -u -f -d Precompile
  dWeb\localhost_59420\  (TaskId:13)
  Microsoft (R) ASP.NET Compilation Tool version 4.8.9032.0 (TaskId:13)
  Utility to precompile an ASP.NET application (TaskId:13)
  Copyright (C) Microsoft Corporation. All rights reserved. (TaskId:13)
   (TaskId:13)
c:\Development\test\Default.aspx.cs(3): error CS0246: The type or namespace name 'Nager' could not be found (are you mi
ssing a using directive or an assembly reference?) [C:\Development\test\test.metaproj]
  The command exited with code 1. (TaskId:13)

Done executing task "AspNetCompiler" -- FAILED. (TaskId:13)
Done building target "Build" in project "test.metaproj" -- FAILED.: (TargetId:7)
Done Building Project "C:\Development\test\test.metaproj" (default targets) -- FAILED.

Done executing task "MSBuild" -- FAILED. (TaskId:3)
Done building target "Build" in project "test.sln" -- FAILED.: (TargetId:5)
Done Building Project "C:\Development\test\test.sln" (default targets) -- FAILED.

Deferred Messages

  Detailed Build Summary
  ======================
       (TaskId:0)

  ============================== Build Hierarchy (IDs represent configurations) =======================================
  ==============
  Id                  : Exclusive Time   Total Time   Path (Targets)
  ---------------------------------------------------------------------------------------------------------------------
  -------------- (TaskId:0)
  0                   : 0.016s           0.693s       C:\Development\test\test.sln ()  (TaskId:0)
  . 1                 : 0.678s           0.678s       C:\Development\test\test.metaproj ()  (TaskId:0)

  ============================== Node Utilization (IDs represent configurations) ======================================
  ==============
  Timestamp:            1        Duration   Cumulative
  ---------------------------------------------------------------------------------------------------------------------
  -------------- (TaskId:0)
  638356459118712154:   0        0.016s     0.016s  (TaskId:0)
  638356459118868311:   1        0.678s     0.693s ............. (TaskId:0)
  638356459118868311:   0        0.678s     1.371s ............. (TaskId:0)
  ---------------------------------------------------------------------------------------------------------------------
  --------------
  Utilization:          100.0    Average Utilization: 100.0 (TaskId:0)

Project Evaluation Performance Summary:
       16 ms  C:\Development\test\test.sln.metaproj      1 calls

Project Performance Summary:
      678 ms  C:\Development\test\test.metaproj          1 calls
      693 ms  C:\Development\test\test.sln               1 calls

Target Performance Summary:
        0 ms  ValidateSolutionConfiguration              1 calls
        0 ms  ValidateToolsVersions                      1 calls
        0 ms  ValidateProjects                           1 calls
        0 ms  GetFrameworkPathAndRedistList              1 calls
     1371 ms  Build                                      2 calls

Task Performance Summary:
        0 ms  Message                                    1 calls
        0 ms  GetFrameworkPath                           1 calls
        0 ms  ReadLinesFromFile                          1 calls
        0 ms  CombinePath                                1 calls
        0 ms  GetReferenceAssemblyPaths                  1 calls
        0 ms  Copy                                       1 calls
       16 ms  CreateItem                                 2 calls
       21 ms  ResolveAssemblyReference                   1 calls
      641 ms  AspNetCompiler                             1 calls
      693 ms  MSBuild                                    2 calls

Build FAILED.

"C:\Development\test\test.sln" (default target) (1) ->
"C:\Development\test\test.metaproj" (default target) (2) ->
(Build target) ->
  C:\Development\test\test.metaproj : warning MSB3268: The primary reference "C:\Development\test\packages\Nager.Public
Suffix.2.4.0\lib\netstandard2.0\Nager.PublicSuffix.dll" could not be resolved because it has an indirect dependency on
the framework assembly "netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" which could not
 be resolved in the currently targeted framework. ".NETFramework,Version=v4.7.2". To resolve this problem, either remov
e the reference "C:\Development\test\packages\Nager.PublicSuffix.2.4.0\lib\netstandard2.0\Nager.PublicSuffix.dll" or re
target your application to a framework version which contains "netstandard, Version=2.0.0.0, Culture=neutral, PublicKey
Token=cc7b13ffcd2ddd51".


"C:\Development\test\test.sln" (default target) (1) ->
"C:\Development\test\test.metaproj" (default target) (2) ->
(Build target) ->
  c:\Development\test\Default.aspx.cs(3): error CS0246: The type or namespace name 'Nager' could not be found (are you
missing a using directive or an assembly reference?) [C:\Development\test\test.metaproj]

    1 Warning(s)
    1 Error(s)

Time Elapsed 00:00:00.75

to reproduce:

  • create new "ASP.NET Empty Website" project targeting 4.7.2
  • install nager.publicsuffix 2.4.0 via nuget
  • add new webform and add code that uses nager.publicsuffix
using System;
using System.Web;
using Nager.PublicSuffix;
public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        var host = HttpContext.Current.Request.Url.Host;
        var fileCache = new FileCacheProvider(cacheFileName: "testpublicsuffixcache.dat");
        var domainParser = new DomainParser(new WebTldRuleProvider(cacheProvider: fileCache));
        var domainInfo = domainParser.Parse(host);
        var regdom = domainInfo.RegistrableDomain;
    }
}
  • add <compilation debug="true" targetFramework="4.7.2"><assemblies><add assembly="netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" /></assemblies></compilation><httpRuntime targetFramework="4.7.2" /> to <web.server> in web.config
  • delete everything from /bin leaving only nager.publicsuffix.dll.refresh
  • open cmd and enter "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\MSBuild.exe" "C:\Development\test\test.sln"
0

There are 0 best solutions below