Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2015 Update 2 breaks EF reverse code engineer vsix

After installing the latest Visual Studio 2015 Update 2, the EF power tools reverse code engineer option fails with the following error message.

One or more errors occurred while processing template 'Entity.tt'.
error : An exception was thrown while trying to compile the transformation code. The following Exception was thrown:
System.ArgumentException: Empty path name is not legal.
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
   at System.IO.File.OpenRead(String path)
   at Roslyn.Utilities.FileUtilities.OpenFileStream(String path)
   at Microsoft.CodeAnalysis.MetadataReference.CreateFromFile(String path, MetadataReferenceProperties properties, DocumentationProvider documentation)
   at Microsoft.VisualStudio.TextTemplating.CompilerBridge.<>c.<.ctor>b__15_0(String x)
   at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()
   at System.Linq.Enumerable.<UnionIterator>d__66`1.MoveNext()
   at System.Linq.Enumerable.<UnionIterator>d__66`1.MoveNext()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at System.Collections.Immutable.ImmutableArray.CreateRange[T](IEnumerable`1 items)
   at Microsoft.CodeAnalysis.ImmutableArrayExtensions.AsImmutableOrEmpty[T](IEnumerable`1 items)
   at Microsoft.CodeAnalysis.Compilation.ValidateReferences[T](IEnumerable`1 references)
   at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.WithReferences(IEnumerable`1 references)
   at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.CommonWithReferences(IEnumerable`1 newReferences)
   at Microsoft.VisualStudio.TextTemplating.CompilerBridge.PrepareNewCompilation()
   at Microsoft.VisualStudio.TextTemplating.CompilerBridge.Compile()
   at Microsoft.VisualStudio.TextTemplating.TransformationRunner.Compile(String source, String inputFile, IEnumerable`1 references, Boolean debug, SupportedLanguage language, String compilerOptions)

I have tried uninstalling and reinstalling the tool from Julie Lermans link to get the fixed VS 2015 vsix installer version.

Help!

like image 943
richardb Avatar asked Apr 05 '16 08:04

richardb


2 Answers

New one for VS2015: https://onedrive.live.com/?authkey=%21AP6uv8OLvM5qnmU&cid=FFD7F3DFCD5E1160&id=FFD7F3DFCD5E1160%2161967&parId=FFD7F3DFCD5E1160%2161965&action=locate

After the update 2: Right click on the project in Solution Explorer > Properties > Target Framework switch back to 4.5.1 and then rebuild the solution. Run now the reverse engineering tool. On my one worked properly

like image 186
ADC Avatar answered Oct 05 '22 19:10

ADC


I'm not really sure my case match 100% your but the error is the same and the precondition too.

My original "sin" was the file configured for the CodeAnalysis was missing, so first step is "Check in the Project Properties, at the Code analysis tab if you are using an existing file".

Now the first Exception disappeared but a new one has popped out, a really unexpected OutOfMemoryException!

Taking the devenv.exe process under control I noticed it start consuming RAM very quickly (from 250MB to 2GB in less than 1 sec!) at this point, with no scientific reasons :-), I tried creating a new Empty Ruleset and associating it to the Project and it incredibly started working again!!

I hope this can help you.

like image 4
MonDeveloper Avatar answered Oct 05 '22 21:10

MonDeveloper