Solved

Error in Build of c# .net site

Posted on 2013-10-23
2
258 Views
Last Modified: 2013-10-23
I am seeing an error in the build of my c# page. It seems to be happening on using system.diagnostics.
Error      12      'System.Diagnostics.ProcessStartInfo' does not contain a definition for 'Filename' and no extension method 'Filename' accepting a first argument of type 'System.Diagnostics.ProcessStartInfo' could be found (are you missing a using directive or an assembly reference?)      C:\Code\Temp\MaintApp\MaintApp\default.aspx.cs      38      32      MaintApp

I checked my references and in system I see ProcessStartInfo listed along with Filename. I am not sure where else to look here, I also did a check to make sure it is all using .net 4.0. Am not exactly what else to try.
Here is the default.aspx.cs code that is erroring on build.


using System;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace MaintApp
{
    public partial class _default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)

        {
            Process proc = new Process();
            proc.StartInfo.Filename = null;
            proc.StartInfo.WorkingDirectory = @"c:\scripts";

            if (this.DropDownList1.SelectedValue == "Maint Window Start")
            {
                proc.StartInfo.Filename = @"C:\Scripts\StopSVCFinal.ps1";
            }
            else if (this.DropDownList1.SelectedValue == "Maint Window Complete")
            {
                proc.StartInfo.Filename = @"C:\Scripts\StartSVCFinal.ps1";
            }
            if (proc.StartInfo.Filename != null)
            {
                proc.Start();
            }


        }

   
   
    }
}
MaintappError.PNG
0
Comment
Question by:AjarnJonesy
2 Comments
 
LVL 74

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
ID: 39594599
C# is case-sensitive. The property is called FileName (capital "N").
0
 

Author Closing Comment

by:AjarnJonesy
ID: 39594895
MOST EXCELLENT>> That was it.:)
thanks
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now