Home All Groups Group Topic Archive Search About

Could not create Microsoft.VisualBasic.Logging.FileLogTraceListener, Microsoft.VisualBasic, Version=

Author
29 Jul 2006 9:31 AM
alanwo
Hi Expert,


I am the fan of VB My.Application.Log. When I create a new project, it
works but after some times  My.Application.Log.WriteEntry nno longer
work. Exception is enclosed:

Could not create Microsoft.VisualBasic.Logging.FileLogTraceListener,
Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL.

System.Configuration.ConfigurationErrorsException was caught
  BareMessage="Could not create
Microsoft.VisualBasic.Logging.FileLogTraceListener,
Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL."
  Line=0
  Message="Could not create
Microsoft.VisualBasic.Logging.FileLogTraceListener,
Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL."
  Source="System"
  StackTrace:
       at System.Diagnostics.TraceUtils.GetRuntimeObject(String
className, Type baseType, String initializeData)
       at System.Diagnostics.TypedElement.BaseGetRuntimeObject()
       at System.Diagnostics.ListenerElement.GetRuntimeObject()
       at System.Diagnostics.ListenerElement.GetRuntimeObject()
       at
System.Diagnostics.ListenerElementsCollection.GetRuntimeObject()
       at System.Diagnostics.TraceSource.Initialize()
       at System.Diagnostics.TraceSource.get_Attributes()
       at
Microsoft.VisualBasic.Logging.Log.DefaultTraceSource.get_HasBeenConfigured()
       at Microsoft.VisualBasic.Logging.Log..ctor()
       at
Microsoft.VisualBasic.ApplicationServices.ApplicationBase.get_Log()
       at NoClone.AppLogHelper.LogSearchStart() in C:\Documents and
Settings\Alan\My Documents\Project1\AppLogHelper.vb:line 46



The innerException is {"Illegal characters in path."}

Please advice.

Alan

Author
29 Jul 2006 10:41 AM
Jon Skeet [C# MVP]
<ala***@gmail.com> wrote:
> I am the fan of VB My.Application.Log. When I create a new project, it
> works but after some times  My.Application.Log.WriteEntry nno longer
> work. Exception is enclosed:

Well, it's suggesting that you've got illegal characters in a path
somewhere. Could you post the code you're using?

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet   Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Author
30 Jul 2006 10:17 AM
alanwo
My lines of code is simpe:
        Try


My.Application.Log.WriteEntry("____________________________________________")
        Catch ex As Exception
            Debug.Print(ex.Message)
        End Try


The stack trace for "Illegal characters in path.":

   at
System.Security.Permissions.FileIOPermission.HasIllegalCharacters(String[]
str)
   at
System.Security.Permissions.FileIOPermission.AddPathList(FileIOPermissionAccess
access, AccessControlActions control, String[] pathListOrig, Boolean
checkForDuplicates, Boolean needFullPath, Boolean copyPathList)
   at
System.Security.Permissions.FileIOPermission..ctor(FileIOPermissionAccess
access, String[] pathList, Boolean checkForDuplicates, Boolean
needFullPath)
   at System.IO.Directory.CreateDirectory(String path,
DirectorySecurity directorySecurity)
   at System.Windows.Forms.Application.GetDataPath(String basePath)
   at System.Windows.Forms.Application.get_UserAppDataPath()
   at Microsoft.VisualBasic.Logging.FileLogTraceListener..ctor(String
name)



Jon 寫道:

Show quote
> <ala***@gmail.com> wrote:
> > I am the fan of VB My.Application.Log. When I create a new project, it
> > works but after some times  My.Application.Log.WriteEntry nno longer
> > work. Exception is enclosed:
>
> Well, it's suggesting that you've got illegal characters in a path
> somewhere. Could you post the code you're using?
>
> --
> Jon Skeet - <sk***@pobox.com>
> http://www.pobox.com/~skeet   Blog: http://www.msmvps.com/jon.skeet
> If replying to the group, please do not mail me too
Author
30 Jul 2006 11:03 AM
alanwo
MsgBox
(My.Computer.FileSystem.SpecialDirectories.CurrentUserApplicationData)
also triggered "Illegal characters in path" error.
But
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) do
not.
Strange.

ala***@gmail.com 寫道:

