Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Oct 01 2019 22:54
    AArnott closed #307
  • Oct 01 2019 22:54
    AArnott labeled #307
  • Oct 01 2019 22:54
    AArnott commented #307
  • Oct 01 2019 22:24
    ndrwrbgs commented #307
  • Sep 10 2019 14:31
    AArnott commented #307
  • Sep 10 2019 11:24
    RonenGlants commented #307
  • Aug 02 2019 14:43
    docwattsman commented #303
  • Aug 02 2019 14:39
    docwattsman commented #303
  • Jun 10 2019 21:26
    AArnott closed #309
  • Jun 10 2019 21:26
    AArnott commented #309
  • Jun 10 2019 21:26
    AArnott labeled #309
  • Jun 10 2019 21:23
    jerchap opened #309
  • May 21 2019 23:22
    AArnott closed #308
  • May 21 2019 23:22
    AArnott commented #308
  • May 21 2019 23:22
    AArnott labeled #308
  • May 21 2019 21:42
    AleRoe opened #308
  • Apr 24 2019 17:49
    ErikApption opened #307
  • Feb 14 2019 16:28
    joepeavey commented #297
  • Feb 14 2019 16:28
    joepeavey commented #297
  • Feb 13 2019 20:25
    joepeavey commented #297
Andrew Arnott
@AArnott
You rock, @kovalikp!
Andrew Arnott
@AArnott
Resolving references between two NuProj's seems to fail to execute all the $(VersionDependsOn) targets, resulting in a bad path being constructed if the version is being computed by a target. I'm looking into it.
Andrew Arnott
@AArnott
Already known issue #206. Fixed
Andrew Arnott
@AArnott
NuProj still references MSBuild 4.0, which makes testing modern NuGet functionality impossible since building requires MSBuild 14. Ironically, nuproj has never supported anything < MSBuild 12.0. I'm fixing up references now.
Andrew Arnott
@AArnott
Can you review #216, @kovalikp ?
Pavol Kovalik
@kovalikp
ok, will have a look
Andrew Arnott
@AArnott
After that, I'll submit a smaller PR for #217
Pavol Kovalik
@kovalikp
@AArnott do you think we could build NuProj.Tasks assembly for every major version of MSBuild release (4.0, 12.0, 14.0 and so on)
I've run into a problem that I cannot get a way around:
I'm trying to make a PowerShell module for MSBuild, and I'm testing it on a solution that contains NuProj project
The "AssignTargetFramework" task could not be instantiated from the assembly "..\packages\NuProj.0.10.48-beta-gea4a31bbc5\tools\NuProj.Tasks.dll". Please verify the task assembly has been built using the same version of the Microsoft.Build.Framework assembly as the one installed on your computer and that your host application is not missing a binding redirect for Microsoft.Build.Framework. Unable to cast object of type 'NuProj.Tasks.AssignTargetFramework' to type 'Microsoft.Build.Framework.ITask'.
Pavol Kovalik
@kovalikp
Since this is run as PS cmdlet, I cannot add a binding redirect for powershell.exe
I don't know any other workaround other than fixing it on NuProj side
Pavol Kovalik
@kovalikp
So, I can hack it by copying binding redirects from msbuild.exe.config to powershell.exe.config
Andrew Arnott
@AArnott
@kovalikp Well I'm certainly not a fan of hacking a shipping .config file. :worried:
I wonder if your powershell module could handle the AppDomain.AssemblyResolve event and return the other version as a runtime equivalent of a .config binding redirect.
Pavol Kovalik
@kovalikp
no, for some reason MSBuild does not raise AssemblyResolve event
Andrew Arnott
@AArnott
So I'm a little confused. Is your PS cmdlet actually invoking MSBuild APIs directly, or invoking msbuild.exe?
Because if you're invoking MSBuild APIs directly such that msbuild tasks execute within the powershell.exe process, I think that's fundamentally broken. The missing binding redirects that msbuild has and powershell.exe does not will break a lot more than just nuproj. MSBuild tasks should always execute within msbuild.exe
Pavol Kovalik
@kovalikp
it's invoking msbuild api
Andrew Arnott
@AArnott
I see. Well you could switch to spawning msbuild.exe. Or you could configure your BuildParameters to DisableInProcNode (IIRC). That way, all actual task executions happen out of proc, in msbuild.exe, and thus binding redirects will be applied appropriately.
yet you still have the rich logging and APIs that you are probably striving for.
Pavol Kovalik
@kovalikp
yeah, there is already a PS module that uses mbuild.exe
I wanted to make an improved vesion that can write target results (with items) into PS output
Andrew Arnott
@AArnott
That would be so cool.
Items with metadata, I hope?
Pavol Kovalik
@kovalikp
right
Andrew Arnott
@AArnott
awesome. Then yes, you'll want the MSBuild API. But you can still tell it to never build in-proc (a good idea in general) using the mechanism I suggested.
That should solve your binding redirect woes
Pavol Kovalik
@kovalikp
but that disables building .sln files
MSBUILD : error MSB4223: A node of the required type InProc could not be created :(
Andrew Arnott
@AArnott
whoa. Hmm.... I had no idea that limitation existed.
But I think I know how you can workaround that. Although it does involve a temporary file.
MSBuild.exe has a special switch that will produce an MSBuild project from a .sln file. You could invoke that (by spawning the process). Then you can tell your MSBUild API to build the msbuild project instead of the sln file.
Pavol Kovalik
@kovalikp
build a sln into metaproj (or something like that)
Andrew Arnott
@AArnott
yes, metaproj I think is how it's named.
I don't remember the switch though.
Pavol Kovalik
@kovalikp
ok, worth the try
Andrew Arnott
@AArnott
@kovalikp: have you seen this? https://github.com/KirillOsenkov/MSBuildStructuredLog
It has a freakin' awesome msbuild log viewer including properties, items, and metadata for every target.
Pavol Kovalik
@kovalikp
Yeah, found it just couple days ago.
Pavol Kovalik
@kovalikp
Maybe I could invoke msbuild.exe with custom logger and then push the results back to PS via WCF managed pipiline.
Aloïs de Gouvello
@aloisdg
Hello, is it possible to set a package as pre release from VS with nuproj?
Pavol Kovalik
@kovalikp
yeah, just set Version in project properties to 1.0.0-alpha or something like that
Aloïs de Gouvello
@aloisdg
ok thank you
@kovalikp indeed. Find it. https://docs.nuget.org/create/versioning
Aloïs de Gouvello
@aloisdg

new question. How to use nuproj with appveyor? I tried to run it naively and appveyor throws this during the build:

  Harmony -> C:\projects\harmony\Harmony\bin\Debug\Harmony.dll
  Harmony.Tests -> C:\projects\harmony\Harmony.Tests\bin\Debug\Harmony.Tests.dll
C:\projects\harmony\Harmony.Package\Harmony.Package.nuproj(41,3): error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\NuProj\NuProj.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
Command exited with code 1

How can I config appveyor to build my package?

(Also should I move this to an issue?)
Andrew Arnott
@AArnott
Install the NuProj nuget package to one of your projects, then modify your NuProj to get its imports from the restored package. It works on AppVeyor.
Aloïs de Gouvello
@aloisdg
@AArnott If I add the NuProj nuget package to the main lib or my lib nuproj project?
@AArnott "modify your NuProj to get its imports from the restored package." how?