-Install Asp.net core 1.1.
-Use the aspnet-generator to create a ASP.net basic template.
-Run the "dotnet migrate" command to migrate to .csproj.
-Run "dotnet restore"
-Run "yo aspnet:class NewClass"
That should throw the error
OS version (Win/Mac/*Nix?)
Windows 10
NodeJS version
node --version
v6.6.0
Yeoman version
yo --version
1.8.5
Generator version
NPM 3.*:
npm list -g generator-aspnet
generator-aspnet@0.2.5
Notes
I think the error is caused by the file configuration.js. This file is made to find up a hardcoded 'project.json' inside the project, how this file does not exist anymore the baseDirectory var should be null. (Maybe could be done to support both cdproj and json???)
// Get the namespace relative to the cwd
getNamespace: function(fs) {
'use strict';
var baseNamespace = getBaseNamespace(fs);
var cwd = process.cwd();
var baseDirectory = path.resolve(path.dirname(this.getProjectCsprojPath()));
var relativePath = path.relative(baseDirectory, cwd);
if (relativePath) {
return [baseNamespace].concat(relativePath.split(path.sep)).join('.');
}
return baseNamespace;
},
getProjectJsonPath: function() {
'use strict';
return findup('project.json');
},
getProjectJson: function(fs) {
'use strict';
var path = module.exports.getProjectJsonPath();
if (!path) {
return {};
}
return fs.readJSON(path, {});
},
getGlobalJsonPath: function() {
'use strict';
return findup('global.json');
},
getGlobalJson: function(fs) {
'use strict';
var path = module.exports.getGlobalJsonPath(path);
if (!path) {
return {};
}
return fs.readJSON(path, {});
},
};
Short issue description
Migrating the project.json to the new .csproj format throws an error using the subgenerators.
Expected behavior
"yo aspnet:class Filename" should create the expected class
Actual behavior
"yo aspnet:class Filename" actually throws an "events.js:160 throw er; // Unhandled 'error' event"
Steps to reproduce the behavior
-Install Asp.net core 1.1. -Use the aspnet-generator to create a ASP.net basic template. -Run the "dotnet migrate" command to migrate to .csproj. -Run "dotnet restore" -Run "yo aspnet:class NewClass"
That should throw the error
OS version (Win/Mac/*Nix?)
Windows 10
NodeJS version
v6.6.0
Yeoman version
1.8.5
Generator version
NPM 3.*:
generator-aspnet@0.2.5
Notes
I think the error is caused by the file configuration.js. This file is made to find up a hardcoded 'project.json' inside the project, how this file does not exist anymore the baseDirectory var should be null. (Maybe could be done to support both cdproj and json???)