Comments (7)
Have you been able to replicate this? I know there was discussion in Jabbr, not sure whether there was progress made.
from downmarkerwpf.
I am am able to perfectly replicate it by attempting on my account with a roaming profile using the following (in LinqPad):
IsolatedStorageFile.GetStore(IsolatedStorageScope.Assembly | IsolatedStorageScope.User | IsolatedStorageScope.Roaming, null, null);
I get this:
System.IO.IsolatedStorage.IsolatedStorageException: Initialization failed.
at System.IO.IsolatedStorage.IsolatedStorageFile.Init(IsolatedStorageScope scope)
at System.IO.IsolatedStorage.IsolatedStorageFile.GetStore(IsolatedStorageScope scope, Type domainEvidenceType, Type assemblyEvidenceType)
at UserQuery.RunUserAuthoredQuery() in c:\Users\Minutilm\AppData\Local\Temp\ge52ot3a.0.cs:line 33
It works fine on my regular profile but not my roaming profile. Having a quick look with reflector this probably happens when the System.IO.LongPathDirectory.CreateDirectory(..) [internal class and method] fails. Sadly the IsolatedStorageFile class swallows any exception and simply throws its own "Initialization failed" exception so the details of why are lost. I'll attempt some reflector-fu and see if I can reproduce the underlying issue.
from downmarkerwpf.
OK I have confirmed that this is the issue and I believe that it is unique to my environment. Here is the code that GetStore(..)
is running (more or less):
var scope = IsolatedStorageScope.Assembly | IsolatedStorageScope.User | IsolatedStorageScope.Roaming;
var instance = (IsolatedStorageFile)Activator.CreateInstance(typeof(IsolatedStorageFile), true);
typeof(IsolatedStorage).GetMethod("InitStore", BindingFlags.NonPublic | BindingFlags.Instance, null, new[] { typeof(IsolatedStorageScope), typeof(Type), typeof(Type) }, null).Invoke(instance, new object[] { scope, null, null });
var RootDir = typeof(IsolatedStorageFile).GetMethod("GetRootDir", BindingFlags.Static | BindingFlags.NonPublic, null, new[] { typeof(IsolatedStorageScope) }, null).Invoke(null, new object[] { scope }).Dump("Root Dir");
var AssemName = typeof(IsolatedStorage).GetProperty("AssemName", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(instance, null).Dump("Assem Name");
var SeparatorExternal = typeof(IsolatedStorageFile).GetProperty("SeparatorExternal", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(instance, null).Dump("Separator External");
var path = String.Join("", new[] { RootDir, AssemName, SeparatorExternal }).Dump("Path");
try {
Type.GetType("System.IO.LongPathDirectory").GetMethod("CreateDirectory", BindingFlags.Static | BindingFlags.NonPublic).Invoke(null, new object[] { path });
}
catch(TargetInvocationException tex)
{
tex.InnerException.ToString().Dump();
}
This shows that the path it is trying to create exists under a UNC path \\myserver\userAccountm$\profile\Application Data\IsolatedStorage\
and it throws the following:
System.IO.IOException: The filename, directory name, or volume label syntax is incorrect.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.LongPathDirectory.InternalCreateDirectory(String fullPath, String path, Object dirSecurityObj)
at System.IO.LongPathDirectory.CreateDirectory(String path)
This is not the first app that has run into this sort of issue with my roaming profile set up. We can potentially fix this by having a boolean setting to indicate whether Roaming profile is to be used or not because turning it off makes it work from my local drive. If that sounds OK I'll add it and send a pull request.
from downmarkerwpf.
Sorry, I failed to see the question at the end of this - yes, falling back to local directory for settings works for me. I think we've now changed to a XML based (rather than binary based) storage mechanism too. ie, settings provider code is different
from downmarkerwpf.
Also related (if we switch to a flag to toggle), #70
from downmarkerwpf.
It raise "System.IO.IOException: The filename, directory name, or volume label syntax is incorrect." because function "InternalCreateDirectory" before creating folder through Win32 function, add to path "\myserver\userAccountm$\profile\Application Data\IsolatedStorage" prefix "?" which main that this path have type "long UNC", (IsolatedStorage in .NET 4 work with "long UNC" and .NET 3.5 with simple UNC). Long UNC path in this case must be "?\UNC\myserver\userAccountm$\profile\Application Data\IsolatedStorage" but in is "?\myserver\userAccountm$\profile\Application Data\IsolatedStorage" that is way Win32 function return error 123 which mean "The filename, directory name, or volume label syntax is incorrect." It looks like guys in Microsoft forget test it with network paths.
Also I described this problem and workaround in social.msdn: http://social.msdn.microsoft.com/Forums/en-US/netfxbcl/thread/74712ff7-3611-40d0-a983-945b0307ffe8
from downmarkerwpf.
Closing this as we're using SettingsProvider.net - see JakeGinnivan/SettingsProvider.net#5 for the current state of affairs
from downmarkerwpf.
Related Issues (20)
- Directory Browser Should be able to remain pinned to a location
- Should Scroll to edited location HOT 1
- can add a win10 support? HOT 9
- All Chinese are marked as grammatical errors HOT 2
- Add chocolatey/Squirrel support. HOT 12
- Preview on HighDPI looks unreadable HOT 3
- Can't launch on windows 10 10.0.10240 HOT 1
- Add GFM HOT 1
- Build failing on VS2015 HOT 10
- This Visual is not connected to a PresentationSource. HOT 2
- Can't find chinese in setting.
- Visible whitespace
- When I close blank page and open another blank page, markpad won't format text HOT 2
- in the SettingsView.xaml -> display remove FONT textblock
- Issue with multiline fixed-width blocks HOT 2
- Not a real issue HOT 1
- Problem with utf8 and can't be installed or launched
- option to toggle editor window on/off HOT 1
- how to correctly build the vs environment, which here the nugut package failed when installing CEF
- Gtyhhhh
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from downmarkerwpf.