我有VS2015 + SP1 + Visual Studio 2015 Tools for Docker v0.9.1。
当我尝试发布控制台应用时,我收到此错误:
1>------ Build started: Project: ConsoleApp, Configuration: Release Any CPU ------
1>
1> Build succeeded.
1> 0 Warning(s).
1> 0 Error(s).
1>
1> Time elapsed 00:00:00.3872322
1>
2>------ Publish started: Project: ConsoleApp, Configuration: Release Any CPU ------
Environment variables:
Path=C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\extensions\microsoft\web tools\external;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\NativeBinaries\x86;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Windows Azure Tools\Docker\;C:\Program Files\CollabNet\Subversion Client;C:\blp\API;C:\blp\API\dde;C:\oracle\product\11.2.0\client_1\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files (x86)\Microsoft Office\Office14;C:\Program Files (x86)\Enterprise Vault\EVClient\;c:\Program Files (x86)\Man\Electronic Trading;C:\Windows\SysWOW64\;C:\Windows\SysWOW64\Wbem;C:\Windows\SysWOW64\WindowsPowerShell\v1.0;C:\Program Files (x86)\RMF\RMFQL\Bin\Win32;C:\Program Files (x86)\InstallShield\AdminStudio\6.0\ConflictSolver;C:\Program Files (x86)\TIBCO\TIBRV\BIN;C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files\Microsoft SQL Server\110\DTS\Binn\;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies\;C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\PrivateAssemblies\;C:\Program Files\TortoiseSVN\bin;C:\Program Files\SlikSvn\bin;C:\Program Files (x86)\svn;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files (x86)\Microsoft Application Virtualization Client;C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files (x86)\Git\cmd;C:\Program Files (x86)\Git\bin;C:\Program Files (x86)\GitExtensions\;C:\Program Files\Microsoft DNX\Dnvm\;C:\Users\gravitas\.dnx\bin;C:\blp\DAPI;C:\blp\DAPI\DDE;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\extensions\microsoft\web tools\external\.git
C:\Users\gravitas\.dnx\runtimes\dnx-clr-win-x86.1.0.0-rc1-update1\bin\dnu.cmd publish "C:\Docker\ConsoleApp\src\ConsoleApp" --out "C:\Users\gravitas\AppData\Local\Temp\PublishTemp\ConsoleApp52" --configuration Release --runtime dnx-clr-win-x86.1.0.0-rc1-update1 --quiet
Microsoft .NET Development Utility Clr-x86-1.0.0-rc1-16231
Copying to output path C:\Users\gravitas\AppData\Local\Temp\PublishTemp\ConsoleApp52
Time elapsed 00:00:00.3091962
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Web\Microsoft.DNX.Publishing.targets(386,5): Error MSB4018: The "InvokePowerShell" task failed unexpectedly.
System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.Web.Publishing.Tasks.InvokePowerShell.GetMSDeployPath()
at Microsoft.Web.Publishing.Tasks.InvokePowerShell.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
2>Publish failed due to build errors. Check the error list for more details.
========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ==========
========== Publish: 0 succeeded, 1 failed, 0 skipped ==========
我已经尝试了过去几个小时内我能想到的一切,包括许多目标组合(x32与x64,CORE与CLR等)。
答案 0 :(得分:1)
我得出了一个相当不舒服的结论:我不认为微软真的喜欢免费版的Docker。他们喜欢Docker的付费版本(即Azure Containers)。我相信他们正在推动经典vendor capture trick。
证明?适用于Docker的Visual Studio 2015工具:
结论:
Visual Studio 2015 Tools for Docker
使用Docker多么不可能而感到沮丧。它从来没有打算让你访问除Azure之外的任何东西。为了避免混淆,它应该被称为Azure Tools for Visual Studio
。如果您希望我发布有关如何将.NET项目发布到Docker / MONO的完整解决方案,请告诉我。