.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
ASPEvil
david stephan
Santhakumar Munuswamy
Fauzul Azmi
Post New Web Links

Writing an XML Schema to validate my application's web.config is valid

Posted By:      Posted Date: September 06, 2010    Points: 0   Category :ASP.Net
 
Hello.  I'm trying to get an XML schema working that will validate the web.config of the application is valid (user is allowed to edit it, using a WinForms app). I've 'borrowed' the default config schema from the Visual Studio/XML/Schemas folder and am making modifications to it.  I'm really only interested in editing just one section of the schema, that being... the part that defines <appSettings>. Here's the relevant portion of the schema (with the extra stuff I don't need stripped out).   <xs:element name="appSettings" vs:help="configuration/appSettings"> <xs:complexType> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="add" vs:help="configuration/appSettings/add" minOccurs="1"> <xs:complexType> <xs:attribute name="key" type="xs:string" use="required" /> <xs:attribute name="value" type="xs:string" use="required" /> </xs:complexType> </xs:element> </xs:choice> </xs:complexType> </xs:element> I want to enforce that the XML looks like this:<appSettings> <add key="Set


View Complete Post


More Related Resource Links

C# and the Web: Writing a Web Client Application with Managed Code in the Microsoft .NET Framework

  

When the author wanted to build a middleware Web client to connect to other applications over the Internet, he realized that the XMLHttpRequest COM object was not sufficient for his purposes. In order to build a Web client using managed code, the author had to use the HTTPWebRequest and HTTPWebResponse classes provided by the Microsoft .NET framework. These classes are used in the sample project as a substitute for the less powerful XMLHttpRequest COM object, allowing the author to build a full-featured Web client. They also take advantage of all the benefits that the CLR and managed code have to offer.

Avi Ben-Menahem

MSDN Magazine September 2001


.net 4.0 machine.config schema?

  
Where can I find the official schema for .NET 4.0 machine.config?   thanks  

how do i create a windows form application login for to validate username and password from sql serv

  
 I would like to know how I can create a login form for my windows form application. The login form must be linked to a SQL server 2005 express edition database (in which the username and passwords are stored). The login form must validate the user using the database and allow them to access the program. 

how to validate xml with xml schema

  
I am trying to validate xml file wth the xml schema and if there is no violation then I would like to write the xml file to the dataset and save it to the database. my problem here is that if i have more than one error it does not show up. the first violation is the only one that displays in the error messge. can someone help me to fix my code below     ImportsSystem.IO ImportsSystem.Xml ImportsSystem.Data ImportsSystem.Xml.Schema ImportsSystem.Collections ImportsSystem.Data.OracleClient ImportsSystem.Configuration.ConfigurationManager Partial    Class PyrollInherits System.Web.UI.PageDim XMLPath As String  Dim XSDPath As String          Dim Reader As XmlTextReaderDim ErrResult As New ArrayList()Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.ClickIf (FileUpload1.HasFile) Then XSDPath = "F:\XSDFile\address.xsd" ValidatingProcess()  Else lblError.Text = "Please upload a valid xml file"  End If    End Sub   ValidatingProcess()    Public Function ValidateIt() As ArrayListReturn Me.ErrResultEnd Function  Private Function ValidatingProcess() As Boolean       Reader =      Dim ds As DataSet = New DataSetDim readFile As StreamReader = New StreamReader(FileUpload1.PostedFile.InputS

Writing connection string in web.config file by code or dynamically

  
I want to write connection string in web.config file of my application by code. If anyone know the way or code just help me..NET,C#,SQL SERVER

Access denied when application writing to eventlog

  
Hi all. (Hope this is the right forum) A web application should write to eventlog, but get this error: Access is denied Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.ComponentModel.Win32Exception: Access is denied Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  Stack Trace: [Win32Exception (0x80004005): Access is denied] [InvalidOperationException: Cannot open log for source 'WebAppName'. You may not have write access.]    System.Diagnostics.EventLog.OpenForWrite(String currentMachineName) +1830063... Windows 2008 R2 server. Have been searching for answers all day, and have been trying out different things. Adding the CustomSD key: HKEY_LOCAL_MACHINE/System/CurrentControlSet/Application with the value (A;;0x0002;;;AU) Give everyone access to the keys: - HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog - HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\System - HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Security Set the application pool to run with an adm

System.BadImageFormatException:is not a valid Win32 application

  
We are facing problem while migrating a .Net 2.0 application 64 Bit OS Windows Server 2003.The error is  as below:"is not a valid Win32 application. (Exception from HRESULT: 0x800700C1) " Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.BadImageFormatException: is not a valid Win32 application. (Exception from HRESULT: 0x800700C1)the application is running fine on 32 Bit OS windows Server 2003.Can any one provide any possible soution to the above problem.thanksNikhil

use DLL application config file

  
Hello All, I develop a multi layer application with windows form project and multiple class library. In my "Common.dll" (where I put common application fuctionality and use it in all application hat I develop), I have encapsulated logging capabilites using the Enterprise Library 5 logging facility into a DLL and added an app.config with all the pertinent loggingConfiguration XML as produced by the Enterprise Library Configuration Editor. When I run application I get Error and can not use Logging capabilites of my Common.dll. But when I copy App.config content into app.config of windows form project everything works fine. Also I have same problem with hosting services in my "DataAccessLayer.dll" using app.config that add to DLL. Again when I copy App.config content into app.config of windows form project everything works fine. Absolutly I want keep setting in seprate configuration file and do not marge them into same file. Is it possible?

Getting error when trying to start acroRd32.exe "Not a valid Win32 Application"

  

I am writing a .pdf file to a folder then attempting to silent print using acroRd32.exe. When I run the program I get the error 

"Not a valid win32 application"

The program is creating the pdf file correctly.


Thanks



 string pathToExecutable = @"c:\Program Files\Adobe\Reader 9.0\AcroRd32.exe";

     RunExecutable(pathToExecutable, @"/t ""C:\WR014v2_.pdf""     ""//ussnadprt/USNPA039""");




 private static void RunExecutable(string executable, string arguments)
        {
            ProcessStartInfo starter = new ProcessStartInfo(executable, arguments);
            starter.CreateNoWindow = true;
            starter.RedirectStandardOutput = true;
            starter.UseShellExecute = false;

            Process process = new Process();
            process.StartInfo = starter;
            process.Start();

            StringBuilder buffer = new StringBuilder();

            using (StreamReader reader = process.StandardOutput)
            {
                string line = reader.ReadLine();
                while (line != null)
                {
                    buffer.Append(line);
                    buffer.Append(Environment.NewLine);
                    line = reader.ReadLine();
                  

Windows Application Log Event Errors writing back to SharePoint Library fields

  

Hi has anyone done anything like this?

My Library workflow is writing to an External List (MS SQL backended).  If an exception is thrown in MSSQL (Stored Procedure, Trigger, etc) I would like to create a mechanism for writing something back to my Library besides the workflow column saying "Error Occured".

I could create a text field to provide some error feedback, anybody ever did something like this?

Thanks


" is not a valid Win32 application. (Exception from HRESULT: 0x800700C1)"

  
I'm attempting to migrate an ASP.NET application from .NET 1.1 to 2.0 (and I'm also moving the development platform from VS.NET 2003 to VS.NET 2005). After some modification the application builds cleanly on the new platform but when I attempt to run in debug mode I see the error shown below. I'm building on a new WinXP-64 machine (AMD Athlon 64 CPU).

If I change the target platform to "x86" in the solution properties, I can't build the app (hundreds of unresolved dependencies).

Can anyone point me in the right direction to solve this problem?

Many thanks

Steve F

Server Error in '/CMISWebAdminDevelopment' Application.

is not a valid Win32 application. (Exception from HRESULT: 0x800700C1)

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details:
System.BadImageFormatException: is not a valid Win32 application. (Exception from HRESULT: 0x800700C1)

Source Error:

Manual change to "applicationSettings" in app.config file are not read by the application.

  

Hello,

Okay...This Application Settings stuff is driving me nuts.  Something conseptually so simple should not be this hard to get working.

Here is my

I have a .NET 4 application in which I generated a web reference from a web service wsdl.

I see that it creates an endpoint property in the app.config file which corresponds to a settings class that is autogenerated.    I compile my release code and copy the executable and config file to a local drive.

By default, the url points to the endpoint that was added by the designer.

Now, I want to change my application configuration to point to the production version the the webservice.

To do this I thought all I had to do was change the value in the app.config file.  However, the application never reads from the config, it's always taking the default setting compiled into the settings class.  I'm at a loss as to why this is happening. 

I have search through this forum and there are so many different posts on application settings but all I want to do is change the config file manually without having to recompile.   I'm not doing any runtime settings modifications. 

What if down the line we change the alias to the web service hosting the service.  I can't imagine Microsoft really expects us to have to rec

what should be changed to web.config file if i deploy my application to actual server ?

  

Hi,

I have developed a web site application with vb.net code behind.Debugging mode was on.

I have deployed my web site in actual server machine ,but when i open my home page some error is coming related to web.config file.I directly deployed my application to actual server without any change to web.config file.

So, is there any settings required if i deploy my application ? 


Unable to Authorize Launch Permissions for missing "Microsoft Excel Application" in DCOM Config

  

 Hi,

I would like to develop Excel charts programatically using VB .NET and the Microsoft Excel 11.0 Object Library (http://www.beansoftware.com/asp.net-tutorials/generating-excel-reports.aspx).  To accomplish this, I need to authorize the aspnet user on my machine launch permissions on "Microsoft Excel Application" DCOM (http://blog.crowe.co.nz/archive/2006/03/02/589.aspx).  I tried using dcomcnfg.exe to do this, however, I cannot find the "Microsoft Excel Application" DCOM under DCOM Config.

I am developing on a Windows XP (work machine) using Office Excel 2003

Why is the ""Microsoft Excel Application" missing in DCOM Config? More importantly, how can I give aspnet launch privileges to if Microsoft Excel Application DCOM is missing in DCOM Config?

Thanks,

Marc

Windows 2003 64 bit - Web App gives "is not a valid Win32 application. (Exception from HRESULT: 0x80

  

I've got an x86 deployment which is targeted at x86 and works fine on 2003 server 32 bit.

When I install on win 2003 x64, the installer works OK, but I cant get the first web page to display.

I've done a fair bit of googling but not found an answer yet

The error message is:


Server Error in '/MyCompany' Application.
--------------------------------------------------------------------------------

is not a valid Win32 application. (Exception from HRESULT: 0x800700C1)
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.BadImageFormatException: is not a valid Win32 application. (Exception from HRESULT: 0x800700C1)

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. 

Stack Trace:


[BadImageFormatException:  is not a valid Win32 application. (Exception from HRESULT: 0x800700C1)]
   System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean thro

Reading Web.Config to pass values to silverlight Application

  
In asp.net application we often use to save the connection string and some other information like user name , web service URL etc in the web.config and then in application read them and use in the application and even we can easily changes these value at later time.However, this scenario does not work out of the box from a Silverlight application, which doesn't seem to even have access to web.config.The reason is simple: a Silverlight application runs on the client side. The XAP -just like the browser- cannot access server resources such as web.config. In this post I will show you how you can read the web.config and pass to the silverlight application and then on the silverlight application how can you read the passed parameters.

How to Validate a Method through Validation Application Block

  

Can i use Validation block  to apply check on Method parameter e.g. we have USerMasterBO as input parameter and we want to check if MasterID provide when user access a method GetUserDetail(), then only it should go to function else return before it because of validation fails.

In other words like we have validation feature in Message Inspector on API can we do the same in Validation block?

 


Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend