Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
M

Madhurima Dutta

@Madhurima Dutta
About
Posts
3
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Running MSBuild Commands from My C# console application.
    M Madhurima Dutta

    I have tried running msbuild /t:scmclean from my command prompt, it works fine , but when i try to call the same command from my c# console application using the code below namespace BuildCode { class BuildCM { public static void Main() { Process msetup = new Process(); msetup.StartInfo.FileName = "cmd.exe"; msetup.StartInfo.CreateNoWindow = true; msetup.StartInfo.RedirectStandardInput = true; msetup.StartInfo.RedirectStandardOutput = true; msetup.StartInfo.UseShellExecute = false; msetup.Start(); msetup.StandardInput.WriteLine("msbuild.exe D:\\git\\btf_pi_testrack\\Build\\Tools /t:scmclean"); msetup.StandardInput.Flush(); msetup.StandardInput.Close(); msetup.WaitForExit(); Console.WriteLine(msetup.StandardOutput.ReadToEnd()); Console.ReadKey(); } } } i get an error: C:\Users\JediAdmin\source\repos\msbuild\bin\Debug\net7.0>msbuild.exe D:\git\btf_pi_testrack\Build\Tools /t:scmclean MSBuild version 17.4.0+18d5aef85 for .NET MSBUILD : error MSB1003: Specify a project or solution file. The current working directory does not contain a project or solution file., it fails to run msbuild command for the particular directory but if i execute msbuild.exe D:\git\btf_pi_testrack\Build\Tools /t:scmclean in command prompt, it works fine. Also i did a little bit of digging for this issue and came back with Microsoft.Build.Runtime and Microsoft.Build.utilities.core for running msbuild commands from console application, however i couldn't get any code example to understabd how it does that? any idea on this as well?

    C# csharp visual-studio collaboration question workspace

  • unable to run msbuild command from my c# console application code
    M Madhurima Dutta

    i have been using cliwrap for running git commands and passing the arguments. But it seems to have failed while running my msbuild command from my c# console application. What i am trying- var stdOutSetup = new StringBuilder(); var stdErrSetup = new StringBuilder(); var Setup = await Cli.Wrap("msbuild") .WithArguments("/t:scmclean && /t:setup") .WithStandardOutputPipe(PipeTarget.ToStringBuilder(stdOutSetup)) .WithStandardErrorPipe(PipeTarget.ToStringBuilder(stdErrSetup)) .ExecuteBufferedAsync(); var stdOut2 = stdOutSetup.ToString(); var stdErr2 = stdErrSetup.ToString(); Console.WriteLine("Build Commands Output :"); Console.WriteLine(stdOut2); Console.WriteLine(stdErr2); is there any possible way where i can run msbuild commands from my c# console application?

    Visual Basic csharp visual-studio collaboration question workspace

  • Running MSBuild Commands from My C# console application.
    M Madhurima Dutta

    i have been using cliwrap for running git commands and passing the arguments. But it seems to have failed while running my msbuild command from my c# console application. What i am trying- var stdOutSetup = new StringBuilder(); var stdErrSetup = new StringBuilder(); var Setup = await Cli.Wrap("msbuild") .WithArguments("/t:scmclean && /t:setup") .WithStandardOutputPipe(PipeTarget.ToStringBuilder(stdOutSetup)) .WithStandardErrorPipe(PipeTarget.ToStringBuilder(stdErrSetup)) .ExecuteBufferedAsync(); var stdOut2 = stdOutSetup.ToString(); var stdErr2 = stdErrSetup.ToString(); Console.WriteLine("Build Commands Output :"); Console.WriteLine(stdOut2); Console.WriteLine(stdErr2); is there any possible way where i can run msbuild commands from my c# console application?

    C# csharp visual-studio collaboration question workspace
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups