简体   繁体   English

ASP.net Web应用程序项目目录结构

[英]ASP.net Web Application Project directory structure

I've recently converted an ASP.net 2.0 Web Site Project to an ASP.net 3.5 Web Application Project and I'm still getting used to the way the files are structured. 我最近将ASP.net 2.0网站项目转换为ASP.net 3.5 Web应用程序项目,我仍然习惯了文件的结构。

The problem I'm running into is that when I build the corresponding Web Deployment Project it copies the obj directory. 我遇到的问题是,当我构建相应的Web部署项目时,它会复制obj目录。 But its my understanding that the obj directory is just intermediary and doesn't provide any useful purpose for a deployed website right? 但我的理解是obj目录只是中介,并没有为部署的网站提供任何有用的目的吗?

If that is correct, is there some way to configure the Web Application Project to put the intermediary obj directory elsewhere, or is there something else I should be doing to handle this properly? 如果这是正确的,有没有办法配置Web应用程序项目将中间obj目录放在别处,或者我还应该做些什么来正确处理这个问题?

Just add in the .csproj_deploy file the following 只需在.csproj_deploy文件中添加以下内容即可

<Target Name="AfterBuild">
    <Message Text="------ Deleting unwanted files ------" Importance="high" />
    <CreateItem Include="$(OutputPath)obj">
        <Output TaskParameter="Include" ItemName="ObjDirPattern"/>
    </CreateItem>
    <RemoveDir Directories="@(ObjDirPattern)">
        <Output TaskParameter="RemovedDirectories" PropertyName="objdir" />
    </RemoveDir>
    <Message Text="Deleted obj directory: $(objdir)" Importance="high" />
</Target>

For more see http://msdn.microsoft.com/en-us/library/7z253716.aspx 有关更多信息,请参阅http://msdn.microsoft.com/en-us/library/7z253716.aspx

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM