2014-04-11 8 views
6

से उपग्रह असेंबली को बहिष्कृत करता है क्या एमएसबिल्ड को एक निश्चित असेंबली के लिए उपग्रह asssemblies की प्रतिलिपि बनाने के लिए यह बताना संभव है?एमएसबिल्ड आउटपुट

मेरे पास एक nuget पैकेज है, जिसमें संसाधन असेंबली हैं, लेकिन मैं उन्हें अपने आउटपुट में शामिल नहीं करना चाहता हूं।

धन्यवाद।

+0

आप सेट किया है [CopyLocal = false] (http://stackoverflow.com/ क्यू/2481426/147211) – KMoraz

+1

मैं stil मैं असेंबली की प्रतिलिपि बनाना चाहता हूं, लेकिन सैटेलाइट असेंबली नहीं, जो कि नुजेट पैकेज में शामिल हैं। – DELUXEnized

उत्तर

0

आपके पास \ Build_Archive की तरह तैनाती के लिए एक अलग फ़ोल्डर हो सकता है जहां आउटपुट की प्रतिलिपि बनाई गई है - और अपनी असेंबली की प्रतिलिपि बनाने के लिए बिल्ड स्क्रिप्ट में कुछ लाइनें जोड़ें, लेकिन उन फ़ोल्डर्स को उपग्रह-असेंबली नहीं - इस तरह, Build_Archive हमेशा आपके पास तैनाती के लिए आवश्यक फाइलें हैं।

निर्माण # लेबल फ़ोल्डर में और वर्तमान फ़ोल्डर में मेरे वर्तमान स्क्रिप्ट प्रतियां यानी - तो वर्तमान हमेशा नवीनतम है, और हम पहले का एक इतिहास को बनाए रखने बनाता है - जैसे:

C:\Build_Archive\AppName\Current 
C:\Build_Archive\AppName\1.0.0.1 
C:\Build_Archive\AppName\1.0.0.2 

तो कुछ इस तरह अपने निर्माण स्क्रिप्ट के अंत में (अपना सामान के लिए <values> की जगह हमारी लिपि संस्करण संख्या, आदि तो यहाँ शामिल नहीं प्रबंधन करने के लिए एक बाहरी DLL उपयोग करता है।):

<!-- . . . --> 
<DropLocation>\\<serverName>\Build_Archive\${BuildDefinition}</DropLocation> 
<!-- . . . --> 

<!-- Version numbers major and build are replaced by outside calls not shown --> 
<PropertyGroup> 
    <VersionMajor>1</VersionMajor> 
    <VersionMinor>0</VersionMinor> 
    <VersionService>0</VersionService> 
    <VersionBuild>0</VersionBuild> 
</PropertyGroup> 

<Target Name="BuildNumberOverrideTarget"> 
<!-- Create a custom build number, matching the assembly version --> 
<!-- . . . --> 
<!-- … custom version code call – returns/sets VersionMajor and VersionBuild --> 
    <PropertyGroup> 
    <BuildNumber>$(BuildDefinitionName)_$(VersionMajor).$(VersionMinor).$(VersionService).$(VersionBuild)</BuildNumber> 
    </PropertyGroup> 
    <Message Text="Build number set to &quot;$(BuildNumber)&quot;" /> 
    <Message Text="$(SolutionRoot)"/> 
</Target> 


<Target Name="AfterCompile"> 
<!-- Call Copy process after the build --> 
    <CallTarget Targets="CleanUp"/> 
    <CallTarget Targets="StageBuild"/> 
    <CallTarget Targets="CopyFiles"/> 
</Target> 

<!-- Target : Clean Current Folder for next build --> 
<Target Name="CleanUp"> 
    <Message Text="**** Entering::CleanUp ****"/> 
    <CreateItem Include="\\<server name>\Build_Archive\<appName>\Current\**\*.*"> 
    <Output ItemName="PreviousFiles" TaskParameter="Include" /> 
    </CreateItem> 
    <Delete Files="@(PreviousFiles)" ContinueOnError="true" /> 
</Target> 

<!-- Target:StageBuild --> 
<Target Name="StageBuild"> 
<ItemGroup> 
    <BldCurrent Include="\\<server name>\Build_Archive\<appName>\Current\"/> 
</ItemGroup> 
<Message Text="@(BldCurrent)"/> 
<Message Text="$(SolutionRoot)"/> 
<!— Here – replace next line with commands to copy only the files you want to deploy --> 
    <Exec Command="xcopy /y /r /e $(SolutionRoot)\..\bin\*.* @(BldCurrent)"/> 
</Target> 

<!-- Target : Copy files from Current to BuildNum folder --> 
<Target Name="CopyFiles"> 
    <Exec Command="xcopy /y /r /e $(DropLocation)\Current\Debug\*.* $(DropLocation)\$(BuildNumber)\Debug\"/> 

    <Exec Command="Del /Q $(DropLocation)\Current\Debug\*.config"/> 
    <Exec Command="Del /Q $(DropLocation)\Current\Debug\*.dll"/> 
    <Exec Command="Del /Q $(DropLocation)\Current\Debug\*.exe"/> 
    <Exec Command="Del /Q $(DropLocation)\Current\Debug\*.application"/> 
    <Exec Command="Del /Q $(DropLocation)\Current\Debug\*.pdb"/> 
    <Exec Command="Del /Q $(DropLocation)\Current\Debug\*.txt"/> 
    <Exec Command="Del /Q $(DropLocation)\Current\Debug\*.xml"/> 
</Target> 
0

कोशिश इस पैरामीटर के साथ MSBuild कॉल करने के लिए:

/p:UseWPP_CopyWebApplication=True /p:PipelineDependsOnBuild=False 

यह VisualStudio के रूप में web.config रूपांतरण लागू करेगा। इसके अतिरिक्त, बिन फ़ोल्डर आउटपुट VisualStudio प्रकाशित में भी समान है। उपग्रह असेंबली सीधे बिन फ़ोल्डर में कॉपी नहीं की जाती हैं और उनके बिन उपफोल्डर्स में रहती हैं।

यह भी देखें:

संबंधित मुद्दे