我试试Rider,到目前为止,非常喜欢它。
我在Visual Studio中使用的一个功能通常是右键单击Web项目并发布到我们的测试服务器。
我在Rider中找不到类似的选项,所以我所做的是创建一个运行配置,并使用以下设置:
Exe path: C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/MSBuild/15.0/Bin/amd64/msbuild.exe
Arguments: MySolution.sln /m /p:DeployOnBuild=True /p:PublishProfile=My-Project "/p:platform=Any CPU" /p:configuration=Release /p:VisualStudioVersion=15.0 /p:Password=****
Working Directory: C:\SolutionFolder
当我想发布时,我从下拉列表中选择它并单击运行 这100%工作。
我的问题是,这是最好的方法吗,没有设置CI管道?我在IDE中缺少选项或设置吗?
答案 0 :(得分:7)
截至2018年6月,Rider doesn't have UI for publishing。
登录YouTrack后,您可以投票给feature request。
作为一种变通办法,您可以像以前一样创建“ .NET可执行文件”配置,并在要发布项目时运行它。
更详细的说明如下:
C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/MSBuild/15.0/Bin/amd64/MSBuild.exe
)YourSolution.sln /t:"Your_Project" /p:PublishProfile=YourPublishProfile.pubxml /p:Configuration=Debug /p:DeployOnBuild=true /m
C:/path/to/solution/dir/
注意:
Properties/PublishProfiles
下的项目文件夹中。如果没有,则可以从下面报告的示例开始; Your.Project
作为Your_Project
传递; /p:PublishDir="C:/path/to/publish/dir/"
; 发布个人资料的示例:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebPublishMethod>FileSystem</WebPublishMethod>
<LastUsedBuildConfiguration>Debug</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish />
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<ExcludeApp_Data>False</ExcludeApp_Data>
<publishUrl>..\YourPublishDirectory</publishUrl>
<DeleteExistingFiles>True</DeleteExistingFiles>
<ExcludeFilesFromDeployment>bin\*.dll.config</ExcludeFilesFromDeployment>
</PropertyGroup>
</Project>
答案 1 :(得分:0)
最新版本的Rider支持通过UI发布。如果您的计算机上未安装Visual Studio,请确保该Web项目已安装Build.Microsoft.VisualStudio.Web.targets
nuget程序包。