View Complete Post
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:
<connectionStrings> <remove name="MyOverridenConnection"/> <add connectionString="Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=MyDb;Data Source=MyServer" name="MyOverridenConnection" providerName="System.Data.SqlClient"/> </connectionStrings>
For some reason the remove tag is left out during the substitution and I end up with the following in the installed config:
<connectionStrings> <add connectionString="Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=MyDb;Data Source=MyServer" name="MyOverridenConnection" providerName="System.Data.SqlClient"/> </connectionStrings>
Is there any way to issue removes in replaced sec
I'm using an autocomplete contol of ajax toolkit. Yesterday a user found that it had stopped working (it wasn't generating the list as you type letters in the textbox). After hours of troubleshooting, I found that in web.config <httpHandlers>, this line -- <remove verb="*" path="*.asmx" /> was placed after the <add> line like this:
<httpHandlers> <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=184.108.40.206, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=220.127.116.11, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=18.104.22.168, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/> <remove verb="*" path="*.asmx"/> </httpHandlers>
I fixed the problem by removing the <remove> line, but it seems I can also fix the problem by placing the <remove> line b
I am creating a variable number of service hosts at runtime depending on runtime info. However, each of them should use a common service behavior that is known at design time. As such, I'd like to define the service behavior in my config file
and apply it to the runtime created hosts. It appears the method to apply a service behavior to a programmatically created service host is:
However, I'm having trouble figuring out how to acquire an IServiceBehavior reference to the behavior defined in the config file. Is there a factory out there I can use or a static WCF construct I can query?
I'm using Supplemental .config for add an httpmodule to the web.config in Sharepoint 2010. I use a feature receiver to push the entry from Supplemental .config to the web.config.
But I couldn't figure it out how to remove the entry as otherwise it adds the entry over and over again when ever I deploy the feature.
Here is the Supplemental .config.
<?xml version="1.0" encoding="utf-8" ?>
<add name="ABC404HttpModule" type="ABC.Internet.Business.HttpModules.ABC404HttpModule, ABC.Internet.Business, Version=22.214.171.124, Culture=neutral, PublicKeyToken=9e85b319f306f692" />
I tried to use remove node without any success. May be I don't know how to use it correctly.
Thanks in advance.
I'm working on an app where i want to display the built-in windows 7 onscreen keyboard in a 'always there' manner. So i want to:
1. Move it to a particular location
2. Set it to a certain width and height
3. Remove the caption/titlebar so the user can't move it around or close it
4. Remove that abilty to resize it (or any other user adjustments for that matter).
Basically it just permanently sits there. I've tried all the typical API functions (MoveWindow, SetWindowPos, SetWindowLong, etc...) but it refuses to work. Code currently works with all other processes and apps (such as internet explorer
and the command prompt); it's almost as if you can't apply anything to the osk. What am i missing? Thanks in advance.
I need to deliver source code to client and my boss need to remove all the comments and #region sections from the whole web site source code.
So is there any functionality available in visual studio 2010 or may be in an other 3rd party tool available to do so, which can remove all the #region from all over the source code ?
Otherwise my developers has to do donkey work.... :(( and I don't wish it.
Any help or tips/tricks would be appreciated.
my scenario is this: I want to use the linqDataSource control to bind data to a gridview for it's efficient built-in paging and sorting features *but* I don't want the data to be bound until the user has input various search parameters, so I need to bind the data from a button click event. Also, the search options will be somewhat complex in that there will be several optional search parameters, via various dropdowns and textboxes, so I can't just declaratively/statically setup all the WHERE parameters on the linqDataSource (at least I'm assuming I can't, or that it may result in poor performance if I do and just assign default values like the everything wildcard '%' for the cases the user doesn't use a particular search parameter). Given that brief description, here is an example of what I'm doing, but with only one WHERE parameter for simplicity, the real code will be adding anywhere from 1 to about 12 WHERE parameters depending on how the user sets the search options in the GUI.
the linqDataSource on the aspx page:
<asp:LinqDataSource ID="ldsMain" runat="server"
Select="new (field1, field2, field3, etc..)"
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 ?
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.
heres the test method
public void CreateDataContext_ConnectionString_ReturnsDataCon