Reputation: 106
The project I am working on was originally created using the templates in Visual Studio 2015 RC and Beta 4 of vNext. (Edit - now using Beta 6 and VS2015 RTM.) I'm in the process of learning Team Foundation Server in order to automate the build.
However, in TFS the build is failing with the following error
1> Using Assembly dependency framework/fx/System.Security 4.0.0.0 (TaskId:28)
1> Source: C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\System.Security.dll (TaskId:28)
1> The following commands will not be exported for global install: web. (TaskId:28)
1> Exported application command: gen (TaskId:28)
1> Exported application command: ef (TaskId:28)
1> System.ArgumentException: Illegal characters in path. (TaskId:28)
1> at System.IO.Path.CheckInvalidPathChars(String path, Boolean checkAdditional) (TaskId:28)
1> at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) (TaskId:28)
1> at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize) (TaskId:28)
1> at System.IO.File.Create(String path, Int32 bufferSize) (TaskId:28)
1> at Microsoft.Framework.PackageManager.BuildManager.BuildInternal(String projectPath) (TaskId:28)
1> at Microsoft.Framework.PackageManager.BuildManager.Build() (TaskId:28)
1> at Microsoft.Framework.PackageManager.PackConsoleCommand.<>c__DisplayClass0_0.<Register>b__1() (TaskId:28)
1> at Microsoft.Framework.Runtime.Common.CommandLine.CommandLineApplication.Execute(String[] args) (TaskId:28)
1> at Microsoft.Framework.PackageManager.Program.Main(String[] args) (TaskId:28)
1> --- End of stack trace from previous location where exception was thrown --- (TaskId:28)
1> at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() (TaskId:28)
1> at Microsoft.Framework.Runtime.Common.EntryPointExecutor.Execute(Assembly assembly, String[] args, IServiceProvider serviceProvider) (TaskId:28)
1> at dnx.host.Bootstrapper.RunAsync(List`1 args, IRuntimeEnvironment env, FrameworkName targetFramework) (TaskId:28)
1> at dnx.host.RuntimeBootstrapper.ExecuteAsync(String[] args, FrameworkName targetFramework) (TaskId:28)
1> at dnx.host.RuntimeBootstrapper.Execute(String[] args, FrameworkName targetFramework) (TaskId:28)
1>Done executing task "Dnx" -- FAILED. (TaskId:28)
1>Done building target "CoreCompile" in project "Redacted.xproj" -- FAILED.: (TargetId:50)
I finally managed to reproduce this on my local build by checking the "Produce outputs on build" in the project properties. That lets me rule out TFS, but doesn't solve the problem.
As I understand it, that option causes the "dnu pack" command to be called. This seems to be creating a NuGet package which is not needed for our project.
1) Is there a way to not create the NuGet package and still get the dependencies I need in the project (gulp, rimraf, etc...)? That is, can I cause TFS not to try to run dnu pack?
2) Is there a way to see the string that is causing the build error? (I'm already at the "diagnostic" verbosity.)
3) Is there a way to resolve the build error?
global.json:
{
"projects": [ "src", "test" ],
"sdk": {
"version": "1.0.0-beta6"
}
}
package.json
{
"name": "Redacted",
"version": "1.0.0",
"private": true,
"devDependencies": {
"gulp": "3.9.0",
"rimraf": "2.4.3",
"gulp-bower": "0.0.10",
"gulp-jshint": "^1.11.2",
"jshint-stylish": "^2.0.1"
}
}
project.json
{
"webroot": "wwwroot",
"userSecretsId": "aspnet5-Redacted-bdc273d1-1032-4bbe-8278-f448c6d1d546",
"version": "1.0.0-beta6*",
"dependencies": {
"EntityFramework": "6.1.3",
"Microsoft.AspNet.Mvc": "6.0.0-beta6",
"Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-beta6",
"Microsoft.AspNet.Diagnostics": "1.0.0-beta6",
"Microsoft.AspNet.Server.IIS": "1.0.0-beta6",
"Microsoft.AspNet.Server.WebListener": "1.0.0-beta6",
"Microsoft.AspNet.Session": "1.0.0-beta6",
"Microsoft.AspNet.StaticFiles": "1.0.0-beta6",
"Microsoft.AspNet.Tooling.Razor": "1.0.0-beta6",
"Microsoft.Framework.Configuration": "1.0.0-beta6",
"Microsoft.Framework.Configuration.Json": "1.0.0-beta6",
"Microsoft.Framework.Logging": "1.0.0-beta6",
"Microsoft.Framework.Logging.Console": "1.0.0-beta6",
"Microsoft.AspNet.Mvc.Core": "6.0.0-beta6",
"Microsoft.AspNet.Antiforgery": "1.0.0-beta6",
"AutoMapper": "4.0.4",
"HtmlAgilityPack": "1.4.9",
"evopdf": "6.0",
"Vereyon.Web.HtmlSanitizer": "1.1.1"
},
"commands": {
"web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --server.urls http://redacted:80;https://redacted:443",
"gen": "Microsoft.Framework.CodeGeneration",
"ef": "EntityFramework.Commands"
},
"frameworks": {
"dnx451": {
"frameworkAssemblies": {
"System.Diagnostics.Debug": "",
"System.Data": "",
"System.Data.Entity": ""
}
}
},
"exclude": [
"wwwroot",
"node_modules",
"bower_components"
],
"publishExclude": [
"node_modules",
"bower_components",
"**.xproj",
"**.user",
"**.vspscc"
],
"scripts": {
"postrestore": [ "npm install", "bower install" ],
"prepare": [ "gulp copy" ]
}
}
Upvotes: 2
Views: 1217
Reputation: 5141
You will get this error if there is a space in the folder for your project (which can be different than your project name itself).
Upvotes: 0
Reputation: 106
I don't have an answer for parts 1 and 2, but here's the answer to part 3:
Line 4 of project.json has this:
"version": "1.0.0-beta6*",
The "Illegal characters in path" is the asterisk at the end of that line. I figured this out by creating a new project from scratch and slowly copying settings over from the old project until something broke.
Upvotes: 3