RC2 : project.json => postbuild
I need to use post build event so I tried to put a simple command in the postbuild attribute inside scripts. Seems to not working cause it does nothing
Any workaround or maybe i did not understand how it supposed to work
Here what I tried
"scripts": { "postbuild": [ "xcopy /Q /Y "%project:Directory%\class1.cs" "%project:Directory%\Test\class1.cs"" ] }
I attached a sample ClassLibrary1.zip
it's postcompile now
postcompile is not a valid value for scripts attribute, does not exist
Sure it is:
https://github.com/dotnet/cli/blob/0b30b148f326dfbeeb45692a06a7d258e2fc08ad/TestAssets/TestProjects/TestAppWithScripts/project.json#L31-L36
It might be a schema issue.
The schema was fixed recently https://github.com/SchemaStore/schemastore/pull/178
Tried with postcompile and a simple xcopy still does nothing
"scripts": {
"postcompile": [
"xcopy /Q /Y \"C:\\Users\\User\\Documents\\doc.txt\" \"C:\\Users\\User\\Documents\\test\""
],
"prepublish": [ "npm install", "bower install", "gulp clean", "gulp min" ],
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
}
The same command on "cmd" is working well
@marcusien, I ran your sample with postcompile and I saw that xcopy is being executed. I got this output from the xcopy command
Does C:\Github\random\ClassLibrary1\Test\class1.cs specify a file name
or directory name on the target
(F = file, D = directory)?
Is this not the case when you run with postcompile instead of postbuild?
@ajaybhargavb I just retried with my sample and just replace postbuild by postcompile and it's still not doing anything and nothing special written in the VS Output window
I ran it in VS as well and I see this Does C:\GitHub\random\ClassLibrary1\Test\class1.cs specify a file name 1> or directory name on the target. This is from the xcopy command. Are you sure you don't see this output? Also could you try running dotnet build in command line?
Yes I'm sure I don't see it in the output ^^
However, I tried running dotnet build on my project directory from "cmd" and I see the message "Does ... specify a file name...or directory name on the target".
It could mean that my VS does not use dotnet build to build my xproj ?
@marcusien It make sense to move this to dotnet/cli, it's not an MVC issue.
So what should I do ? :)
@marcusien, I suspect this is just a path issue. VS might be using a really old version of dotnet. Check your Path and see if it has the location of latest dotnet. Also, could you file this issue in https://github.com/dotnet/cli/issues? This is completely unrelated to MVC.