1

У меня возникло серьезное горе, пытающееся опубликовать мое приложение mvc6 из-за блокировки файла powershell. Я запустил powershell в качестве администратора и скорректировал политику выполнения. Но, похоже, это не влияет на процесс публикации в vs2015. Кроме того, я даже тщетно пытался запустить командлет Unblock-File в NPM.не удалось опубликовать приложение mvc6 из-за сбоя invokepowershell в vs2015

У кого-нибудь есть идеи о том, как я могу заставить это работать? полная ошибка ниже:

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Web\Microsoft.DNX.Publishing.targets(386,5): Error MSB4018: The "InvokePowerShell" task failed unexpectedly. 
System.Management.Automation.PSSecurityException: AuthorizationManager check failed. ---> System.Management.Automation.Host.HostException: A command that prompts the user failed because the host program or the command type does not support user interaction. The host was attempting to request confirmation with the following message: Run only scripts that you trust. While scripts from the internet can be useful, this script can potentially harm your computer. If you trust this script, use the Unblock-File cmdlet to allow the script to run without this warning message. Do you want to run G:\_PIPELINE_MANAGEMENT\_SOURCE\_MANAGEMENT\_2016\ProjMgr\src\ProjMgr\Properties\PublishProfiles\ProjMgr-publish.ps1? 
    at System.Management.Automation.Internal.Host.InternalHostUserInterface.ThrowPromptNotInteractive(String promptMessage) 
    at System.Management.Automation.Internal.Host.InternalHostUserInterface.PromptForChoice(String caption, String message, Collection`1 choices, Int32 defaultChoice) 
    at Microsoft.PowerShell.PSAuthorizationManager.RemoteFilePrompt(String path, PSHost host) 
    at Microsoft.PowerShell.PSAuthorizationManager.CheckPolicy(ExternalScriptInfo script, PSHost host, Exception& reason) 
    at Microsoft.PowerShell.PSAuthorizationManager.ShouldRun(CommandInfo commandInfo, CommandOrigin origin, PSHost host, Exception& reason) 
    at System.Management.Automation.AuthorizationManager.ShouldRunInternal(CommandInfo commandInfo, CommandOrigin origin, PSHost host) 
    --- End of inner exception stack trace --- 
    at System.Management.Automation.Runspaces.AsyncResult.EndInvoke() 
    at System.Management.Automation.PowerShell.EndInvoke(IAsyncResult asyncResult) 
    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() 
       Done executing task "InvokePowerShell" -- FAILED. 
       Done building target "PowerShellPublish" in project "ProjMgr.xproj" -- FAILED. 
     Done building project "ProjMgr.xproj" -- FAILED. 
     Done executing task "MSBuild" -- FAILED. 
     Done building target "FileSystemPublish" in project "ProjMgr.xproj" -- FAILED. 
Done building project "ProjMgr.xproj" -- FAILED. 

2>Publish failed due to build errors. Check the error list for more details. 
+0

Попробуйте запустить VS как администратор. – dburner

+0

Извините, должно быть, упомянул, что это была одна из первых вещей, которые я попробовал и – xxdefaultxx

ответ

0

Мне удалось опубликовать его, скопировав всю мою папку проекта в корень моего локального. Должна быть проблема с правами доступа к папке ...

2

Создайте еще один профиль публикации и повторите попытку. Для меня это работает.