Visual Studio 2012でASP.NET(webforms)Webサイトを公開すると、常にすべてのファイルがアップロードされます。画像でも?
変更されたファイルのみを公開する方法はありますか?
Visual Studio 2012でASP.NET(webforms)Webサイトを公開すると、常にすべてのファイルがアップロードされます。画像でも?
変更されたファイルのみを公開する方法はありますか?
参考までに:MicrosoftはVS 2012 Update#2でその機能を追加しました:
記録のために、VS2012の公開プロファイルにあった[変更されたファイルのみを公開する]チェックボックスは、VS2012の公開プロファイルから削除されました。1歩前進、2歩後退。
いいえ、VisualStudioの公開ウィザードはこれを提供していません。
ローカルで公開し、変更されたファイルのみを手動で更新することをお勧めします。
node-> npm->gulpwatchを使用してそれらを追跡します。このように、ファイルが変更されたときにのみアップロードされ、変更セットを追跡する必要はまったくありません。とにかく最近はみんなgulpを使うべきです。
すべてのアセットを個別に手動で管理したり、公開されたパッケージ全体をアップロードしなければならないのは、とんでもないことです。私は、最新の2015年版でさえ、ビジュアルスタジオにこれ以上良いものがないことを信じられません。本当に悲しい。
これが私のgulpスクリプトです(私はそれを本当にクリーンアップしました):
`
var gulp = require('gulp'),
gutil = require('gulp-util'),
vftp = require('vinyl-ftp');
var fconfig {
host: "127.0.0.1",
port: "21",
user: "root",
password: "top-secret-tacos",
simultaneous_connections: 5,
file_lock_delay: 450, // ms to wait for lock release. "meh".
local_path: ".",
remote_path: "/my_path/as_seen/in_ftp/",
globs: {
"/assets/src/**/*.*css",
"/assets/src/**/*.js",
"/assets/dist/**/*",
"/**/*.ascx", // track .net changes and upload instantly when saved.
// don't track visual studio stuff.
"!./obj/**/*",
"!./bin/**/*",
"!./packages/",
"!./App_LocalResources/**/*",
"!./vs/**/*",
"!./properties/**/*",
"!./node_modules/**/*"
}
};
// Add debounce to gulp watch for FTP
(function ftp_debounce_fix(){
var watch = gulp.watch;
// Overwrite the local gulp.watch function
gulp.watch = function(glob, opt, fn){
var _this = this, _fn, timeout;
// This is taken from the gulpjs file, but needed to
// qualify the "fn" variable
if ( typeof opt === 'function' || Array.isArray(opt) ) {
fn = opt;
opt = null;
}
// Make a copy of the callback function for reference
_fn = fn;
// Create a new delayed callback function
fn = function(){
if( timeout ){
clearTimeout( timeout );
}
console.log("Delayed Task setup[450].");
timeout = setTimeout( Array.isArray(_fn) ? function(){
_this.start.call(_this, _fn);
} : _fn, fconfig.file_lock_delay);
};
return watch.call( this, glob, opt, fn );
};
})();
function getFtpConnection() {
return vftp.create({
host: fconfig.host,
port: fconfig.port,
user: fconfig.user,
password: fconfig.pass,
parallel: fconfig.simultaneous_connections,
log: gutil.log
});
}
gulp.task('deploy', function() {
var conn = getFtpConnection();
return gulp.src(fconfig.globs, { base: fconfig.local_path, buffer: false })
.pipe( conn.newer( fconfig.remote_root ) ) // only upload newer files
.pipe( conn.dest( fconfig.remote_root ) )
;
});
gulp.task('deploy-watch', function() {
var conn = getFtpConnection();
gulp.watch(fconfig.globs)
.on('change', function(event) {
console.log('Changes detected! Uploading file "' + event.path + '", ' + event.type);
return gulp.src( [event.path], { base: fconfig.local_path, buffer: false } )
.pipe( conn.newer( fconfig.remote_root ) ) // only upload newer files
.pipe( conn.dest( fconfig.remote_root ) )
;
});
});`