开发者

MSBUILD publish does not publish a xsd schema file

I am using MSbuild to publish my webservices projects on the command line using the following command:

msbuild.exe MyWebservicesProjectPath\Services.csproj /t:ResolveReferences;_CopyWebApplication /p:Configuration=Release;BuildingProject=true;WebProjectOutputDir=c:\inetpub\wwwroot\webserviceDest;OutDir=c:\inetpub\wwwroot\webserviceDest\

Everything publishes fine except for .xsd files that are located in ProjectName\WebServices\Schema folder. what's happ开发者_如何学Goening here?

Thanks.


In your solution check the property of your .xsd file.

The default setting of this type of artifact for the "Copy to Output Directory" is "Do Not Copy".

Setting this to "Copy always" (or "Copy if newer") should fix your problem.

Project file sample

<ItemGroup>
    <None Include="XMLSchema1.xsd">
        <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
</ItemGroup>


In the solution explorer right click on .XSD file -> click Properties and change Build Action to "Content" under Advanced section.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