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


Top 5 Contributors of the Month
Shivakumaran
Post New Web Links

apps automatically using machine.config

Posted By:      Posted Date: October 31, 2010    Points: 0   Category :ASP.Net
 

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.




View Complete Post


More Related Resource Links

Sharepoint Site Web Config elements Gets Deleted automatically

  

see i used to have a security filter settings in web config
security><requestFiltering><requestLimits maxAllowedContentLength="104857600"/></requestFiltering></security>
 but it gets deleted automatically after  i dont know why 
we tried to install something in our server yesterday it didn't worked and reverted it back to yesterdays stage( But i had updated the config files 3 weeks ago) 
but today i check the config files  these elements are  not there.

My system is 64 bit windows server 2008 with IIS 7 and MOSS 2007 SP2


.net 4.0 machine.config schema?

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

Machine.config

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

Assembly entries in Web.Config were adding automatically and now they are not?

  
Hi all,    A while ago when i started using VS 2005, i found that some assembly entries were automatically added to from web.configand i was getting annoying errors. later i found i have added unneccessary references in my application. And its a feature that assembly reference are automatically added to assembly tag in Web.config, So dev don't have to worry about it.    Recently i used Interop.OWC11.dll in my application. And ^&*# got the annoying "CS0234: The type or namespace name 'Office' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)"error again.. Assembly entry was not added automatically. I checked same for existing references in my application, for them to automatic entries is not happening.... ? :(     I have to write is down in Web.config manually... I don't understand why?....Tried to find resources on net for this issue, didn't found any relevant ones.. Please can anyone explain me why this is hapennig?....

Running console apps on host vs dev machine

  
I've always assumed that you could not run code against a remote SharePoint server outside of webservices. Is this correct or is there something similar to the ICredentials / NetworkCredentials objects that you use for webservices.   I wanted to use an app I wrote on a MOSS 2007 Dev machine but the SPS 2003 machine does not have the needed libraries v12.0 libraries. This makes sense but of course I tried to get it to run anyways. Now I'm in the middle of installing Visual Studio on a SPS 2003 dev machine and wanted to see if there was a different way.   Thanks

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: 93.84.191.140   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

Side-side by config error on Win7 64 apps if VS2008 is not installed on the system

  
Hi, I am using Win 764 bit application. When I try to run my application in target machine Iam gettting the following error. The application is running fine if the target machine has VS2008 and SP1 installed   "Unable to Load TekRobo Dll. The application has failed to start because its side -by-side configuration is incorrect. Please see the application event log or use the command line sxstrace.exe for more detail (Exception from HRESULT:0x800736B1.)"        The Evn log viewer mesaage is as given below: Activation context generation failed for "C:\Program Files\Tektronix\TekRobo\TekRobo.dll". Dependent Assembly Microsoft.VC90.DebugCRT,processorArchitecture="amd64",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="9.0.21022.8" could not be found. Please use sxstrace.exe for detailed diagnosis.   Actually the dll which has a problem is originally developed in VC++ and it is using Win32 APIs. Recendly I have moved the code base from VC6 to VS2008 and I have compiled the dlls in 64 bit mode. Any thoughts? Thanks,Mohan Mohan das Gandhi

Add Service reference not updaing the client apps web.config file in .Net Framework 4.0

  

Hi Team

I am doing some experiments with WCF on .Net 4.0. I have created a service in 4.0 and add a new empty web application to consume my Service. When i added a service reference from the IDE, i can see the web.config file is not updated with the Servcie end points. How do i solve this issue?

My web.config in the client looks like this after adding the service reference.

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:
ConfigurationManager.ConnectionStrings["MyDatabase"].ConnectionString

 

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 AJAX
.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:

Serving Silverlight Apps from Windows Mobile

  
Even if mobile dev is not my every day work, thanks to the .Net Compact Framework, it's still .Net programming.

Here is the scenario:

You come back home, you have a windows mobile phone wifi capable and you want to quickly get access to your phone pictures from your home network.
You just activate the Wifi, run my app and then browse to the provided link from any computer on the network.

Practical Multithreading for Client Apps

  
Writing applications that use multiple threads is often considered an advanced programming task, prone to errors. In this month's column, I'll focus on a practical application of multithreading in Windows® Forms applications with some real benefits, while attempting to keep things simple. My goal is to present multithreading in an approachable way that addresses a very common need: writing applications with a user interface that remain responsive to the user.

Automatically redirect to HTTPS and check if SSL is active

  

Hello,

I've set in the web.config:

    <!-- User Authentication -->
    <authentication mode="Forms">
      <forms loginUrl="~/Page/View/Content/Login.aspx" timeout="2880" requireSSL="true" />
    </authentication>


This works fine. If there is no ssl connection, the login form doesn't continue. But I would like to check if ssl is active (in codebehind) and, if it's possible, to automatically the user to the https page if he's currently on http. (I could do this job by manually redirect with page.response("https://url.../login.aspx"); but this is not really generic. For example if the webapp is moved to another domain it doesn't work anymore... I'm looking for something like: FormsAuthentication.RedirectWithSSL(); or so... :D)

Regards,
Chris 



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


Systems.Code.Test.TransactionTest.CreateDataContext_ConnectionString_ReturnsDataContextObject:
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.

Systems.Code.Test.TransactionTest.CreateDataContext_ConnectionString_ReturnsDataContextObject:

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


[Test]
        public void CreateDataContext_ConnectionString_ReturnsDataCon

Modifying connection String in Web config using Install Wizard

  

Hey,

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