aspnet / vsweb-publish

Web publish support for ASP.NET 5 in Visual Studio 2015
Other
33 stars 22 forks source link

Passing the pubProfile path needs to be optional #40

Closed vijayrkn closed 8 years ago

vijayrkn commented 8 years ago

Right now the script fails when the publishProperties is populated but the pubProfile path is not provided. pubProfilePath should be optional

sayedihashimi commented 8 years ago

How are tests passing then?

vijayrkn commented 8 years ago

Invoking the scripts from VS was failing. Not the tests. I have made the changes in VS to pass the pubProfilePath for now. Once this issue is fixed, will revert the change in VS.

sayedihashimi commented 8 years ago

So it's the bug in vs or in the script/module?

vijayrkn commented 8 years ago

The bug is in the module. PubProfilePath has a notnull check. This check needs to be removed. I can make this change. Will also add a test to test this scenario.

sayedihashimi commented 8 years ago

@vijayrkn OK thanks, i see it now. I was just trying to make sure that I understood why it's failing in VS but not the command line. From the command line the validate checks are only invoked if the -pubProfilePath parameter is passed. From VS I'm guessing that you always pass it and sometimes the value is null.

vijayrkn commented 8 years ago

From VS it is failing even if I am not passing the parameter at all -pubProfilePath.

Cannot validate argument on parameter 'pubProfilePath'. The argument is null, empty, or an element of the argument collection contains a null value. Supply a collection that does not contain any null values and then try the command again.

If I remove the validation on pubProfilePath it works. [Parameter(Position=2,ValueFromPipelineByPropertyName=$true)] [ValidateNotNull()] [ValidateScript({Test-Path $_})] [System.IO.FileInfo]$pubProfilePath

sayedihashimi commented 8 years ago

Go ahead and remove it.