I have a project that I used to deploy as a single executable, but I am no longer able to as the Publish process throws while trying to resolve the nugest. The project builds fine during the publish process and it also runs fine from visual studio.
My publish results:
========== Build: 7 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========
========== Publish: 0 succeeded, 1 failed, 0 skipped ==========
I get a popup with this error:
08/12/2021 21:35:26
System.AggregateException: One or more errors occurred. ---> Microsoft.WebTools.Shared.Exceptions.WebToolsException: Publish has encountered an error. We were unable to determine the cause of the error. Check the output log for more details.
--- End of inner exception stack trace ---
---> (Inner Exception #0) Microsoft.WebTools.Shared.Exceptions.WebToolsException: Publish has encountered an error. We were unable to determine the cause of the error. Check the output log for more details. <---
Microsoft.WebTools.Shared.Exceptions.WebToolsException: Publish has encountered an error. We were unable to determine the cause of the error. Check the output log for more details.
===================
And in the Error view I get this:
Severity Code Description Project File Line Suppression State
Error MSB4018 The "ResolvePackageDependencies" task failed unexpectedly.
System.ArgumentException: Invalid framework version '3.1/win-x64'.
at NuGet.Frameworks.NuGetFramework.ParseFrameworkNameParts(IFrameworkNameProvider mappings, String[] parts, String& framework, Version& version, String& profile)
at NuGet.Frameworks.NuGetFramework.ParseFrameworkName(String frameworkName, IFrameworkNameProvider mappings)
at NuGet.Frameworks.NuGetFramework.Parse(String folderName, IFrameworkNameProvider mappings)
at Microsoft.NET.Build.Tasks.ResolvePackageDependencies.<GetPackageAndFileDefinitions>b__48_5(String tg)
at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()
at System.Linq.Enumerable.Contains[TSource](IEnumerable`1 source, TSource value, IEqualityComparer`1 comparer)
at System.Linq.Enumerable.Contains[TSource](IEnumerable`1 source, TSource value)
at Microsoft.NET.Build.Tasks.ResolvePackageDependencies.<>c__DisplayClass48_1.<GetPackageAndFileDefinitions>b__3(IAssetsLogMessage log)
at System.Linq.Enumerable.WhereListIterator`1.MoveNext()
at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source)
at Microsoft.NET.Build.Tasks.ResolvePackageDependencies.<GetPackageAndFileDefinitions>g__GetPackageDiagnosticLevel|48_0(LockFileLibrary package)
at Microsoft.NET.Build.Tasks.ResolvePackageDependencies.GetPackageAndFileDefinitions()
at Microsoft.NET.Build.Tasks.ResolvePackageDependencies.ExecuteCore()
at Microsoft.NET.Build.Tasks.TaskBase.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() TextureEditor C:\Program Files\dotnet\sdk\6.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets 195
This is the configuration I am trying to build with:
If interested, the project can be found here: https://github.com/olekristianhomelien/TheAssetEditor
Any ideas what is going wrong?
Related
I am encountering the following error on the SonarQube Scanner for MSBuild - End Analysis build task in Visual Studio Team Services.
2017-06-12T14:35:00.1131070Z SonarQube found 7 issues out of which 1 are new
2017-06-12T14:35:00.1131070Z
2017-06-12T14:35:00.1443593Z
2017-06-12T14:35:00.1599853Z ##[error]System.Management.Automation.RuntimeException: Internal Error: expected E:\\CI02\16\s to be a parent of E:\CI02\16\s\path\to\my\file.cs ---> System.Management.Automation.RuntimeException: Internal Error: expected E:\\CI02\16\s to be a parent of E:\CI02\16\s\path\to\my\file.cs
2017-06-12T14:35:00.1599853Z --- End of inner exception stack trace ---
2017-06-12T14:35:00.1599853Z at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
2017-06-12T14:35:00.1599853Z at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke)
2017-06-12T14:35:00.1599853Z at System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse, Boolean isSync)
2017-06-12T14:35:00.1599853Z at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
2017-06-12T14:35:00.1599853Z at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
2017-06-12T14:35:00.1599853Z at Microsoft.TeamFoundation.DistributedTask.Handlers.LegacyVSTSPowerShellHost.VSTSPowerShellHost.Main(String[] args)
2017-06-12T14:35:00.1756102Z ##[error]LegacyVSTSPowerShellHost.exe completed with return code: -1.
2017-06-12T14:35:00.1756102Z ##[section]Finishing: Complete the SonarQube analysis
As you can see from the logs it is failing because E:\\CI02\16\s is not a parent of E:\CI02\16\s\path\to\my\file.cs (note the different number of backslashes after E:).
From looking at the build task's source code I can see that it is expecting the the file path to start with the value of the Build.Repository.LocalPath task context variable. I can't see why there is a difference in the number of slashes though.
This only occurrs when the build is triggered from a pull request. If I queue the build manually it succeeds without issue.
I am using version 2.1.2 of SonarQube for Team Services.
Does anyone know a way around this issue or have any suggestions?
The issue resolved itself. I retriggered the build from a pull request the next morning and it succeeded without issue.
I m getting below error while starting sonar analysis in tfs build task.
Please Help !
*************************************************************************
Starting task: Fetch the Quality Profile from SonarQube
******************************************************************************
Executing the powershell script:
D:\kannappan_sonar\tasks\SonarQubePreBuild\1.0.35\SonarQubePreBuild.ps1 SonarQube Scanner for MSBuild 1.1
Default properties file was found at D:\kannappan_sonar\tasks\SonarQubePreBuild\1.0.35\MSBuild.SonarQube.Runner-1.1\SonarQube.Analysis.xml
Loading analysis properties from D:\kannappan_sonar\tasks\SonarQubePreBuild\1.0.35\MSBuild.SonarQube.Runner-1.1\SonarQube.Analysis.xml
Pre-processing started.
Preparing working directories...
Checking for updates...
Unhandled Exception: System.Net.WebException: The remote server returned an error: (401) Unauthorized.
at System.Net.WebClient.DownloadDataInternal(Uri address, WebRequest& request)
at System.Net.WebClient.DownloadString(Uri address)
at System.Net.WebClient.DownloadString(String address)
at SonarQube.TeamBuild.PreProcessor.WebClientDownloader.Download(String url)
at SonarQube.TeamBuild.PreProcessor.SonarWebService.GetProperties(String projectKey, String projectBranch)
at SonarQube.TeamBuild.PreProcessor.TeamBuildPreProcessor.FetchArgumentsAndRulesets(ISonarQubeServer server, ProcessedArgs args, TeamBuildSettings settings, IDictionary`2& serverSettings, List`1& analyzersSettings)
at SonarQube.TeamBuild.PreProcessor.TeamBuildPreProcessor.DoExecute(ProcessedArgs args)
at SonarQube.TeamBuild.PreProcessor.TeamBuildPreProcessor.Execute(String[] args)
at SonarQube.TeamBuild.PreProcessor.Program.Main(String[] args) SonarQube Scanner for MSBuild Begin Step 2.2 18:11:45.209 Loading analysis properties from D:\kannappan_sonar\tasks\SonarQubePreBuild\1.0.35\MSBuild.SonarQube.Runner-1.1\SonarQube.Analysis.xml 18:11:45.271 Updating build integration targets... 18:11:45.286 Fetching analysis configuration settings... Pre-processing succeeded.
Unexpected exit code received from batch file: -532462766
The crux of this error is: The remote server returned an error: (401) Unauthorized
It is likely that you're trying to analyze a project on which the permissions have been restricted. In both the begin and end steps, you'll need to pass an analysis token from an account with permissions to analyze the project.
I am using the command -
tfpt.exe createteamproject /collection:url /teamproject:"Projectname" /processtemplate:CMMI /noportal
from command prompt to create a new Team project in Visual Studio Team services(VSTS).
In VSTS I have created a free trial account and using this url and credentials to create the team project.
When I run the above command in command prompt I get an error exception. Detailed log is attached below.
Please note- I do not have any developer/programming background, I am just looking to automate this task using powershell
I have visual studio 2013 and TFS 2013 power tools installed on the machine where I am running this command.
Has anyone seen this error before?
C:\Windows\system32>tfpt.exe createteamproject /collection:https://hmsutar.visualstudio.com/defaultcollection /teamproject:Mycode /processtemplate:scrum /noportal
All provided settings are valid.
---begin Exception entry---
Exception Type: Microsoft.TeamFoundation.Client.PcwException
Exception Message: The Project Creation Wizard encountered an error while creating the project structure on hmsutar.visualstudio.com\DefaultCollection.
Exception Details:
-- Inner Exception --
Exception Message: The requested operation is not allowed. (type SoapException
SoapException Details: <detail ServerTimeStamp="2016-03-16T09:56:11:045" ExceptionMessage="The requested operation is not allowed." BaseExceptionName="Microsoft.TeamFoundation.TeamFoundationServerException" />
Exception Stack Trace: at Microsoft.TeamFoundation.Proxy.CommonStructureService.CreateProject(String projectName, XmlElement structure)
--- end Exception entry ---
---begin Exception entry---
Exception Message: TF200016: The following project does not exist: Mycode. Verify that the name of the project is correct and that the project exists on the specified Team Foundation Server. (type SoapException)SoapException Details: <det
l ServerTimeStamp="2016-03-16T09:56:11:873" ExceptionMessage="TF200016: The following project does not exist: Mycode. Verify that the name of the project is correct and that the project exists on the specified Team Foundation Server." BaseexceptionName="Microsoft.TeamFoundation.Core.WebApi.ProjectException" />
Exception Stack Trace:at Microsoft.TeamFoundation.Proxy.CommonStructureService.GetProjectFromName(String projectName)
--- end Exception entry ---
2016-03-16T02:56:12 | Module: BatchTeamProjectCreator | Thread: 1 | Microsoft.visualStudio.TeamFoundation.PCW.ProjectCreationException: The Project Creation Wizard encountered an error while creating the project structure on hmsutar.visualstudio.com\DefaultCollection. ---> Microsoft.TeamFoundation.Client.PcwException
The Project Creation Wizard encountered an error while creating the project structure on hmsutar.visualstudio.com\DefaultCollection. ---> System.Web.Services.protocols.SoapException: The requested operation is not allowed.
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
Log file has been created at "C:\Users\Student\AppData\Local\Temp\Mycode.log".
Check the log for detailed results.
Logs
-----from log file--
2016-03-16T02:56:10 | Module: CssStructureUploader | Thread: 5 | Uploading CSS structure: "<Nodes><Node StructureType="ProjectLifecycle" Name="Iteration" xmlns=""><Children><Node StructureType="ProjectLifecycle" Name="Sprint 1" /><Node StructureType="ProjectLifecycle" Name="Sprint 2" /><Node StructureType="ProjectLifecycle" Name="Sprint 3" /><Node StructureType="ProjectLifecycle" Name="Sprint 4" /><Node StructureType="ProjectLifecycle" Name="Sprint 5" /><Node StructureType="ProjectLifecycle" Name="Sprint 6" /></Children></Node><Node StructureType="ProjectModelHierarchy" Name="Area" xmlns="" /></Nodes>"
2016-03-16T02:56:10 | Module: CssStructureUploader | Thread: 5 | Creating Project : Mycode
2016-03-16T02:56:11 | Module: CssStructureUploader | Thread: 5 | TF30155: Error occurred while trying to create project : "Mycode"
---begin Exception entry---
Time: 2016-03-16T02:56:11
Module: Engine
Event Description: TF30162: Task "UploadStructure" from Group "Classification" failed
Exception Type: Microsoft.TeamFoundation.Client.PcwException
Exception Message: The Project Creation Wizard encountered an error while creating the project structure on hmsutar.visualstudio.com\DefaultCollection.
Exception Details:
The Project Creation Wizard encountered a problem while creating the project structure on hmsutar.visualstudio.com\DefaultCollection.
The reason for the failure cannot be determined at this time.
Because the operation failed, the wizard was not able to finish
creating the Team Project.
Stack Trace:
at Microsoft.VisualStudio.TeamFoundation.PCW.CssStructureUploader.Execute(ProjectCreationContext context, XmlNode taskXml)
at Microsoft.VisualStudio.TeamFoundation.PCW.ProjectCreationEngine.TaskExecutor.PerformTask(IProjectComponentCreator componentCreator, ProjectCreationContext context, XmlNode taskXml)
at Microsoft.VisualStudio.TeamFoundation.PCW.ProjectCreationEngine.RunTask(Object taskObj)
For Visual Studio Team Servives, you need to use the Web UI or the REST Api to create a new Team project. The API Reference can be found here:
https://www.visualstudio.com/en-us/integrate/api/tfs/projects#Createateamproject
To pass the correct Process template ID you can query the available process templates here:
https://www.visualstudio.com/integrate/api/tfs/processes#Getalistofprocesses
A simple powershell script or a small Console appliation would allow you to call these from the commandline. A small template and creative use of Curl or wget might also work.
My Build Server has been running just fine for a couple months and then this week we started getting this problem (see below).
It's almost certainly a permission problem, but no one in IT will admit to having changed a permission somewhere.
Also, it's trying to publish a log file to a location that doesn't exist!
to '#/416/logs/msbuild/agent-2'
If I knew where this location was, I would happily fix it or turn this specific publish off. All the other logs are present and accessible (obviously I'm able to view the log of these errors).
using Visual Studio 2013 & TFS2013.
This is the same issue, but changing the drop folders didn't fix it:
TFS Error publishing log files to #/198/logs/msbuild/agent-2
Other Errors and Warnings
3 error(s), 0 warning(s)
Exception Message: TF270016: An error occurred publishing log files from
'C:\Builds\2\AppName\AppName\src\AppName\AppName.log'
to '#/416/logs/msbuild/agent-2'. Details: An error occurred while
sending the request. (type PublishLogFileException) Exception Stack
Trace: at
System.Activities.Statements.Throw.Execute(CodeActivityContext
context) at
System.Activities.CodeActivity.InternalExecute(ActivityInstance
instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
at
System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor
executor, BookmarkManager bookmarkManager, Location resultLocation)
Inner Exception Details:
Exception Message: An error occurred while sending the request. (type
HttpRequestException) Exception Stack Trace: at
Microsoft.TeamFoundation.Build.Workflow.Activities.FileContainerDropProvider.CopyDirectory(String
sourceDirectory, String targetDirectory) at
Microsoft.TeamFoundation.Build.Workflow.Activities.FileContainerDropProvider.CopyDirectory(String
sourceDirectory, String targetDirectory, String[] renameIfExists)
at
Microsoft.TeamFoundation.Build.Workflow.Activities.PublishLogFile.Execute(CodeActivityContext
context)
Inner Exception Details:
Exception Message: Unable to connect to the remote server (type
WebException)Exception Stack Trace: at
System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at System.Net.Http.HttpClientHandler.GetResponseCallback(IAsyncResult
ar)
Inner Exception Details:
Exception Message: No connection could be made because the target
machine actively refused it [::1]:8080 (type SocketException)
Exception Stack Trace: at
System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult) at
System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure,
Socket s4, Socket s6, Socket& socket, IPAddress& address,
ConnectSocketState state, IAsyncResult asyncResult, Exception&
exception)
An error occurred while copying diagnostic activity logs
to the drop location. Details: An error occurred while sending the
request.
An error occurred while copying diagnostic activity logs to
the drop location. Details: An error occurred while sending the
request.
Update 12/29/2015
I've been able to confirm with IT that our main TFS instance was updated to 2013 Update 5.
Our build server is running TFS 2013 Update 4. My next priority will be getting the build server updated.
You can try to create a new build agent to see whether the issue persists.
The issue had nothing to do with TFS.
On the build server machine, we had a copy of Visual Studio installed (necessary for MSBuild and MSTest). The license we used had expired, and as a result Visual Studio installed in trial mode.
I don't know why this mattered, but reinstalling Visual Studio using a valid license fixed the issue.
I have a sample test project given to developers on my project team to learn how to use automated tests. When I run the set of unit tests that I have, they all pass but I receive the following Warning and Error:
Warning: conflict during test run deployment: deployment item '[...]\WebAppMvc4.dll' directly or indirectly referenced by the test container '[...]\webappmvc4.tests.dll' cannot be deployed to 'WebAppMvc4.dll' because otherwise the file '[...]\WebAppMvc4.dll' would overwrite deployment item '[...]\WebAppMvc4.dll' directly or indirectly referenced by '[...]\webappmvc4.tests.dll'
Error: Cannot initialize the ASP.NET project 'WebAppMvc4'.
Exception was thrown: The web site could not be configured correctly; getting ASP.NET process information failed. Requesting 'http://localhost:12903/VSEnterpriseHelper.axd' returned an error: The remote server returned an error: (500) Internal Server Error.
This is very similar to the problem found here: Test run errors with MSTest in VS2010
However, the resolution to this problem had to do with turning off the Sign The Assembly checkbox in the project properties. Signing is not turned on for this project, and I have not been able to determine the reason for the Warning/Error.
Here is the information from Event Viewer for the Warning:
Event code: 3008
Event message: A configuration error has occurred.
Event time: 6/27/2012 9:40:51 AM
Event time (UTC): 6/27/2012 2:40:51 PM
Event ID: a9b4d9d93e334acbbde6184527b4cd81
Event sequence: 1
Event occurrence: 1
Event detail code: 0
Process information:
Process ID: 4128
Process name: WebDev.WebServer40.EXE
Exception information:
Exception type: ConfigurationErrorsException
Exception message: Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Common, Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. Strong name signature could not be verified. The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key. (Exception from HRESULT: 0x80131045)
at System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective)
at System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory()
at System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai)
at System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig)
at System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies()
at System.Web.Compilation.BuildManager.CallPreStartInitMethods()
at System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException)
Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Common' or one of its dependencies. Strong name signature could not be verified. The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key. (Exception from HRESULT: 0x80131045)
Request information:
Request URL:
http://localhost:12903/VSEnterpriseHelper.axd
And here is the info for the Error:
(QTAgent32.exe, PID 9392, Thread 7) CoveragePlugIn.InitAspNet threw in calling WorkerProcessIdentity or WorkerProcessImpersonatedIdentity for 'WebAppMvc4':
Microsoft.VisualStudio.Enterprise.Common.AspNetHelperException: The web site could not be configured correctly; getting ASP.NET process information failed.
Requesting 'http://localhost:12903/VSEnterpriseHelper.axd' returned an error: The remote server returned an error: (500) Internal Server Error. ---> System.Net.WebException: The remote server returned an error: (500) Internal Server Error.
at System.Net.HttpWebRequest.GetResponse()
at Microsoft.VisualStudio.Enterprise.Common.BaseHelper.GetWorkerProcessInfo()
--- End of inner exception stack trace ---
at Microsoft.VisualStudio.Enterprise.Common.BaseHelper.GetWorkerProcessInfo()
at Microsoft.VisualStudio.TestTools.CodeCoverage.CoveragePlugIn.InitAspNet(TestRun testRun)