Closed palfrey closed 11 years ago
maybe you meant Type.FullName (cause your example is 100% not an assembly name)?
also, I'm no expert at .NET file API, but I think if Windows set its limits to
just looked into it - it seems that the only way to overcome this is via Win32 API. that's just not good. btw, it'll be more easy to use a guid instead of full name, and then append a class name to it.
The main considerations are: Make sure the filename is unique, and make sure the file can easily be identified as entity it represents.
Using a GUID appended to the class name sounds like a good compromise.
On Thu, Oct 11, 2012 at 7:06 AM, Gleb Chermennov notifications@github.comwrote:
just looked into it - it seems that the only way to overcome this is via Win32 API. that's just not good. btw, it'll be more easy to use a guid instead of full name, and then append a class name to it.
— Reply to this email directly or view it on GitHubhttps://github.com/jagregory/fluent-nhibernate/issues/84#issuecomment-9317548.
James Gregory
Tel: +61 (0) 411 619 513 Website: http://jagregory.com Twitter: @jagregory http://twitter.com/jagregory
closing this for now as it's not an issue related to Fluent NHibernate
When wanting a good unique filename for the .hbm.xml's, the Assembly.FullName will be unique, but it may exceed Windows 260 character path limits.
e.g. I had a class with two generic parameters that had the FullName
GapFillVerification.Models.Audits.ThingAudit`2[[GapFillVerification.Models.Record, gapfill-verification-models, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[GapFillVerification.Models.Audits.LockAction, gapfill-verification-models, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]
That's 298 characters on it's own, ignoring any path before it.
Exception trace was:
http://msdn.microsoft.com/en-us/library/Aa365247#maxpath indicates the use of the "\?\" prefix might help, but then XmlTextWriter starts throwing exceptions about "invalid characters"...