## Where communities thrive

• Join over 1.5M+ people
• Join over 100K+ communities
• Free without limits
##### 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
Pavol Kovalik
@kovalikp
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'.
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.
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?
Andrew Arnott
@AArnott
Either one. I prefer to add it to my nuproj itself.
You can modify it by setting the NuProjPath property in the project file as I do here
In my case, I use a project.json file to bring in the NuProj package dependency.
Aloïs de Gouvello
@aloisdg
@AArnott I guess you used a project.json because we cant add a package with nuget to a nuproj project?
Andrew Arnott
@AArnott
Yes. And because project.json rocks. 😄
Andrew Arnott
@AArnott
VS Gallery finally has an update to the NuProj.msi. :)
Pavol Kovalik
@kovalikp
:+1:
Pedro Lamas
@PedroLamas
@terrajobst hope I didn't talk to much in suggesting adding to .NET Foundation! :)
Immo Landwerth
@terrajobst
No way! It's a great suggestion. It's just Twitter sucks for longer conversation. Driving to work now. I need a keyboard ;-)
Pavol Kovalik
@kovalikp
maybe that would make me to finally sign the CLA :D
Andrew Arnott
@AArnott
netstandard support is getting pretty important. I've heard of lots of people asking for it. I haven't studied NuProj's way of dealing with individual target frameworks yet. Is anyone else able to take a look or should I dive in?