Showing posts with label system. Show all posts
Showing posts with label system. Show all posts

Monday, March 26, 2012

The current configuration system does not support user-scoped settings

I have a problem in which I'm trying to access a method in a .DLL from
an ASP.Net web page (written in C#). I keep on getting the error "The
current configuration system does not support user-scoped settings".
I've done some research into this problem and I've found out that the
solution has something to do with the ConfigurationManager.AppSettings
for settings, or Profiles for per-user configutation in ASP.Net 2.0.
However, I don't know where to find the ConfigurationManager! I've
looked in Website/ASP.Net configuration and Tools/Options +
Environment and I can't find it!
I can't seem to find a handle on what to do about this! Can somebody
help me!
Thanks so very much!
SteveThe solution was posted by Peter Bromberg a few days ago :
http://groups.google.com/group/micr...d338d6f8be72265
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
"Steve Kershaw" <steve_kershaw@dotnet.itags.org.yahoo.com> wrote in message
news:1176321253.364736.216290@dotnet.itags.org.q75g2000hsh.googlegroups.com...
> I have a problem in which I'm trying to access a method in a .DLL from
> an ASP.Net web page (written in C#). I keep on getting the error "The
> current configuration system does not support user-scoped settings".
> I've done some research into this problem and I've found out that the
> solution has something to do with the ConfigurationManager.AppSettings
> for settings, or Profiles for per-user configutation in ASP.Net 2.0.
> However, I don't know where to find the ConfigurationManager! I've
> looked in Website/ASP.Net configuration and Tools/Options +
> Environment and I can't find it!
> I can't seem to find a handle on what to do about this! Can somebody
> help me!
> Thanks so very much!
> Steve
>
On Apr 11, 2:21 pm, "Juan T. Llibre" <nomailrepl...@dotnet.itags.org.nowhere.com>
wrote:
> The solution was posted by Peter Bromberg a few days ago :
> http://groups.google.com/group/micr...amework.aspn...
> Juan T. Llibre, asp.net MVP
> asp.net faq :http://asp.net.do/faq/
> foros de asp.net, en espa=F1ol :http://asp.net.do/foros/
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D"Steve Kershaw" <steve_kers...@dotnet.itags.org.yahoo.com> =
wrote in message
> news:1176321253.364736.216290@dotnet.itags.org.q75g2000hsh.googlegroups.com...
>
>
>
>
>
>
>
> - Show quoted text -
Thanks for your help.
But where is this posting? I searched clear back to the beginning of
March for Peter Bromberg's posting on this but I just can't see it.
Can you give me a link?
Thanks again.
Steve
re:
!>> The solution was posted by Peter Bromberg a few days ago :
!> But where is this posting? I searched clear back to the beginning of
!> March for Peter Bromberg's posting on this but I just can't see it.
!> Can you give me a link?
Oops, I meant "a few minutes ago".
I've warned my fingers not to post on their own any more.
<chuckle>
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
"Steve Kershaw" <steve_kershaw@dotnet.itags.org.yahoo.com> wrote in message
news:1176324797.391045.45160@dotnet.itags.org.n76g2000hsh.googlegroups.com...
On Apr 11, 2:21 pm, "Juan T. Llibre" <nomailrepl...@dotnet.itags.org.nowhere.com>
wrote:
> The solution was posted by Peter Bromberg a few days ago :
> http://groups.google.com/group/micr...amework.aspn...
> Juan T. Llibre, asp.net MVP
> asp.net faq :http://asp.net.do/faq/
> foros de asp.net, en espaol :http://asp.net.do/foros/
> ==================================="Steve Kershaw" <steve_kers...@dotnet.itags.org.yahoo.co
m> wrote in message
> news:1176321253.364736.216290@dotnet.itags.org.q75g2000hsh.googlegroups.com...
>
>
>
>
>
>
>
> - Show quoted text -
Thanks for your help.
But where is this posting? I searched clear back to the beginning of
March for Peter Bromberg's posting on this but I just can't see it.
Can you give me a link?
Thanks again.
Steve

The current configuration system does not support user-scoped settings.

Hi,
I keep on getting this error: "The current configuration system does
not support user-scoped settings." I'm trying to use a DLL that I have
developed previously. When I try to access a public method in that DLL
I get this error.
I know it's probably a configuration setting somewhere, but where and
what do I set it to?
Thanks in advance for your help.Does this help?
http://www.ben-rush.net/blog/PermaL... />
780&dotnet
My guess it's related to something like this - and I'm making this
assumption because you're publishing this question on an ASP.net newsgroup.
~~~~~~~~~~~
Ben Rush
http://www.ben-rush.net/blog
"Steve Kershaw" <steve_kershaw@dotnet.itags.org.yahoo.com> wrote in message
news:1176251428.861886.154110@dotnet.itags.org.y5g2000hsa.googlegroups.com...
> Hi,
> I keep on getting this error: "The current configuration system does
> not support user-scoped settings." I'm trying to use a DLL that I have
> developed previously. When I try to access a public method in that DLL
> I get this error.
> I know it's probably a configuration setting somewhere, but where and
> what do I set it to?
> Thanks in advance for your help.
>

The current configuration system does not support user-scoped settings.

What does mean this error?
The current configuration system does not support user-scoped settings.
I'm accessing a my.settings data from a DAL dll referenced by an ASP.NET
app. I've a similar other application that works well. The one with the
problem is an 1.1 upgraded, the one that works a native 2.0. I cannot find
differences :(Ok, it was very stupid to find.. :((
"Trapulo" <trapulo@dotnet.itags.org.noemail.noemail> wrote in message
news:eqwOWgtbGHA.1264@dotnet.itags.org.TK2MSFTNGP05.phx.gbl...
> What does mean this error?
> The current configuration system does not support user-scoped settings.
>
> I'm accessing a my.settings data from a DAL dll referenced by an ASP.NET
> app. I've a similar other application that works well. The one with the
> problem is an 1.1 upgraded, the one that works a native 2.0. I cannot find
> differences :(
>
>
>
Hi Trapulo,
Thank you for posting.
My.Settings object in VB.NET 2005 is normally used to access user-scope
settings. User-scope settings are often used by WinForm applications which
run under a specific user account. Since ASP.NET applications run under a
server account, using user-scope settings here is not appropriate.
If you are using ConfigruationSettings.AppSettings previously in your 1.1
DAL dll, you can now use ConfigurationManager.AppSettings after upgraded to
2.0 (remember to reference System.Configuration assembly first).
If you still want to access user-scope settings, you can use Profiles in
ASP.NET 2.0.
If there is anything unclear, please feel free to post here.
Regards,
Walter Wang
Microsoft Online Community Support
========================================
==========
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
========================================
==========
This posting is provided "AS IS" with no warranties, and confers no rights.
Thank you.
In fact I jsut selected "user" scope insted of "application" scope on my
project's settings.
"Walter Wang [MSFT]" <wawang@dotnet.itags.org.online.microsoft.com> wrote in message
news:OZtS%23E0bGHA.4776@dotnet.itags.org.TK2MSFTNGXA01.phx.gbl...
> Hi Trapulo,
> Thank you for posting.
> My.Settings object in VB.NET 2005 is normally used to access user-scope
> settings. User-scope settings are often used by WinForm applications which
> run under a specific user account. Since ASP.NET applications run under a
> server account, using user-scope settings here is not appropriate.
> If you are using ConfigruationSettings.AppSettings previously in your 1.1
> DAL dll, you can now use ConfigurationManager.AppSettings after upgraded
> to
> 2.0 (remember to reference System.Configuration assembly first).
> If you still want to access user-scope settings, you can use Profiles in
> ASP.NET 2.0.
> If there is anything unclear, please feel free to post here.
> Regards,
> Walter Wang
> Microsoft Online Community Support
>

The current configuration system does not support user-scoped settings.

What does mean this error?
The current configuration system does not support user-scoped settings.

I'm accessing a my.settings data from a DAL dll referenced by an ASP.NET
app. I've a similar other application that works well. The one with the
problem is an 1.1 upgraded, the one that works a native 2.0. I cannot find
differences :(Ok, it was very stupid to find.. :((

"Trapulo" <trapulo@dotnet.itags.org.noemail.noemail> wrote in message
news:eqwOWgtbGHA.1264@dotnet.itags.org.TK2MSFTNGP05.phx.gbl...
> What does mean this error?
> The current configuration system does not support user-scoped settings.
>
> I'm accessing a my.settings data from a DAL dll referenced by an ASP.NET
> app. I've a similar other application that works well. The one with the
> problem is an 1.1 upgraded, the one that works a native 2.0. I cannot find
> differences :(
>
>
Hi Trapulo,

Thank you for posting.

My.Settings object in VB.NET 2005 is normally used to access user-scope
settings. User-scope settings are often used by WinForm applications which
run under a specific user account. Since ASP.NET applications run under a
server account, using user-scope settings here is not appropriate.

If you are using ConfigruationSettings.AppSettings previously in your 1.1
DAL dll, you can now use ConfigurationManager.AppSettings after upgraded to
2.0 (remember to reference System.Configuration assembly first).

If you still want to access user-scope settings, you can use Profiles in
ASP.NET 2.0.

If there is anything unclear, please feel free to post here.

Regards,

Walter Wang
Microsoft Online Community Support

==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
Thank you.

In fact I jsut selected "user" scope insted of "application" scope on my
project's settings.

"Walter Wang [MSFT]" <wawang@dotnet.itags.org.online.microsoft.com> wrote in message
news:OZtS%23E0bGHA.4776@dotnet.itags.org.TK2MSFTNGXA01.phx.gbl...
> Hi Trapulo,
> Thank you for posting.
> My.Settings object in VB.NET 2005 is normally used to access user-scope
> settings. User-scope settings are often used by WinForm applications which
> run under a specific user account. Since ASP.NET applications run under a
> server account, using user-scope settings here is not appropriate.
> If you are using ConfigruationSettings.AppSettings previously in your 1.1
> DAL dll, you can now use ConfigurationManager.AppSettings after upgraded
> to
> 2.0 (remember to reference System.Configuration assembly first).
> If you still want to access user-scope settings, you can use Profiles in
> ASP.NET 2.0.
> If there is anything unclear, please feel free to post here.
> Regards,
> Walter Wang
> Microsoft Online Community Support

The current configuration system does not support user-scoped settings.

Hi,

I keep on getting this error: "The current configuration system does
not support user-scoped settings." I'm trying to use a DLL that I have
developed previously. When I try to access a public method in that DLL
I get this error.

I know it's probably a configuration setting somewhere, but where and
what do I set it to?

Thanks in advance for your help.Does this help?

http://www.ben-rush.net/blog/PermaL...8f0f3780&dotnet
My guess it's related to something like this - and I'm making this
assumption because you're publishing this question on an ASP.net newsgroup.

--
~~~~~~~~~~~
Ben Rush
http://www.ben-rush.net/blog
"Steve Kershaw" <steve_kershaw@dotnet.itags.org.yahoo.comwrote in message
news:1176251428.861886.154110@dotnet.itags.org.y5g2000hsa.googlegro ups.com...

Quote:

Originally Posted by

Hi,
>
I keep on getting this error: "The current configuration system does
not support user-scoped settings." I'm trying to use a DLL that I have
developed previously. When I try to access a public method in that DLL
I get this error.
>
I know it's probably a configuration setting somewhere, but where and
what do I set it to?
>
Thanks in advance for your help.
>

The current configuration system does not support user-scoped settings

I have a problem in which I'm trying to access a method in a .DLL from
an ASP.Net web page (written in C#). I keep on getting the error "The
current configuration system does not support user-scoped settings".

I've done some research into this problem and I've found out that the
solution has something to do with the ConfigurationManager.AppSettings
for settings, or Profiles for per-user configutation in ASP.Net 2.0.
However, I don't know where to find the ConfigurationManager! I've
looked in Website/ASP.Net configuration and Tools/Options +
Environment and I can't find it!

I can't seem to find a handle on what to do about this! Can somebody
help me!

Thanks so very much!

SteveJust set a reference to the System.Configuration assembly and
ConfigurationManager will magically appear.
Peter

--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net
"Steve Kershaw" wrote:

Quote:

Originally Posted by

>
I have a problem in which I'm trying to access a method in a .DLL from
an ASP.Net web page (written in C#). I keep on getting the error "The
current configuration system does not support user-scoped settings".
>
I've done some research into this problem and I've found out that the
solution has something to do with the ConfigurationManager.AppSettings
for settings, or Profiles for per-user configutation in ASP.Net 2.0.
However, I don't know where to find the ConfigurationManager! I've
looked in Website/ASP.Net configuration and Tools/Options +
Environment and I can't find it!
>
I can't seem to find a handle on what to do about this! Can somebody
help me!
>
Thanks so very much!
>
Steve
>
>


On Apr 11, 2:04 pm, Peter Bromberg [C# MVP]
<pbromb...@dotnet.itags.org.yahoo.yabbadabbadoo.comwrote:

Quote:

Originally Posted by

Just set a reference to the System.Configuration assembly and
ConfigurationManager will magically appear.
Peter
>
--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net
>
>
>
"Steve Kershaw" wrote:
>

Quote:

Originally Posted by

I have a problem in which I'm trying to access a method in a .DLL from
an ASP.Net web page (written in C#). I keep on getting the error "The
current configuration system does not support user-scoped settings".


>

Quote:

Originally Posted by

I've done some research into this problem and I've found out that the
solution has something to do with the ConfigurationManager.AppSettings
for settings, or Profiles for per-user configutation in ASP.Net 2.0.
However, I don't know where to find the ConfigurationManager! I've
looked in Website/ASP.Net configuration and Tools/Options +
Environment and I can't find it!


>

Quote:

Originally Posted by

I can't seem to find a handle on what to do about this! Can somebody
help me!


>

Quote:

Originally Posted by

Thanks so very much!


>

Quote:

Originally Posted by

Steve- Hide quoted text -


>
- Show quoted text -


Thanks so much for your help!

OK,
So I now have the Configuration Manager, what do I do?
I see "Project", "Configuration" (Debug), "Platform" (.NET) and
"Build" columns but no AppSettings seems to be available. Help!!!
The solution was posted by Peter Bromberg a few days ago :

http://groups.google.com/group/micr...d338d6f8be72265
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
"Steve Kershaw" <steve_kershaw@dotnet.itags.org.yahoo.comwrote in message
news:1176321253.364736.216290@dotnet.itags.org.q75g2000hsh.googlegr oups.com...

Quote:

Originally Posted by

>
I have a problem in which I'm trying to access a method in a .DLL from
an ASP.Net web page (written in C#). I keep on getting the error "The
current configuration system does not support user-scoped settings".
>
I've done some research into this problem and I've found out that the
solution has something to do with the ConfigurationManager.AppSettings
for settings, or Profiles for per-user configutation in ASP.Net 2.0.
However, I don't know where to find the ConfigurationManager! I've
looked in Website/ASP.Net configuration and Tools/Options +
Environment and I can't find it!
>
I can't seem to find a handle on what to do about this! Can somebody
help me!
>
Thanks so very much!
>
Steve
>


re:
!>The solution was posted by Peter Bromberg a few days ago :

!But where is this posting? I searched clear back to the beginning of
!March for Peter Bromberg's posting on this but I just can't see it.
!Can you give me a link?

Oops, I meant "a few minutes ago".

I've warned my fingers not to post on their own any more.

<chuckle>

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
"Steve Kershaw" <steve_kershaw@dotnet.itags.org.yahoo.comwrote in message
news:1176324797.391045.45160@dotnet.itags.org.n76g2000hsh.googlegro ups.com...
On Apr 11, 2:21 pm, "Juan T. Llibre" <nomailrepl...@dotnet.itags.org.nowhere.com>
wrote:

Quote:

Originally Posted by

The solution was posted by Peter Bromberg a few days ago :
>
http://groups.google.com/group/micr...framework.aspn...
>
Juan T. Llibre, asp.net MVP
asp.net faq :http://asp.net.do/faq/
foros de asp.net, en espaol :http://asp.net.do/foros/
==================================="Steve Kershaw" <steve_kers...@dotnet.itags.org.yahoo.comwrote in message
>
news:1176321253.364736.216290@dotnet.itags.org.q75g2000hsh.googlegr oups.com...
>
>
>
>
>

Quote:

Originally Posted by

I have a problem in which I'm trying to access a method in a .DLL from
an ASP.Net web page (written in C#). I keep on getting the error "The
current configuration system does not support user-scoped settings".


>

Quote:

Originally Posted by

I've done some research into this problem and I've found out that the
solution has something to do with the ConfigurationManager.AppSettings
for settings, or Profiles for per-user configutation in ASP.Net 2.0.
However, I don't know where to find the ConfigurationManager! I've
looked in Website/ASP.Net configuration and Tools/Options +
Environment and I can't find it!


>

Quote:

Originally Posted by

I can't seem to find a handle on what to do about this! Can somebody
help me!


>

Quote:

Originally Posted by

Thanks so very much!


>

Quote:

Originally Posted by

Steve- Hide quoted text -


>
- Show quoted text -


Thanks for your help.

But where is this posting? I searched clear back to the beginning of
March for Peter Bromberg's posting on this but I just can't see it.
Can you give me a link?

Thanks again.
Steve
On Apr 11, 2:21 pm, "Juan T. Llibre" <nomailrepl...@dotnet.itags.org.nowhere.com>
wrote:

Quote:

Originally Posted by

The solution was posted by Peter Bromberg a few days ago :
>
http://groups.google.com/group/micr...framework.aspn...
>
Juan T. Llibre, asp.net MVP
asp.net faq :http://asp.net.do/faq/
foros de asp.net, en espaol :http://asp.net.do/foros/
==================================="Steve Kershaw" <steve_kers...@dotnet.itags.org.yahoo.comwrote in message
>
news:1176321253.364736.216290@dotnet.itags.org.q75g2000hsh.googlegr oups.com...
>
>
>
>
>

Quote:

Originally Posted by

I have a problem in which I'm trying to access a method in a .DLL from
an ASP.Net web page (written in C#). I keep on getting the error "The
current configuration system does not support user-scoped settings".


>

Quote:

Originally Posted by

I've done some research into this problem and I've found out that the
solution has something to do with the ConfigurationManager.AppSettings
for settings, or Profiles for per-user configutation in ASP.Net 2.0.
However, I don't know where to find the ConfigurationManager! I've
looked in Website/ASP.Net configuration and Tools/Options +
Environment and I can't find it!


>

Quote:

Originally Posted by

I can't seem to find a handle on what to do about this! Can somebody
help me!


>

Quote:

Originally Posted by

Thanks so very much!


>

Quote:

Originally Posted by

Steve- Hide quoted text -


>
- Show quoted text -


Thanks for your help.

But where is this posting? I searched clear back to the beginning of
March for Peter Bromberg's posting on this but I just can't see it.
Can you give me a link?

Thanks again.
Steve
Steve,

ConfigurationManager.AppSettings represents the NameValue collection of the
entries you have in your <appSettingsweb.config (or xx.exe.config)
configuration file. You can access individual elements with:
ConfigurationManager.AppSettings["connectionString"]

to get the string value.
Peter

--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net
"Steve Kershaw" wrote:

Quote:

Originally Posted by

On Apr 11, 2:21 pm, "Juan T. Llibre" <nomailrepl...@dotnet.itags.org.nowhere.com>
wrote:

Quote:

Originally Posted by

The solution was posted by Peter Bromberg a few days ago :

http://groups.google.com/group/micr...framework.aspn...

Juan T. Llibre, asp.net MVP
asp.net faq :http://asp.net.do/faq/
foros de asp.net, en espa?ol :http://asp.net.do/foros/
==================================="Steve Kershaw" <steve_kers...@dotnet.itags.org.yahoo.comwrote in message

news:1176321253.364736.216290@dotnet.itags.org.q75g2000hsh.googlegr oups.com...

Quote:

Originally Posted by

I have a problem in which I'm trying to access a method in a .DLL from
an ASP.Net web page (written in C#). I keep on getting the error "The
current configuration system does not support user-scoped settings".


Quote:

Originally Posted by

I've done some research into this problem and I've found out that the
solution has something to do with the ConfigurationManager.AppSettings
for settings, or Profiles for per-user configutation in ASP.Net 2.0.
However, I don't know where to find the ConfigurationManager! I've
looked in Website/ASP.Net configuration and Tools/Options +
Environment and I can't find it!


Quote:

Originally Posted by

I can't seem to find a handle on what to do about this! Can somebody
help me!


Quote:

Originally Posted by

Thanks so very much!


Quote:

Originally Posted by

Steve- Hide quoted text -


- Show quoted text -


>
Thanks for your help.
>
But where is this posting? I searched clear back to the beginning of
March for Peter Bromberg's posting on this but I just can't see it.
Can you give me a link?
>
Thanks again.
Steve
>
>

Saturday, March 24, 2012

The dreaded asp.clipboard

this is a permissions issue. your aspnet account needs permission to
manipulate system resources on the desktop
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"Bill Belliveau" <anonymous@dotnet.itags.org.discussions.microsoft.com> wrote in message
news:06D644D5-E7C1-47D1-97AC-826157A1BFA2@dotnet.itags.org.microsoft.com...
> Hello all,
> I have the need to copy something to the clipboard via 3rd party type
> library and then pick it up on the .NET side via the clipboard (all
> server-side). To complicate the issue, the application needs to be web
> oriented (ASP.NET).
> I have a console version that work, but I can't seem to get the ASP side
> working. I have included the Forms assembly and I'm able to write to the
> clipboard via the 3rd party, but the clipboard is always unassigned (null)
> in ASP.NET when in fact the clipboard can be pasted into PhotoShop.
> I've searched a lot of articles about this issue. Some suggest that it's
> a permissions issue. To rule out permissions, I have the site
> impersonate. The impersonating identity is myself and since I can past
> into Photoshop, I can only assume my identity has access to the clipboard.
> Any insight is appreciated.
> Thanks,
> Bill
>Alvin,
Thanks for the response.
Maybe I'm missing something else then. Before impersionation I tried settin
g the processModel user to SYSTEM, and had the same problem. I have also ad
ded the ASPNET account to the 'run as part of the operation system' policy w
ith no luck.
When I call, clipboardData.GetDataPresent(DataFormats.Bitmap) the exception
being returned is null object (Object reference not set to an instance of an
object.). The most likely cause is permissions, but as far as I can tell I
've tried giving the adequa
te permissions - or am I missing something?
Thanks again.
Bill
can you impersonate to an authenticated user and see if this works?
Otherwise post your code and i'll work with you on it
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"Bill Belliveau" <anonymous@.discussions.microsoft.com> wrote in message
news:C8A65D45-FCD3-4871-A822-79EA22F5E7A7@.microsoft.com...
> Alvin,
> Thanks for the response.
> Maybe I'm missing something else then. Before impersionation I tried
> setting the processModel user to SYSTEM, and had the same problem. I have
> also added the ASPNET account to the 'run as part of the operation system'
> policy with no luck.
> When I call, clipboardData.GetDataPresent(DataFormats.Bitmap) the
> exception being returned is null object (Object reference not set to an
> instance of an object.). The most likely cause is permissions, but as far
> as I can tell I've tried giving the adequate permissions - or am I missing
> something?
> Thanks again.
> Bill

Thursday, March 22, 2012

The file system has let me down (writing XML directly to the DB)

After months of trying to track down a bug where, randomly, on rare
occasions, our XML files only get half-written from our application, we're
throwing up our hands and moving it into the DB.

So, instead of writing our XML files to the filesystem, I'm just going to
send the XML straight to a field in the DB and just grab it from there when
needed.

I have a few questions regarding that:

- preferred method? Right now, I'm using a FileStream:

Dim fs As New
System.IO.FileStream(System.Web.HttpContext.Curren t.Server.MapPath("/mjb05/rulesXML/"
& Trim(DS.Tables(0).Rows(rowCount)("filename").ToString) & ".xml"),
IO.FileMode.Create, IO.FileAccess.Write, IO.FileShare.Read)

If I'm going to send the text string right to the DB, what should I be
using? Stringbuilder and then just pass the XMLwriter to that?

- caching

One reason we liked the XML was that the server could easily cache it (we
access the XML on each page of our site). And the cache would only update
when the file was updated. If we store it in the database, we'd have to do a
query to see if it's been updated. Is that a big deal? Should we just cache
it every 5 minutes or so? Other preferred method?

-Darrel

--
================================================== ===============
Win prizes searching google:
http://www.blingo.com/friends?ref=h...FnTqhv-2GE1FNtAThus wrote darrel,

> After months of trying to track down a bug where, randomly, on rare
> occasions, our XML files only get half-written from our application,
> we're throwing up our hands and moving it into the DB.
> So, instead of writing our XML files to the filesystem, I'm just going
> to send the XML straight to a field in the DB and just grab it from
> there when needed.
> I have a few questions regarding that:
> - preferred method? Right now, I'm using a FileStream:
> Dim fs As New
> System.IO.FileStream(System.Web.HttpContext.Curren t.Server.MapPath("/m
> jb05/rulesXML/" &
> Trim(DS.Tables(0).Rows(rowCount)("filename").ToString) & ".xml"),
> IO.FileMode.Create, IO.FileAccess.Write, IO.FileShare.Read)
> If I'm going to send the text string right to the DB, what should I be
> using? Stringbuilder and then just pass the XMLwriter to that?

If your database has a native XML datatype and it's supported by its ADO.NET
provider, I'd use that -- one example is SQL Server (Express) 2005. You can
also get away using CLOBs or BLOBs if you don't care about the XML content
at database level (i.e. don't need to search within an XML document). That
should work with any old database.

> - caching
> One reason we liked the XML was that the server could easily cache it
> (we access the XML on each page of our site). And the cache would only
> update when the file was updated. If we store it in the database, we'd
> have to do a query to see if it's been updated. Is that a big deal?
> Should we just cache it every 5 minutes or so? Other preferred method?

Again, SQL Server 2005 comes to the rescue. Using a SqlCacheDependency, you
can easily implement an automatic refresh of your cached objects. See http://msdn.microsoft.com/library/d...otification.asp.

You can also emulate this feature using database triggers in other databases.

Cheers,
--
Joerg Jooss
news-reply@.joergjooss.de

The file system has let me down (writing XML directly to the DB)

After months of trying to track down a bug where, randomly, on rare
occasions, our XML files only get half-written from our application, we're
throwing up our hands and moving it into the DB.
So, instead of writing our XML files to the filesystem, I'm just going to
send the XML straight to a field in the DB and just grab it from there when
needed.
I have a few questions regarding that:
- preferred method? Right now, I'm using a FileStream:
Dim fs As New
System.IO.FileStream(System.Web.HttpContext.Current.Server.MapPath("/mjb05/r
ulesXML/"
& Trim(DS.Tables(0).Rows(rowCount)("filename").ToString) & ".xml"),
IO.FileMode.Create, IO.FileAccess.Write, IO.FileShare.Read)
If I'm going to send the text string right to the DB, what should I be
using? Stringbuilder and then just pass the XMLwriter to that?
- caching
One reason we liked the XML was that the server could easily cache it (we
access the XML on each page of our site). And the cache would only update
when the file was updated. If we store it in the database, we'd have to do a
query to see if it's been updated. Is that a big deal? Should we just cache
it every 5 minutes or so? Other preferred method?
-Darrel
========================================
=========================
Win prizes searching google:
http://www.blingo.com/friends?ref=h...FnTqhv-2GE1FNtAThus wrote darrel,

> After months of trying to track down a bug where, randomly, on rare
> occasions, our XML files only get half-written from our application,
> we're throwing up our hands and moving it into the DB.
> So, instead of writing our XML files to the filesystem, I'm just going
> to send the XML straight to a field in the DB and just grab it from
> there when needed.
> I have a few questions regarding that:
> - preferred method? Right now, I'm using a FileStream:
> Dim fs As New
> System.IO.FileStream(System.Web.HttpContext.Current.Server.MapPath("/m
> jb05/rulesXML/" &
> Trim(DS.Tables(0).Rows(rowCount)("filename").ToString) & ".xml"),
> IO.FileMode.Create, IO.FileAccess.Write, IO.FileShare.Read)
> If I'm going to send the text string right to the DB, what should I be
> using? Stringbuilder and then just pass the XMLwriter to that?
If your database has a native XML datatype and it's supported by its ADO.NET
provider, I'd use that -- one example is SQL Server (Express) 2005. You can
also get away using CLOBs or BLOBs if you don't care about the XML content
at database level (i.e. don't need to search within an XML document). That
should work with any old database.

> - caching
> One reason we liked the XML was that the server could easily cache it
> (we access the XML on each page of our site). And the cache would only
> update when the file was updated. If we store it in the database, we'd
> have to do a query to see if it's been updated. Is that a big deal?
> Should we just cache it every 5 minutes or so? Other preferred method?
Again, SQL Server 2005 comes to the rescue. Using a SqlCacheDependency, you
can easily implement an automatic refresh of your cached objects. See http://msdn.
microsoft.com/l...on
.asp.
You can also emulate this feature using database triggers in other databases
.
Cheers,
--
Joerg Jooss
news-reply@.joergjooss.de

Tuesday, March 13, 2012

The lifecycle of Cache

Hi all:

I want to use System.Web.Caching.Cache in my web application, but I want to
know the lifecycle of Cache (depending on Page, Session or Application ...).
Thanks!

Enoshre:

Quote:

Originally Posted by

I want to know the lifecycle of Cache (depending on Page, Session or Application ...).


One instance of the Cache class is created per application domain,
and it remains valid as long as the application domain remains active.

You can insert items in the Cache :

1. with a key dependency ( When a key dependency changes, the object becomes invalid
and is removed from the cache ). You can opt to have it replaced with a new key dependency.

2. with a file dependency ( When any dependency changes, the object becomes invalid
and is removed from the cache ). You can opt to have it replaced with a new dependency.

3. With a SQLDependency, based on a SQL Server table or query.
When the data changes, so does the cache.

4. with an absoluteExpiration time

5. with a slidingExpiration time

You can also set up a notification when the item is removed from the cache.

See :
http://msdn2.microsoft.com/en-us/library/4y13wyk9.aspx
http://msdn2.microsoft.com/en-us/li...eb.caching.aspx
http://msdn2.microsoft.com/en-us/li...hing.cache.aspx
http://msdn2.microsoft.com/en-us/li...dependency.aspx
For specific usage, see Cache Insert :
http://msdn2.microsoft.com/en-us/li...che.insert.aspx
There's other types of caching, like Output Caching.
You can control its duration with the "Duration parameter :

<%@. OutputCache Duration="#ofseconds"

See :
http://msdn2.microsoft.com/en-us/library/hdxfb6cy.aspx
You can also use partial caching ( caching user controls, for example ):

See:
http://msdn2.microsoft.com/en-us/li...duration.asp x
http://msdn2.microsoft.com/en-us/li...gattribute.aspx
As you can see, there's a number of answers to your question,
depending on the type of caching you perform.

Read the supplied links and decide which type of caching,
and for which duration, is the caching you want to implement.

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
"Enosh Chang" <changenosh@.yahoo.com.twwrote in message
news:u5ek0p37GHA.4404@.TK2MSFTNGP04.phx.gbl...

Quote:

Originally Posted by

Hi all:
>
I want to use System.Web.Caching.Cache in my web application, but I want to know the lifecycle of
Cache (depending on Page, Session or Application ...). Thanks!
>
Enosh
>


Juan's answer is good. Just thought I'd mention that the word you are
looking for is "scope", not "lifecycle".

Karl

--
http://www.openmymind.net/
http://www.codebetter.com/
"Enosh Chang" <changenosh@.yahoo.com.twwrote in message
news:u5ek0p37GHA.4404@.TK2MSFTNGP04.phx.gbl...

Quote:

Originally Posted by

Hi all:
>
I want to use System.Web.Caching.Cache in my web application, but I want
to know the lifecycle of Cache (depending on Page, Session or Application
...). Thanks!
>
Enosh
>

The lifecycle of Cache

Hi all:
I want to use System.Web.Caching.Cache in my web application, but I want to
know the lifecycle of Cache (depending on Page, Session or Application ...).
Thanks!
Enoshre:
> I want to know the lifecycle of Cache (depending on Page, Session or Application .
.).
One instance of the Cache class is created per application domain,
and it remains valid as long as the application domain remains active.
You can insert items in the Cache :
1. with a key dependency ( When a key dependency changes, the object become
s invalid
and is removed from the cache ). You can opt to have it replaced with a new
key dependency.
2. with a file dependency ( When any dependency changes, the object becomes
invalid
and is removed from the cache ). You can opt to have it replaced with a new
dependency.
3. With a SQLDependency, based on a SQL Server table or query.
When the data changes, so does the cache.
4. with an absoluteExpiration time
5. with a slidingExpiration time
You can also set up a notification when the item is removed from the cache.
See :
http://msdn2.microsoft.com/en-us/library/4y13wyk9.aspx
http://msdn2.microsoft.com/en-us/li...eb.caching.aspx
http://msdn2.microsoft.com/en-us/li...hing.cache.aspx
http://msdn2.microsoft.com/en-us/li...cy.asp
x
For specific usage, see Cache Insert :
[url]http://msdn2.microsoft.com/en-us/library/system.web.caching.cache.insert.aspx[/url
]
There's other types of caching, like Output Caching.
You can control its duration with the "Duration parameter :
<%@. OutputCache Duration="#ofseconds"
See :
http://msdn2.microsoft.com/en-us/library/hdxfb6cy.aspx
You can also use partial caching ( caching user controls, for example ):
See:
http://msdn2.microsoft.com/en-us/li... />
ation.aspx
http://msdn2.microsoft.com/en-us/li...te.asp
x
As you can see, there's a number of answers to your question,
depending on the type of caching you perform.
Read the supplied links and decide which type of caching,
and for which duration, is the caching you want to implement.
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
"Enosh Chang" <changenosh@.yahoo.com.tw> wrote in message
news:u5ek0p37GHA.4404@.TK2MSFTNGP04.phx.gbl...
> Hi all:
> I want to use System.Web.Caching.Cache in my web application, but I want t
o know the lifecycle of
> Cache (depending on Page, Session or Application ...). Thanks!
> Enosh
>
Juan's answer is good. Just thought I'd mention that the word you are
looking for is "scope", not "lifecycle".
Karl
http://www.openmymind.net/
http://www.codebetter.com/
"Enosh Chang" <changenosh@.yahoo.com.tw> wrote in message
news:u5ek0p37GHA.4404@.TK2MSFTNGP04.phx.gbl...
> Hi all:
> I want to use System.Web.Caching.Cache in my web application, but I want
> to know the lifecycle of Cache (depending on Page, Session or Application
> ...). Thanks!
> Enosh
>

The Location attribute is not supported by the OutPutCache directive??when i set in the di


--
Thanks and Regards,

Amit Agarwal
Software Programmer(.NET)

--
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.583 / Virus Database: 369 - Release Date: 2/10/2004You may need to supply more information. How you are using it etc. Note:-

Location
One of the OutputCacheLocation enumeration values. The default is Any.
CAUTION This attribute is not supported for @. OutputCache directives
included in user controls (.ascx files).

Andy Mortimer [MS]
Please do not send email directly to this alias. This alias is for
newsgroup purposes only

This posting is provided "AS IS" with no warranties, and confers no rights.
OR if you wish to include a script sample in your post please add "Use of
included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm"

The main Issue on Browse folder in Web application??

Hi,
I want to phrase my problem in a new way that the following code works well on the same system on debugging mode of the project but If I want to copy the url of the project and paste into new browser window without debugging mode, then the problem arises that Its shows progressing the browse folder dialog box does not appears any how. So If any one have the solution of my problem please reply me soon...
I written earlier on this topic shown below...
-----
I am facing a problem of browse folder. Its working fine on loacalhost but when I upload my project into my client's server, the browse folder dialog box does not appears any how. It giving no error but browser progress bar shows progressing...
Is the reason behind this is I have used Shell32.dll for browse folder.. Or there is another way of implementing browse folder functionality on my project..
Thanks
following is mine code
-----------------
Using shell32;
protected void AddFolder_Click(object sender, EventArgs e)
{
string strPath = "";
string strCaption = "Browse a directory for uploading Album.";
//DialogResult dlgResult;
string dlgResult = "";
Shell32.ShellClass shl = new Shell32.ShellClass();
Shell32.Folder2 fld = (Shell32.Folder2)shl.BrowseForFolder(0, strCaption, 0, System.Reflection.Missing.Value);
if (fld == null)
{
dlgResult = "Cancel";//DialogResult.Cancel;
}
else
{
strPath = fld.Self.Path;
lstboxFile.Items.Add(strPath);
//strPath = "albums\\MSN Home Page";
lstboxFile.Items.Add(strPath);
BaydonConstants.hif1.Add(strPath);
dlgResult = "Ok";//DialogResult.OK;
}
}

-----------------

Looks like the problem you are facing is due to security permissions in that folder, please do check on IIS folder permissions as well as the user running under IIS has enough access to that folder.

Merry Xmas


In what kind of environment are you using this? You can't use the shell classes in ASP.NET.


I am using it in a web application which have to run on LAN.

Hi,

Based on my understanding, you want to upload the whole folder and need to show the Directory OpenDialoge. If I have misunderstood you, please feel free to let me know.

As far as I know, you can't achieve this by using the codes above but it can be implemented by ActiveX which is unusual approach we use.

Instead of it, usually we useZip the files ormutiple filesupload to achieve it. There are two links as followings about uploading mutiple files.

http://www.codeproject.com/KB/aspnet/multiuploads.aspx

http://www.codeproject.com/aspnet/FlashUpload.asp

Or you can try thisscript about upload folder:http://scriptbuilders.net/files/uploadfolderaction1.0.html

Hope it helps.