The Platform for project is invalid.

Sysprogs forums Forums VisualGDB The Platform for project is invalid.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #30408
    curtis.hendrix
    Participant

    I’ve got a problem on a build agent where I cannot get VisualGDB based projects to build. I can build them locally on my machine without issue.  We’re using TeamCity with a service account on the build agent to run the builds.

    Software:

    Visual Studio Pro 2017

    VisualGDB 5.5R4 (Build 3920)

    GCC Toolchain 9.3.1-R2

    This is the error I get.

    C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.Cpp.InvalidPlatform.Targets(22,7): error MSB8007: The Platform for project '<Project Name>.vcxproj' is invalid. Platform='VisualGDB'. You may be seeing this message because you are trying to build a project without a solution file, and have specified a non-default Platform that doesn't exist for this project. [d:\BuildAgent\work\9a59ea2524c20eb7\<Project Folder>\<Project Name>.vcxproj]

    I’ve tried reinstalling Visual Studio, VisualGDB, and the GCC toolchains under the build agent service account, but nothing seems to work.  C# projects build fine on the build agent, along with Microchip (MPLab-X) projects.

    #30409
    curtis.hendrix
    Participant

    I also tried creating a new VisualGDB project in Visual Studio on the build server and got this error:

     

    VisualGDB version: 5.5.104.3920
    ------------------ System.InvalidOperationException ------------------
    System.InvalidOperationException: Platform 'VisualGDB' referenced in the project file 'EmbeddedProject2' cannot be found.
    at Microsoft.Verify.FailOperation(String message, Object[] args)
    at Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.VCProjectShim.<AddPlatformNoEventsAsync>d__343.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.VCProjectShim.<>c__DisplayClass63_0.<<AddPlatform>b__0>d.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.ApartmentMarshaler.<>c__DisplayClass7_0.<<Invoke>b__0>d.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at Microsoft.VisualStudio.Threading.JoinableTask.CompleteOnCurrentThread()
    at Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.ApartmentMarshaler.Invoke(Func`1 method)
    at Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.VCProjectShim.AddPlatform(String platformName)
    at mr.AddNewPlatformAndEnsureConfigurations(String b, String[] a)
    at s33.r(e13 c, IProjectEditContext f, e b, dx1 a, h g, Boolean e, y[] d)
    at ti2.b(EmbeddedWizardState a, IProjectEditContext e, zf2 b, e13 c, String d, dx1 f)
    at ti2.DoRunWizardOrThrowException(dx1 a, String b, String c)
    at n23`1.Execute(Object b, Int32 c, Object[]& e, Object[]& d, wizardResult& a)
    trace=[Microsoft.Verify.FailOperation:12, Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.VCProjectShim+<AddPlatformNoEventsAsync>d__343.MoveNext:174, System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess:39, System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification:40, Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.VCProjectShim+<>c__DisplayClass63_0+<<AddPlatform>b__0>d.MoveNext:187, System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess:39, System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification:40, Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.ApartmentMarshaler+<>c__DisplayClass7_0+<<Invoke>b__0>d.MoveNext:221, System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess:39, System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification:40, Microsoft.VisualStudio.Threading.JoinableTask.CompleteOnCurrentThread:556, Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.ApartmentMarshaler.Invoke:37, Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.VCProjectShim.AddPlatform:32, mr.AddNewPlatformAndEnsureConfigurations:0, s33.r:153, ti2.b:1102, ti2.DoRunWizardOrThrowException:2172, n23`1.Execute:210]

    #30410
    curtis.hendrix
    Participant

    A little more information:

    It would appear I cannot register VisualGDB under the service account used to run the builds.  I opened a command prompt as the service account, went to %VISUALGDB_DIR%, and executed “visualgdb /about”.  I got the “About VisualGDB” window, entered the license key, clicked “OK”.  But when I ran “visualgdb /about” from the command line again, it reverted to “Unknown” under “This copy of VisualGDB has been licensed to:”

    #30416
    curtis.hendrix
    Participant

    No idea why this worked, but it worked.

    I deleted the “VCTargetsPath” Environment Variable from the build server and now everything is working correctly again.

    #30418
    support
    Keymaster

    Hi,

    Good to know it works. Overriding environment variables used by VS could indeed lead to strange behavior, so restoring the default values is always a good idea.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.