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

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

.net 4.0 machine.config schema?

Posted By:      Posted Date: August 28, 2010    Points: 0   Category :.NET Framework
Where can I find the official schema for .NET 4.0 machine.config?   thanks  

View Complete Post

More Related Resource Links


Hi,  If i write a connection string in Machine.config and different one in web.config which connection string is taken. Regards Jane   

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

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

Server Farm and machine.config machineKey value mismatch

Hi,I'm writing an application that is deployed on web server farm. I've tried to get the machineKey from all the servers but admins have denied my request stating security concern. I have no way of knowing if they match or not. This is the error I get sometimes-------------------------------------------------------------------------------------------------------------------------------------------------------------------------- System.Web.HttpException: Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster. ---> System.Web.UI.ViewStateException: Invalid viewstate.    Client IP:   Port: 49194   User-Agent: Mozilla/5.0 (iPhone Simulator; U; CPU iPhone OS 3_0 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Mobile/7A341   ViewState: /wEPDwUJOTczMzM0ODk3ZGSqcWCbsDoMeHnkNaxb9+0vLuiJVw==   Referer: http://mobile.cch.com/MobileZipSalesLookup/Result.aspx   Path: /MobileZipSalesLookup/Email.aspx ---> System.Web.HttpException: Unable to validate data.     at System.Web.Configuration.MachineKeySection.GetDecodedData(Byte[] buf, Byte[] modifier, Int32 start, Int32 length, Int32& data

Synchronizing schema from local development machine to remote web server


As a single developer in a small business I'm developing a data-driven website on my local machine using VS2008 Professional (I also have 2010 Professional)

It is then synchronised with a dedicated server using Expression Web (ditto design)

I'm using SqlExpress both machines and as features are added, I want to synchronize the dedicated server schema from the local schema

VS2010 has such a feature, but it's a ____ of a price to pay for one feature - basically adding fields as I add functionality.

I'm surprised SqlServer doesn't have such a feature built in - am I missing something?

(I've trialled RedGate SqlCompare, but it can't access the remote db, and I'm reluctant to enable SqlServer Remote Connections on a machine I don't own).


apps automatically using machine.config


I have connection strings info in web.config.  I thought that if this were the case, machine.config would be ignored.  But, everytime the connection string in web.con is different than the connection string in maching.con, I get error......

The connection name 'aspnetdbConnectionString' was not found in the applications configuration or the connection string is empty.

Is there something I can check or change to get the app to ignore the machine.config when web.config connection string is listed.

Windows Vista error Framework\v2.0.50727\config\machine.config 0x80070570

I've Windows Vista sp1 Business, but now all applications that require .NET frammework don't work and give me the error:

error C:\Windows\Microsoft.NET\Framework\v2.0.50727\config\machine.config parser error 0x80070570.

I've try to reinstall .net 2.0 framework but the installer said that this tool is already installed, and I try to install .NET3.0 framwork but the problems already exist.

I've used the tool "netfx_setupverifier_new.zip" for verify the installation and this gives me this log error:

[07/01/08,11:07:01] Beginning of new SetupVerifier activity logging session
[07/01/08,11:07:01] Activity log file location: C:\Users\Ivan\AppData\Local\Temp\setupverifier_main_07-01-08_11.07.01.txt
[07/01/08,11:07:01] Error log file location: C:\Users\Ivan\AppData\Local\Temp\setupverifier_errors_07-01-08_11.07.01.txt
[07/01/08,11:07:01] Detected operating system: Windows Vista (x86)
[07/01/08,11:07:09] Starting verification for product .NET Framework 2.0
[07/01/08,11:07:09] Section [Files - .NET Framework 2.0 (Common)] - start parsing entries
[07/01/08,11:07:09] File C:\Windows\system32\mscoree.dll is installed on the system
[07/01/08,11:07:09] File C:\Windows\system32\netfxperf.dll is installed on the system
[07/01/08,11:07:09] File C:\Windows\system32\dfshim.dll is installed on the system
[07/01/08,11:07:09] File C:

[SOLVED] .Net 2 Service unable to access Connection String in Machine.config

I have a Windows Service I have developed in Visual Studio 2005 (C#).

It accesses a database using a connection string in machine.config.

On my Windows XP Pro 32bit (SP3) machine, it works correctly.

On my new Windows 7 Pro 64bit machine, it throws "object not set to an instance of an object" when it gets to the line where it's trying use the connection string.
This is the 'object' which is not set in Windows 7:


The machine.config has the same connection string set up on both machines.

A .Net 2 website transferred to the Windows 7 machine has no problem accessing the same connection string.

I have tried a bunch of different permissions on the machine.config and its containing folders, and setting the service to log in as Admin, but I don't know exactly what permissions are required.

Does anyone know what's going on here? Many thanks.

Clean Web.Config Files (VS 2010 and .NET 4.0 Series)

.NET 4 includes a new version of the CLR, and a new .NET 4 specific machine.config file (which is installed side-by-side with the one used by .NET 2, .NET 3 and .NET 3.5).

The new .NET 4 machine.config file now automatically registers all of the ASP.NET tag sections, handlers and modules that we've added over the years, including the functionality for:

.ASP.NET Dynamic Data
.ASP.NET Routing (which can now be used for both ASP.NET WebForms and ASP.NET MVC)
.ASP.NET Chart Control (which now ships built-into ASP.NET V4)
What this means is that when you create a new "Empty ASP.NET application" project in VS 2010, you'll find that the new default application-level web.config file is now clean and simple:

How to extract a schema from a sql server database



  I need to extract or get the schema from tables in my databse and what is the best way to do it. Is there any third party tool to do it??


Any idea will be appreciated..



reading values from config files in NUnit tests


One of my NUnit tests has to read in some values from config files.  In my main application this process works perfectly well, however when I run the unit test, the code that reads in the values from the config files doesnt read anything in.  Ive tried putting app.config in my unit test project (I even tried web.config) but nothing seems to work.  Are there any special steps involved when reading from config files in an nunit test ?

NUnit and config files


Ive created an NUnit test project in my solution and have added 3 tests.  They all fail with the same error

SetUp : System.TypeInitializationException : The type initializer for 'Systems.Utils.ConstantHelpers' threw an exception.
  ----> System.NullReferenceException : Object reference not set to an instance of an object.


SetUp : System.TypeInitializationException : The type initializer for 'Systems.Utils.ConstantHelpers' threw an exception.

  ----> System.NullReferenceException : Object reference not set to an instance of an object.

heres the test method

        public void CreateDataContext_ConnectionString_ReturnsDataCon

Modifying connection String in Web config using Install Wizard



Im trying to create a Web Deployment Project, the built in setup and deployment is very good in Visual Studio, i need to able to add an additional step in the setup to change the connection string in the Web config file. Ive seen a lot of articles on how to do this and in particular this http://weblogs.asp.net/scottgu/archive/2007/06/15/tip-trick-creating-packaged-asp-net-setup-programs-with-vs-2005.aspx#7162670 I am however stuck on the final part of this tutorial, im using the code Scott provided but have two errors,  heres part of my code where the errors are

using System;
using System.Configuration;
using System.Configuration.Install;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.DirectoryServices;

 void ConfigureDatabase(string targetSite, string targetVDir, string connectionString)
            // Retrieve "Friendly Site Name" from IIS for TargetSite
            DirectoryEntry entry = new DirectoryEntry("IIS://LocalHost/" + targetSit

Web deployment project - web.config section replacement does not add remove tag


I have a web application that is actually installed as a component of a third party site.  In some configurations, I need to remove certain connection strings and re-add them.  I'm replacing this web.config section with a xml file that includes the following:

      <remove name="MyOverridenConnection"/>
      <add connectionString="Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=MyDb;Data Source=MyServer" name="MyOverridenConnection"

For some reason the remove tag is left out during the substitution and I end up with the following in the installed config:

      <add connectionString="Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=MyDb;Data Source=MyServer" name="MyOverridenConnection"

Is there any way to issue removes in replaced sec

Need help using control adapters at the machine level

Hi guys!

Let me explain our situation. I do web development at a university at which we have to meet strict accessibility guidelines. I've specially modified the adapters (as well as extended CompositeDataBoundControlAdapter to include GridView) for use on our site and to use with our global stylesheets as well as compiled the control adapters into a DLL.

The control adapters now all reside in the WebServices.CssFriendlyAdapters DLL.  (For example, WebServices.CssFriendlyAdapters.GridViewAdapter).

Currently, when someone drops an App_Browsers folder in to their site with the adapters specified, the adapters work. However, we'd like to be able to specify this in the C:\WINDOWS\Microsoft.NET\Framework\(version number)\CONFIG\Browsers directory so that the adapters work automatically without anyone having to move anything into App_Browsers for every site. To ensure that someone can still use the "old way" or will not be confused by their controls being adapted, I've written in code that uses the base rendering methods unless xhtmlConformance is set to "Strict" in the site's web.config file.

Anyway, on to the problem. When trying to compile the controlAdapters into the C:\WINDOWS\Microsoft.NET\Framework\(version number)\CONFIG\Browsers directory using aspnet_regbrowsers.exe (see http://msdn2.microsoft.com/en-us/library/ms229858.a

Contract-First Web Services: Schema-based Development with Windows Communication Foundation


Schema- first contract-first modeling of Web Services gives you the ability to model your contracts with an XML-centric mindset. This process keeps you focused on universally acceptable types and the hierarchical data structures that can be represented in XML.

Christian Weyer, Buddhike de Silva

MSDN Magazine October 2009

{ End Bracket }: The Emergence Of Machine Translation


Vikram Dendi looks at how machine translation is poised to change the world and why it is so important to deliver information in multiple languages.

Vikram Dendi

MSDN Magazine January 2009

Class To Contract: Enrich Your XML Serialization With Schema Providers In The .NET Framework


The Microsoft .NET Framework 1.x provided minimal options for mapping classes to schemas and serializing objects to XML documents, making this sort of mapping quite a challenge. The .NET Framework 2.0 changes all this with Schema providers and the IXmlSerializable interface.

Keith Pijanowski

MSDN Magazine June 2006

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