4 Replies - 4210 Views - Last Post: 07 January 2008 - 05:18 PM Rate Topic: -----

#1 complete  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 103
  • Joined: 12-April 07

C# Build

Posted 31 December 2007 - 08:49 PM

I have written some simple C# programs just to get my feet wet.

Now I have decided to build a co-workers program and step through it. I am not used to all of the problems that might arise when building a C# program as I would a C++ program.

I get this error:

------ Rebuild All started: Project: ProjectName, Configuration: Debug Any CPU ------
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets(481,9): error : The OutputPath property is not set for this project.
Please check to make sure that you have specified a valid Configuration/Platform combination.
Configuration='Debug' Platform='AnyCPU'
Done building project "ProjectName.csproj" -- FAILED.
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

So there are some settings I need to check. Any advice?

Here is what I have tried so far:

I tried to right click in the project in Solution Explorer and I choose properties.
In the left pane of the properties page, click the Build option. The Output Path is near the bottom. I made sure it was set to bin\Debug\
But this changed nothing.

The Readme File in the directory suggeted to do a command-line build using MSBUILD.
When I did this, I got this error:

Unhandled Exception: System.IO.FileLoadException: Could not load file or assembly 'Microsoft.Build.Engine, Version=3.5.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Strong name validation failed. (Exception from HRESULT: 0x8013141A)File name:
'Microsoft.Build.Engine, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' ===> System.Security.SecurityException: Strong name
validation failed. (Exception from HRESULT: 0x8013141A)The Zone of the assembly that failed was:MyComputer
at Microsoft.Build.CommandLine.MSBuildApp.Execute(String commandLine) at Microsoft.Build.CommandLine.MSBuildApp.Main()

Is This A Good Question/Topic? 0
  • +

Replies To: C# Build

#2 Martyr2  Icon User is offline

  • Programming Theoretician
  • member icon

Reputation: 4332
  • View blog
  • Posts: 12,127
  • Joined: 18-April 07

Re: C# Build

Posted 31 December 2007 - 09:39 PM

Are you attempting to have multiple projects in the same solution? Is the code you are attempting to build trying to reference another project that is not included in the solution?

This post has been edited by Martyr2: 31 December 2007 - 09:39 PM

Was This Post Helpful? 0
  • +
  • -

#3 Jayman  Icon User is offline

  • Student of Life
  • member icon

Reputation: 418
  • View blog
  • Posts: 9,532
  • Joined: 26-December 05

Re: C# Build

Posted 31 December 2007 - 11:53 PM

You need to set the Output path for your project. To access this setting go to the Project menu and select the item at the bottom that starts with the name of the project and ends with Properties. yourProjectName Properties

Select the "Build" tab in the properties tab. Towards the bottom you will see Output Path, you can either browse to to where the files will be stored or just type in a path.

It should be bin\Release\. See screenshot.

Attached image(s)

  • Attached Image

Was This Post Helpful? 0
  • +
  • -

#4 complete  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 103
  • Joined: 12-April 07

Re: C# Build

Posted 07 January 2008 - 03:05 PM

View PostMartyr2, on 31 Dec, 2007 - 09:39 PM, said:

Are you attempting to have multiple projects in the same solution? Is the code you are attempting to build trying to reference another project that is not included in the solution?

No, I am only trying to figure out what is broken in one project by comparing it to one that works.



View Postjayman9, on 31 Dec, 2007 - 11:53 PM, said:

You need to set the Output path for your project. To access this setting go to the Project menu and select the item at the bottom that starts with the name of the project and ends with Properties. yourProjectName Properties

Select the "Build" tab in the properties tab. Towards the bottom you will see Output Path, you can either browse to to where the files will be stored or just type in a path.

It should be bin\Release\. See screenshot.


Wow! That worked! It was bin\Debug\ but when I changed it to bin\Release\ that eror disappeared. Now I have some more common build errors that I think I can deal with.

I do have a question tho'

The sample code I am looking at is supposed
to be a console app. And yet it has the
same sort of structure that a windows app
would have.

Since I am unable to build the app yet, I
am unsure if it is a true console app.

Can a console app have this sort of main
procedure structure?
using System;
using System.Collections.Generic;
using System.Windows.Forms;

namespace SomeProductNameSample
{
	static class Program
	{
		/// <summary>
		/// The main entry point for the application.
		/// </summary>
		[STAThread]
		static void Main()
		{
			Application.EnableVisualStyles();
			Application.SetCompatibleTextRenderingDefault(false);
			Application.Run(new MainForm());
		}
	}
}


Was This Post Helpful? 0
  • +
  • -

#5 Jayman  Icon User is offline

  • Student of Life
  • member icon

Reputation: 418
  • View blog
  • Posts: 9,532
  • Joined: 26-December 05

Re: C# Build

Posted 07 January 2008 - 05:18 PM

No, that is the entry point for a Windows Application..not a console app.

A console application will start with this when you first create the project:
using System;
using System.Collections.Generic;
using System.Text;

namespace ConsoleApplication1
{
	class Program
	{
		static void Main(string[] args)
		{
		}
	}
}


Was This Post Helpful? 0
  • +
  • -

Page 1 of 1