Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Library\HttpModules\UrlRewrite\Config, Code ChangeLibrary\HttpModules\UrlRewrite\Config, Code Change
Previous
 
Next
New Post
1/17/2006 11:21 PM
 
Hi I get an error at times with url re-write. here is my changes to config that fix this. Lines changed are in red

        Public Shared Function GetConfig() As RewriterConfiguration
            Dim config As RewriterConfiguration = DirectCast(DataCache.GetCache("RewriterConfig"), RewriterConfiguration)

            If (config Is Nothing) Then

                Dim filePath As String = HttpRuntime.AppDomainAppPath & "SiteUrls.config"

                ' Create a new Xml Serializer
                Dim ser As XmlSerializer = New XmlSerializer(GetType(RewriterConfiguration))

                Dim fileReader As FileStream = New FileStream(filePath, FileMode.Open, FileAccess.Read, FileShare.Read)

                ' Open up the file to deserialize
                Dim reader As StreamReader = New StreamReader(fileReader)

                ' Deserialize into RewriterConfiguration
                config = DirectCast(ser.Deserialize(reader), RewriterConfiguration)

                ' Close the Reader
                reader.Close()

                fileReader.Close()

                If File.Exists(filePath) Then
                    ' Create a dependancy on SiteUrls.config
                    Dim dep As CacheDependency = New CacheDependency(filePath)

                    ' Set back into Cache
                    DataCache.SetCache("RewriterConfig", config, dep)
                Else
                    Return config
                End If

            End If

            Return DirectCast(config, RewriterConfiguration)

        End Function

 
New Post
1/19/2006 1:00 AM
 
Can you detail what error it was you were getting that this fixes?

Scott Willhite, Co-Founder DNN

"It is only with the heart that one can see rightly... what is essential is invisible to the eye. "
~ Antoine de Saint-Exupéry

 
New Post
1/19/2006 2:03 PM
 
Here are two other thread describing the issues you see
Link 1
Link 2

The problem is that in get config, it will currently write the value to the data cache, which is fine. But it assumes that it will be still in the data cache at the end of the function, which is not always the case. So I store the result in to a var to make sure I can always return it. It just seems that multithread design was not taken in to account.

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Library\HttpModules\UrlRewrite\Config, Code ChangeLibrary\HttpModules\UrlRewrite\Config, Code Change


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out