我是asp.net的新手。我创建了一个Web应用程序并在appharbor.com中托管。我在项目下面创建了一个文件夹来存储用户上传的文件(\ photo \ product)。但是,此文件夹不会在每个部署中保留。有没有解决这个问题的常用方法?任何指南都会有所帮助。
答案 0 :(得分:0)
我假设您正在使用WebDeploy将应用程序部署到AppHarbor。您可以指示WebDeploy不使用以下MSBuild参数从MSBuild删除服务器上的现有文件:
visited = set()
def disableControls(control):
visited.add(control)
try:
for childNumber in xrange(VisualTreeHelper.GetChildrenCount(control)):
child = VisualTreeHelper.GetChild(control, childNumber)
if hasattr(child, 'Content') and child.Content not in visited:
disableControls(child.Content)
if type(child) in [Button, ComboBox, CheckBox]:
child.IsEnabled = False
elif type(child) == TextBox:
child.IsReadOnly = True
elif child not in visited:
disableControls(child)
except:
pass
disableControls(self.windowOwner)
使用以下参数在MSDeploy部署期间执行OR:
/p:SkipExtraFilesOnServer=true