Show quote
> My lines of code is simpe:
>         Try
>
>
> My.Application.Log.WriteEntry("____________________________________________")
>         Catch ex As Exception
>             Debug.Print(ex.Message)
>         End Try
>
>
> The stack trace for "Illegal characters in path.":
>
>    at
> System.Security.Permissions.FileIOPermission.HasIllegalCharacters(String[]
> str)
>    at
> System.Security.Permissions.FileIOPermission.AddPathList(FileIOPermissionAccess
> access, AccessControlActions control, String[] pathListOrig, Boolean
> checkForDuplicates, Boolean needFullPath, Boolean copyPathList)
>    at
> System.Security.Permissions.FileIOPermission..ctor(FileIOPermissionAccess
> access, String[] pathList, Boolean checkForDuplicates, Boolean
> needFullPath)
>    at System.IO.Directory.CreateDirectory(String path,
> DirectorySecurity directorySecurity)
>    at System.Windows.Forms.Application.GetDataPath(String basePath)
>    at System.Windows.Forms.Application.get_UserAppDataPath()
>    at Microsoft.VisualBasic.Logging.FileLogTraceListener..ctor(String
> name)
>
>
>
> Jon 寫道:
>
> > <ala***@gmail.com> wrote:
> > > I am the fan of VB My.Application.Log. When I create a new project, it
> > > works but after some times  My.Application.Log.WriteEntry nno longer
> > > work. Exception is enclosed:
> >
> > Well, it's suggesting that you've got illegal characters in a path
> > somewhere. Could you post the code you're using?
> >
> > --
> > Jon Skeet - <sk***@pobox.com>
> > http://www.pobox.com/~skeet   Blog: http://www.msmvps.com/jon.skeet
> > If replying to the group, please do not mail me too
Author
30 Jul 2006 11:25 AM
alanwo
Jon,

I got it, I modified <Assembly: AssemblyVersion("4.0.*.*")> in
AssemblyInfo.vb, * is the reason for illegal path characters. Then the
question is how 4.0.*.* does not work? Oh I found that this is a bug:
http://groups.google.com/group/microsoft.public.dotnet.languages.vb/browse_thread/thread/e5ce7ce8b956307c/3690e81988eab0aa?lnk=st&q=&rnum=1#3690e81988eab0aa

Alan

' Version information for an assembly consists of the following four
values:
'
'      Major Version
'      Minor Version
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Build and
Revision Numbers
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>

<Assembly: AssemblyVersion("4.0.*.*")>
<Assembly: AssemblyFileVersion("4.0.*.*")>


ala***@gmail.com 寫道:

Show quote
> MsgBox
> (My.Computer.FileSystem.SpecialDirectories.CurrentUserApplicationData)
> also triggered "Illegal characters in path" error.
> But
> Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) do
> not.
> Strange.
>
> ala***@gmail.com 寫道:
>
> > My lines of code is simpe:
> >         Try
> >
> >
> > My.Application.Log.WriteEntry("____________________________________________")
> >         Catch ex As Exception
> >             Debug.Print(ex.Message)
> >         End Try
> >
> >
> > The stack trace for "Illegal characters in path.":
> >
> >    at
> > System.Security.Permissions.FileIOPermission.HasIllegalCharacters(String[]
> > str)
> >    at
> > System.Security.Permissions.FileIOPermission.AddPathList(FileIOPermissionAccess
> > access, AccessControlActions control, String[] pathListOrig, Boolean
> > checkForDuplicates, Boolean needFullPath, Boolean copyPathList)
> >    at
> > System.Security.Permissions.FileIOPermission..ctor(FileIOPermissionAccess
> > access, String[] pathList, Boolean checkForDuplicates, Boolean
> > needFullPath)
> >    at System.IO.Directory.CreateDirectory(String path,
> > DirectorySecurity directorySecurity)
> >    at System.Windows.Forms.Application.GetDataPath(String basePath)
> >    at System.Windows.Forms.Application.get_UserAppDataPath()
> >    at Microsoft.VisualBasic.Logging.FileLogTraceListener..ctor(String
> > name)
> >
> >
> >
> > Jon 寫道:
> >
> > > <ala***@gmail.com> wrote:
> > > > I am the fan of VB My.Application.Log. When I create a new project, it
> > > > works but after some times  My.Application.Log.WriteEntry nno longer
> > > > work. Exception is enclosed:
> > >
> > > Well, it's suggesting that you've got illegal characters in a path
> > > somewhere. Could you post the code you're using?
> > >
> > > --
> > > Jon Skeet - <sk***@pobox.com>
> > > http://www.pobox.com/~skeet   Blog: http://www.msmvps.com/jon.skeet
> > > If replying to the group, please do not mail me too
Author
1 Aug 2006 7:15 PM
Jon Skeet [C# MVP]
<ala***@gmail.com> wrote:
> I got it, I modified <Assembly: AssemblyVersion("4.0.*.*")> in
> AssemblyInfo.vb, * is the reason for illegal path characters. Then the
> question is how 4.0.*.* does not work? Oh I found that this is a bug:
> http://groups.google.com/group/microsoft.public.dotnet.languages.vb/
> browse_thread/thread/e5ce7ce8b956307c/3690e81988eab0aa?lnk=st&q=&rnum=
> 1#3690e81988eab0aa

Hmm. Odd. I'm afraid I don't know anything more about that :(

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet   Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too

AddThis Social Bookmark Button