Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Trying umbraco models builder but having this message:
Failed to build models.
The type initializer for 'File' threw an exception.
at Roslyn.Utilities.FileUtilities.OpenFileStream(String path)
at Microsoft.CodeAnalysis.MetadataReference.CreateFromFile(String path, MetadataReferenceProperties properties, DocumentationProvider documentation)
at Umbraco.ModelsBuilder.ReferencedAssemblies.<>c.<.cctor>b__2_2(String x) in C:\Users\Stéphane\Documents\Development\Umbraco\Zbu\Zbu.ModelsBuilder\Umbraco.ModelsBuilder\ReferencedAssemblies.cs:line 24
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at Umbraco.ModelsBuilder.ReferencedAssemblies.<>c.<.cctor>b__2_1() in C:\Users\Stéphane\Documents\Development\Umbraco\Zbu\Zbu.ModelsBuilder\Umbraco.ModelsBuilder\ReferencedAssemblies.cs:line 23
--- End of stack trace from previous location where exception was thrown ---
at Umbraco.ModelsBuilder.Umbraco.ModelsBuilderBackOfficeController.GenerateModels(String modelsDirectory, String bin) in C:\Users\Stéphane\Documents\Development\Umbraco\Zbu\Zbu.ModelsBuilder\Umbraco.ModelsBuilder\Umbraco\ModelsBuilderBackOfficeController.cs:line 108
at Umbraco.ModelsBuilder.Umbraco.ModelsBuilderBackOfficeController.BuildModels() in C:\Users\Stéphane\Documents\Development\Umbraco\Zbu\Zbu.ModelsBuilder\Umbraco.ModelsBuilder\Umbraco\ModelsBuilderBackOfficeController.cs:line 35
Have you managed to resolve this issue? I experience the same problem,
it works in dev environment, but after deploying to production server I'm not able to generate models. I found this article, but creating new bindingRedirect
Did you adjust the Web.config file to "AppData" or something else? After that you can generate the models in the "Developer" section in the Umbraco backend. Should do the trick... If not, try to rebuild the solution in Visual Studio.
Today I was facing the same issue, using the "AppData" mode for the ModelsBuilder. The binding redirect seems to work, only I had to use a different version.
In my /bin folder is a System.IO.FileSystem.dll with version 22.214.171.124 so in my case the binding redirect turned out like this:
<assemblyIdentity name="System.IO.FileSystem" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="126.96.36.199-188.8.131.52" newVersion="184.108.40.206" />
I actually found the right assembly version by listing all assemblies and filtering on FileSystem:
var items = AppDomain.CurrentDomain.GetAssemblies();
items.Where(a => a.FullName.Contains("FileSystem")).ToList()
This worked for me! Thanks for posting.
can any one help me after upgrading form 7.14 to 7.15.3 ...a get this error when building models :(
tried everything and nothing any ideas ?
The same issue in Umbraco 7.15.3 in live invironment, everything is ok in localhost.
I just removed System.IO.FileSystem.dll from bin folder and everything became fine. Actually I don't know why that happened, I checked the pure umbraco solution and there was the same file in bin folder.
Wondering what went wrond on live environment
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted