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

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

Preventing the use of SQL CE in the GAC

Posted By:      Posted Date: April 10, 2011    Points: 0   Category :

My desktop app uses the private deployment of SQL CE to satisfy 32/64 bit issues.  

I ran into a problem today with a customer who kept getting SQL CE "mismatch" errors when starting up my app.  

We ended up finding that it had an older version of the SQL CE dll's installed in the GAC.

The customer believes the only other program installed since my desktop app was MS Office.  My desktop app worked before, though the customer wasn't sure if MS Office was definitely the only program installed since.   I am not sure if MS Office installs SQL CE in the GAC, but that would be pretty frustrating.

Once we inserted the same version of my desktop app's SQLServerCE.dll and SQLServerCE.Entity.dll into the GAC, everything worked fine.   I am not sure if this messed up any of his programs using the older version, but my desktop app worked fine thereafter.

What is the best approach to this issue?  

Should I put a bat file that automatically registers my dll's in the GAC on install?  I wouldn't think so because I don't want to mess up other programs using other versions.

Is there a way to force my program to use the "local version" of the dll's as opposed to the GAC?  

Thanks for any help you can provide.






View Complete Post

More Related Resource Links

Preventing Manual DataBindings from Being Stupid...

Okay, This is rather annoying, but the basic situation is that using the Control.DataBindings() collection is often VERY simple easy and effective.  However, there are circumstances that require tweaking. Case and point: Application Settings via the My.Settings class structure.  Now, I have a "Preferences" form which upon the load of my application the first time, it requires the user set certain settings (and will cancel out of the app if the aren't defined on the first load).  All of this works fine, but I have a minor little glitch revolving around the Binding.Parse event and the Binding.WriteValue() method. Basically, when the Preferences form loads, all the controls that are bound to a My.Settings property, are set to DataSourceUpdateMode.Never.  In the Form.Load event, I execute a Control.DataBindings(0).ReadValue() on each of the controls that are bound.  This propagates the form with the appropriate values from the My.Settings Class.  Now the user changes/edits/modifies etcetera the values of the controls on the form, and based upon the appropriate values the OK Button will become enabled. Two of the values are "Folder Locations" but are uniquely formatted in my case, using a "special folder" moniker, for Desktop, or My Documents, etc, etc, etc, so if the user browses for a folder or types one in manually, m

.Net Framework 4.0 preventing v2.0 aspnet_regiis from Running

Hi Folks, We have a ASP.net 2.0 web app with an installer which appears to hit an issue with .Net Framework 4.0. This has occurred on XP and Windows 7. Seems to happen every time. During the installation, we call aspnet_regiis for various tasks such as encrypting the web.config. If .Net 4 is installed this throws the error: --------------------------- aspnet_regiis.exe - .NET Framework Initialization Error --------------------------- Unable to find a version of the runtime to run this application. --------------------------- OK    --------------------------- Running the same commands from the commandline works correctly.  Anyone have any idea what is going on? Thanks, Davy

Preventing users from changing password

How to i keep users from changing password for a mssql account? We have a shared login which is readonly to the database.  But every now and then, someone decides to change the password.

Preventing selectedindex changed from firing on binding

When I bind a combo box to an object and it is initially displayed, I notice that the selectedindex changed event is being fired. I don't want this event to fire unless the control is changed interactively. Is there a way to prevent this from occurring or should I be using a different event? TIA

Preventing the "This program might not have installed correctly" warning when (not) installing .NET

Hi all,I am trying to create an installer using Installshield 2009 Pro, which needs to include .NET Framework 3.5 SP1 (the full version or the web downloader, depending on the deployment method). I am using the built-in prerequisites and everything works fine on XP and Vista.However, on Windows7 the installation causes the "This program might not have installed correctly" warning to appear in installer versions that include the .NET Framework prerequisite; I need to prevent this.I understand that Windows7 already includes .NET Framework 3.5 SP1 (and that the .NET setup does not support Windows7), however I cannot find a way to prevent the prerequisite from attempting to install on that OS (the built-in checks seem not to prevent it, either). Either that, or the failure to install is what actually prompts the error message in the first place.So can anybody offer any guidance on how to prevent this warning on Windows7? So far the only choice I can think of is to have a separate installer for Windows7 that does not include the .NET prerequisite, however because it is a requirement for the CD version to include the full .NET installer rather than just the downloader, space is already at a premium.Thanks in advance.

Preventing cross-site scripting and encoding a single quote


I'm trying to prevent possible cross-site scripting attacks for our internal use app (but available publicly outside the firewall).

One feature of our app is a javascript based breadcrumb that keeps track of prior urls (via nice titles). Everytime, a new page is loaded in the current workflow, when that page renders as the browser, it includes some javascript (generated server side in C# and put into the page) to add itself to the breadcrumb trail. Currently, the url that is launched is given directly to that javascript function. However, if that url contains a single quote it is possible to inject some custom javascript, ie, one would just need to append    ');alert('yeah!');       to their url.

I tried encoding/escaping but they skip the single quote. This is a case where I'm just passing the url through. But theoretically, if an attacker tricked somebody into launching his site when they are in ours, then I guess he could get script to execute in our page.

I don't see any method that takes a COMPLETE url and encodes/escapes JUST the parameters. So for now, I'm tearing down the url, and rebuilding it from the ground up, but encoding the parameter names and values.  This basically prevents the script from running, but I do still end up with at least a javascript error because of

Preventing schema changes from replicating


SQL 2008 R2

Is there any way of preventing a table schema change (column addition) from replicating to its subscribers without stopping replication of the table??




How to avoid (Preventing) Multiple Logins in ASP.NET


i need a help

for  avoid (Preventing) Multiple Logins in ASP.NET

preventing overlapping left right aligned divs

I got 2 div layers left and right aligned.
when I resize page second div (pink) overlaps the first (green)

but I want right div can compress the left div as animated image.

is it not possible just via css ?
JQuery can do this with some code but how can do via CSS only?
any clue ? thanks for any answers. 

Transaction log file size preventing all db transactions


Hi, my SQL Server 2008 db is suffering from the transactional log full error.

Can't detach or backup the dbase -- all result in the transaction log full error.

Can't rename the .ldf file, the ALTER statement errs out with  "MODIFY FILE failed. File 'vpa2_log' does not exist."

alter database vpa2 MODIFY FILE ( NAME = vpa2_log,

Preventing removal of a shared dll during a wsp solution uninstallation/retraction



I'm working on a bunch of solutions which uses a third party DLL from vendors like Telerik. We use the dll in most of your solutions. But when i uninstall any of the solutions the dll is getting removed from the assembly. This is a very unfortunate behavior.

I guess even putting the dll in the bin folder wont help it. Because i can use multiple solutions in a same web application. In that case if i remove on solution it is removing the dll from bin folder too.

What is the workaround for this ugly issue?

Thank you.

Visit SharePoint User group - India

Trouble preventing runtime compile of MyLib.XmlSerializers.dll


Hi All, I am using VS2005 on Win7 32bit to build a strongly typed class library that calls a web service. I've used the Add Web Reference wizard in VS2005 to add the reference to the service.

Everything works a treat, except the first call to the service takes 20+ seconds. Subsequent calls take around 40ms (as expected). Other clients (eg. SOAPUI) call the service very fast every time, so it's not the service.

I'm almost certain that the problem is the compiling of the MyLib.XmlSerializers.dll. But no matter what I do I can't prevent it from happening. I've set Project Properties > Build > Generate serialization assembly to 'On' and the file does get generated, but when I call the service a new version of MyLib.XmlSerializers.dll still gets compiled to the %TEMP% directory.

I've tried sgen.exe, again successfully generating the MyLib.XmlSerializers.dll, but still the first call takes ages and the file gets generated in %TEMP% on the first call.

I'm at a loss here and would be extremely grateful if anybody can suggest a potential solution.

Cheers, Leuis


microsoft.net framework v1.1.4322 preventing standby


i saw the solution for avira antivirus, what about if i have trend micro antivirus?


Preventing of Javascript files from being loaded for Anonymous Users



we have  developed an internet  site using Sharepoint 2010 and are trying to fine fine tune the site w.r.t. the performance and are trying to block the OOTB javascript files(i.e ie55up.js, init.js,SP.Core.js,cui,js etc.) for anonymous users.

Have tried all the conventional ways followed in Sharepoint 2007 for the same (i.e. tweaking SharePoint:ScriptLink , asp:ScriptManager controls, using Sharepoint:SPSecurityTrimmedControl etc.) but in vain.

It appears that the OOTB controls placed even in the Sharepoint:SPSecurityTrimmedControl block are called for anonymous users and call  the .js files).

Can anyone suggest the ways to remove the page weight , currently the javascript alone are taking 2MB even for the anonymous users.


Thanks and Regards,


Preventing SQL Server 2008 Express install fails


I'm working on an installer, that installs SQL Server 2008 Express SP1 (soon I will upgrade to SP2) silently, so that my customers can install it without making choises. It all works fine, except of course when the SQL Server installer fails for some reason.

I start the installer with the following parameters:

/QUIETSIMPLE /ACTION=Install /Configurationfile={tmp}\sql2008setup.ini

The ini file simply looks like this:


I do not wish to keep coding my installer reactively, meaning I want to take care of install issues before they happen on the customer side. Therefore I would like to ask here, and find all possible error scenarios, and code my way around them.

I have read the Installing SQL Server 2008 article, but I still have some questions.

This is what I have come up with for my installer so far:

   1. Only install on OS equal or higher

Preventing Multiple Logins


Hi all,

I'm using the "cache tecnique" to prevent multiple logins. Reading in this forum I have read the following code:


    Protected Sub Application_PreRequestHandlerExecute(ByVal sender As [Object], ByVal e As EventArgs)
        If System.Web.HttpContext.Current.Session IsNot Nothing Then

            If Session("users") IsNot Nothing Then

                ' This is after an initial logon 
                Dim sKey As String = CType(Session("users"), String)
                ' Accessing the Cache Item extends the Sliding Expiration automatically 
                Dim sUser As String = CType(HttpContext.Current.Cache(sKey), String)

        End If

    End Sub


                '  Multiple Logins check
                Dim sKey As String = txtUsername.Text + txtPassword.Text
                Dim sUser As String = Convert.ToString(Cache(sKey))
                If (sUser Is Nothing) OrElse (sUser = String.Empty) Then

                    ' Login Permitted
                    Dim SessTimeOut As New TimeSpan(0, 0, HttpContext.Current.Session.Time
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