2013-03-22 22 views
9
<MSBuild Projects="$(ProjectFile)" Targets="_WPPCopyWebApplication;" 
Properties="OutDir=..\publish;Configuration=Release;Platform=AnyCPU" /> 

Tôi đang sử dụng trên kịch bản để công bố dự án Asp.Net. Trong các thiết lập dự án, tôi đã hoàn toàn chắc chắn rằng các biểu tượng gỡ lỗi được tạo ra trong chế độ phát hành. Tuy nhiên MsBuild không tạo tệp pdb trong đầu ra.MSBuild không tạo ra các tập tin PDB trong cấu hình phát hành

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> 
    <DebugType>Full</DebugType> 
    <DefineDebug>false</DefineDebug> 
    <DefineTrace>true</DefineTrace> 
    <Optimize>true</Optimize> 
    <OutputPath>bin\</OutputPath> 
    <DocumentationFile>WebProject.xml</DocumentationFile> 
    <DebugSymbols>true</DebugSymbols> 
    </PropertyGroup> 
+0

Bạn đảm bảo rằng các biểu tượng gỡ lỗi được tạo như thế nào? Bạn đã đặt cài đặt nào cho cài đặt này? – TimVK

+0

@Syam Xin chào, tôi đang gặp vấn đề tương tự. 2 điều: Tôi chỉ trải qua điều này kể từ khi tôi chuyển sang vs2012, đây là trường hợp cho bạn quá? Hơn nữa, tôi nhận thấy rằng .pdbs * là * được tạo * nhưng sau đó chúng bị xóa ngay ở cuối của bản dựng. Việc này có xảy ra với bạn không? – bottlenecked

+0

@TimVK Tôi đã cập nhật câu hỏi với thông tin liên quan từ tệp vbproj – Syam

Trả lời

16

Sau khi xem nguồn Microsoft.Web.Publishing.targets, tôi đã tìm thấy biến (ExcludeGeneratedDebugSymbol) được đặt thành True in Release mode. Từ các nhận xét, có vẻ như họ muốn loại trừ các biểu tượng khỏi dự án WebSite, nhưng điều kiện không được thiết lập đúng cho dự án WebApplication.

Vì vậy, tôi đã quyết định ghi đè kịch bản xây dựng của mình từ các đối số người gọi và nó hoạt động như một sự quyến rũ. Tôi chưa xác định được bất kỳ tác dụng phụ nào có thể gây ra hoặc sử dụng tài sản không có giấy tờ để ổn định trong tương lai, nhưng nó hoạt động ngay bây giờ.

Từ Microsoft.Web.Publishing.target nộp

<!--For website we will always exclude debug symbols from publishing unless it is set explicitly by user in website publish profile--> 
    <ExcludeGeneratedDebugSymbol Condition="'$(ExcludeGeneratedDebugSymbol)'=='' And '$(_WebProjectType)' == 'WebSite'">True</ExcludeGeneratedDebugSymbol> 

    <ExcludeGeneratedDebugSymbol Condition="'$(ExcludeGeneratedDebugSymbol)'=='' And '$(Configuration)' == 'Release'">True</ExcludeGeneratedDebugSymbol> 
    <ExcludeGeneratedDebugSymbol Condition="'$(ExcludeGeneratedDebugSymbol)'==''">False</ExcludeGeneratedDebugSymbol> 

Tôi đã cập nhật kịch bản của tôi như sau.

<MSBuild Projects="$(ProjectFile)" Targets="_WPPCopyWebApplication;" 
Properties="OutDir=..\publish;Configuration=Release;Platform=AnyCPU"; ExcludeGeneratedDebugSymbol=false /> 
3

Bạn cũng có thể cập nhật hồ sơ (.pubxml) tập tin xuất bản của bạn để bao gồm giá trị tài sản. Tôi đã phải làm điều này ngày hôm nay với các bit xây dựng mới trong TFS Build 2015 để xuất bản web bao gồm các tệp .pdb. Xem nội dung ví dụ về tệp có thuộc tính được thêm vào dưới cùng.

<?xml version="1.0" encoding="utf-8"?> 
<!-- 
This file is used by the publish/package process of your Web project. You can customize the behavior of this process 
by editing this MSBuild file. In order to learn more about this please visit http://go.microsoft.com/fwlink/?LinkID=208121. 
--> 
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> 
    <PropertyGroup> 
    <WebPublishMethod>FileSystem</WebPublishMethod> 
    <SiteUrlToLaunchAfterPublish /> 
    <publishUrl>C:\Publish</publishUrl> 
    <DeleteExistingFiles>True</DeleteExistingFiles> 
    <LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration> 
    <LastUsedPlatform>Any CPU</LastUsedPlatform> 
    <ExcludeApp_Data>False</ExcludeApp_Data> 
    <LaunchSiteAfterPublish>False</LaunchSiteAfterPublish> 
    <ExcludeGeneratedDebugSymbol>false</ExcludeGeneratedDebugSymbol> 
    </PropertyGroup> 
</Project> 
Các vấn đề liên quan