Solved

Error in Build of c# .net site

Posted on 2013-10-23
2
266 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 75

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

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…
In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

733 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