Last generation failed with the following error:
Closed this issue · 10 comments
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 X:\Projects\Umbraco\ModelsBuilder\Zbu.ModelsBuilder\Umbraco.ModelsBuilder\ReferencedAssemblies.cs:line 24
at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()
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 X:\Projects\Umbraco\ModelsBuilder\Zbu.ModelsBuilder\Umbraco.ModelsBuilder\ReferencedAssemblies.cs:line 23
at System.Lazy`1.CreateValue()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Lazy`1.get_Value()
at Umbraco.ModelsBuilder.Umbraco.ModelsBuilderBackOfficeController.GenerateModels(String modelsDirectory, String bin) in X:\Projects\Umbraco\ModelsBuilder\Zbu.ModelsBuilder\Umbraco.ModelsBuilder\Umbraco\ModelsBuilderBackOfficeController.cs:line 108
at Umbraco.ModelsBuilder.Umbraco.ModelsBuilderBackOfficeController.BuildModels() in X:\Projects\Umbraco\ModelsBuilder\Zbu.ModelsBuilder\Umbraco.ModelsBuilder\Umbraco\ModelsBuilderBackOfficeController.cs:line 35
Who can help me with this problem?
Which version of Umbraco & Models Builder is it?
Usually means that there is an assembly in ~/bin that is referencing another, missing, assembly.
<package id="Umbraco.ModelsBuilder" version="3.0.4" targetFramework="net46" />
<package id="UmbracoCms" version="7.5.3" targetFramework="net46" />
<package id="UmbracoCms.Core" version="7.5.3" targetFramework="net46" />
Any chance you can zip the entire content of your ~/bin directory and email it to me (stephane@umbraco.com)?
Hi,
Not sure now if I can share them, but I've debug with sources and see what dll cause this problems:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\vs\f873d39b\197a47ac\assembly\dl3\a3fbca18\ea768841_e680d101\SEOChecker.MVC.dll
I'm going to contact SeoChecker support.
Thanks,
Mike
No prob. I'm trying to setup a tool (that might later on be embedded with MB) that would analyze the ~/bin directory and explain the problem (instead of leaving you in the dark and forcing you to debug).
Can you give move details about what's wrong with SEOChecker.Mvc.dll?
Would you be ok to test-run this tool in your ~/bin to see if it works? If so I'll upload it here.
I'm ok to test this tool, please upload here.
Tool is in BinScan.zip
You want to drop it in ~/bin and then run "binscan.exe -v" and see whether it reports errors.
Any chance you made progresses on that one?
Assuming it's OK now.
I had this same problem and did not find any of the above solutions to work for me. What did work was removing the reference to System.IO.FileSystem from the project. This would probably not work as well if you are storing media items locally, but my project uses the Azure blob storage provider. What seems to end up happening is that the project uses whatever assembly it can find.