Skip to content

Too many open files - where "msbuild" 2> nul #240

@thefernman

Description

@thefernman

After 500 .sln files to build, I get a Too many open files - where "msbuild" 2> nul

Stacktrace:

C:/Projects/project/vendor/bundle/ruby/2.3.0/gems/albacore-3.0.1/lib/albacore/cross_platform_cmd.rb:205:in `popen'
C:/Projects/project/vendor/bundle/ruby/2.3.0/gems/albacore-3.0.1/lib/albacore/cross_platform_cmd.rb:205:in `which'
C:/Projects/project/vendor/bundle/ruby/2.3.0/gems/albacore-3.0.1/lib/albacore/task_types/build.rb:43:in `block in initialize'
C:/Projects/project/vendor/bundle/ruby/2.3.0/gems/albacore-3.0.1/lib/albacore/task_types/build.rb:47:in `initialize'
C:/Projects/project/vendor/bundle/ruby/2.3.0/gems/albacore-3.0.1/lib/albacore/dsl.rb:40:in `new'
C:/Projects/project/vendor/bundle/ruby/2.3.0/gems/albacore-3.0.1/lib/albacore/dsl.rb:40:in `block in build'
C:/Projects/project/vendor/bundle/ruby/2.3.0/gems/rake-10.0.4/lib/rake/task.rb:246:in `block in execute'
C:/Projects/project/vendor/bundle/ruby/2.3.0/gems/rake-10.0.4/lib/rake/task.rb:241:in `each'
C:/Projects/project/vendor/bundle/ruby/2.3.0/gems/rake-10.0.4/lib/rake/task.rb:241:in `execute'

res = IO.popen(cmd) do |io|

Portion of my rakefile

desc 'Build all customers'
task :build_customers do |t|
  logger.info 'Build customer dlls...'
  client_list_paths = Dir.glob(get_relative_path('../customers') + '/**/**/Web')
  client_list_paths.each do |dir|
    clean(dir)
    sln_path = dir + '/../Web.sln'
    out_dir = dir.gsub('/customers/','/build/') + '/Distrib'

    logger.info "Building: #{sln_path} out to #{out_dir}"
    build do |b|
      b.sln  = sln_path                         # alt. name
      b.target = ['Clean', 'Build']             # call with an array of targets or just a single target
      b.prop 'Configuration', 'Release'         # call with 'key, value', to specify a MsBuild property
      b.prop 'OutDir', out_dir                  # call with 'key, value', to specify a MsBuild property
      b.prop 'ToolsVersion' , '4.6'
      b.clp 'ShowEventId'                       # any parameters you want to pass to the console logger of MsBuild
      b.logging = 'm'                           # detailed logging mode. The available verbosity levels are: q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]
      b.nologo
    end
  end
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions