Welcome to Dream.In.Code
Getting C# Help is Easy!

Join 136,164 C# Programmers for FREE! Get instant access to thousands of C# experts, tutorials, code snippets, and more! There are 1,884 people online right now. Registration is fast and FREE... Join Now!




C# Build

 
Reply to this topicStart new topic

C# Build

complete
31 Dec, 2007 - 07:49 PM
Post #1

New D.I.C Head
*

Joined: 12 Apr, 2007
Posts: 22


My Contributions
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()

User is offlineProfile CardPM
+Quote Post

Martyr2
RE: C# Build
31 Dec, 2007 - 08:39 PM
Post #2

Programming Theoretician
Group Icon

Joined: 18 Apr, 2007
Posts: 5,199



Thanked: 213 times
Expert In: C/C++, Java, VB, VB.NET, C#, PHP, Web Development, HTML & CSS, Javascript

My Contributions
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 Dec, 2007 - 08:39 PM
User is online!Profile CardPM
+Quote Post

Jayman
RE: C# Build
31 Dec, 2007 - 10:53 PM
Post #3

Student of Life
Group Icon

Joined: 26 Dec, 2005
Posts: 6,926



Thanked: 42 times
Dream Kudos: 500
Expert In: C#, VB.NET, Java

My Contributions
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 thumbnail(s)
Attached Image
User is offlineProfile CardPM
+Quote Post

complete
RE: C# Build
7 Jan, 2008 - 02:05 PM
Post #4

New D.I.C Head
*

Joined: 12 Apr, 2007
Posts: 22


My Contributions
QUOTE(Martyr2 @ 31 Dec, 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?

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



QUOTE(jayman9 @ 31 Dec, 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.


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?
CODE

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());
        }
    }
}



User is offlineProfile CardPM
+Quote Post

Jayman
RE: C# Build
7 Jan, 2008 - 04:18 PM
Post #5

Student of Life
Group Icon

Joined: 26 Dec, 2005
Posts: 6,926



Thanked: 42 times
Dream Kudos: 500
Expert In: C#, VB.NET, Java

My Contributions
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:
CODE

using System;
using System.Collections.Generic;
using System.Text;

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

User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/2/08 12:02AM

Live C# Help!

C# Tutorials

Reference Sheets

C# Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month