asp.net-mvcasp.net-mvc-3visual-studio-extensionsrazorgenerator

The custom tool 'RazorGenerator' failed. The method or operation is not implemented


I have just upgraded the Visual Studio extension RazorGenerator to V1.5 (Last updated 10/14/2012) and now have the following problems.

Each cshtml file edited now removes the generated file, if I choose to 'Run Custom Tool' I get The custom tool 'RazorGenerator' failed. The method or operation is not implemented.

I had it working previously in my project without issue but the upgrade seems to have broken it. Does anyone know how this can be fixed..? I can't even seem to roll back to the previous version now since it's installed via the ExtensionManager.

The latest version of RazorGenerator.MVC in nuget is 1.4 (Friday, April 20, 2012) so perhaps the version mismatch is the issue..?

I have tried restarting VS and my machine without success, I even un-installed the extension and re-installed and that also didn't work.

Exception calling "RunCustomTool" with "0" argument(s): "The custom tool 'RazorGenerator' failed.  The method or operation is not implemented."
At D:\Source\MySolution\MyProject\packages\RazorGenerator.Mvc.1.4.0.0\tools\RazorGenerator.psm1:32 char:32
+         $_.Object.RunCustomTool <<<< ()
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : ComMethodTargetInvocation

Exception calling "GetItem" with "1" argument(s): "The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))"
At D:\Source\MySolution\MyProject\packages\RazorGenerator.Mvc.1.4.0.0\tools\RazorGenerator.psm1:62 char:46
+                     $solutionExplorer.GetItem <<<< ("$SolutionName\$ProjectName$relativePath").UIHierarchyItems.Expanded = $false
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : ComMethodTargetInvocation

In addition to this, I get the following build errors for each view (despite saying build succeeded):

Custom tool error: Could not load file or assembly 'file:///C:\Users\Rob\AppData\Local\assembly\dl3\VQ93NZJ0.M7K\4HA91P75.CHN\4b53b7b1\09b87db8_d4adcd01\RazorGenerator.Core.v1.dll' or one of its dependencies. The system cannot find the file specified.

I downloaded the source, built locally and copied the 'RazorGenerator.Core.v1.dll' into the directory from the error message but it still didn't work. I even copied all of the RazorGenerator*.dll files into that directory but still no luck. Checking the dependencies only shows system assemblies and 'RazorGenerator.Core.dll' which is present in the same directory.

Incidentally, the 'RazorGenerator.Core.dll' was already in the directory above.

Looking in the Visual Studio extensions folder I have a directory for RazorGenerator as follows:

C:\Users\Rob\AppData\Local\Microsoft\VisualStudio\10.0\Extensions\RazorGenerator contributors\Razor Generator\1.5

The following files and assemblies are within this folder:

extension.vsixmanifest
RazorGenerator.Core.dll
RazorGenerator.Core.v1.dll
RazorGenerator.Core.V2.dll
RazorGenerator.dll
RazorGenerator.pdb
RazorGenerator.pkgdef

Any help would be very much appreciated.


Solution

  • I was hoping for a better answer to this but since this solves the problem then I figured I should post it.

    Basically @Bobson was right, creating a copy of the files in the directory solved it. In my case doing a copy/paste of the RazorGenerator.Core.v1.dll assembly from

    C:\Users\Rob\AppData\Local\Microsoft\VisualStudio\10.0\Extensions\RazorGenerator contributors\Razor Generator\1.5

    to

    C:\Users\Rob\AppData\Local\assembly\dl3\VQ93NZJ0.M7K\4HA91P75.CHN\4b53b7b1\09b87db8_d4adcd01

    This gave me 3 files in that directory:

    __AssemblyInfo__.ini
    RazorGenerator.Core.dll
    RazorGenerator.Core.v1.dll
    

    I didn't notice that this had solved the issue at first because it also requires a re-start of visual studio.

    The work item hasn't been picked up yet but ultimately if you have this issue then copying the files over and re-starting should fix it.