Skip to content

Instantly share code, notes, and snippets.

@GeorgDangl
Last active February 2, 2017 18:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GeorgDangl/d694a2d86593d989eb6474d4e64cb6fc to your computer and use it in GitHub Desktop.
Save GeorgDangl/d694a2d86593d989eb6474d4e64cb6fc to your computer and use it in GitHub Desktop.
Copy xBim Geometry Interop Dlls in the new project format in .Net
$xBimGeometryPackages = Join-Path -Path $env:USERPROFILE -ChildPath "\.nuget\packages\Xbim.Geometry"
$latestxBimGeometryPackage32 = Join-Path -Path ((Get-ChildItem -Path $xBimGeometryPackages | Sort-Object Fullname -Descending)[0].FullName) -ChildPath "build\x86\Xbim.Geometry.Engine32.dll"
$latestxBimGeometryPackage64 = Join-Path -Path ((Get-ChildItem -Path $xBimGeometryPackages | Sort-Object Fullname -Descending)[0].FullName) -ChildPath "build\x64\Xbim.Geometry.Engine64.dll"
if (!(Test-Path "$PSScriptRoot\Dependencies")){
New-Item -ItemType Directory -Path "$PSScriptRoot\Dependencies"
}
Copy-Item -Path $latestxBimGeometryPackage32 -Destination "$PSScriptRoot\Dependencies\Xbim.Geometry.Engine32.dll"
Copy-Item -Path $latestxBimGeometryPackage64 -Destination "$PSScriptRoot\Dependencies\Xbim.Geometry.Engine64.dll"
{
"dependencies": {
"Xbim.Essentials": "4.0.27",
"Xbim.Geometry": "4.0.11"
},
"frameworks": {
"net461": {
"imports": ["netstandard1.6"]
}
},
"buildOptions": {
"copyToOutput": {
"mappings": {
"Xbim.Geometry.Engine32.dll": "Dependencies/Xbim.Geometry.Engine32.dll",
"Xbim.Geometry.Engine64.dll": "Dependencies/Xbim.Geometry.Engine64.dll"
}
}
},
"publishOptions": {
"mappings": {
"Xbim.Geometry.Engine32.dll": "Dependencies/Xbim.Geometry.Engine32.dll",
"Xbim.Geometry.Engine64.dll": "Dependencies/Xbim.Geometry.Engine64.dll"
}
},
"scripts": {
"precompile": "Powershell -executionpolicy remotesigned -File copyGeometryInteropDlls.ps1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment