This is what I get when I open it, anyone had this issue before? Never happened to me:
Could not find file 'C:\Windows\SysWOW64\WindowsPowerShell\v1.0\typesv3.ps1xml'.
Could not find file 'C:\Windows\SysWOW64\WindowsPowerShell\v1.0\Event.Format.ps1xml'.
Could not find file 'C:\Windows\SysWOW64\WindowsPowerShell\v1.0\Event.Format.ps1xml'.
update: after adding those entries to devenv.config now I get:
There were errors in loading the format data file: C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO 12.0\COMMON7\IDE\EXTENSIONS\AUEN3JAD.VIJ\Modules\NuGet\NuGet.Format.ps1xml, Error in file C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO 12.0\COMMON7\IDE\EXTENSIONS\AUEN3JAD.VIJ\Modules\NuGet\NuGet.Format.ps1xml: '', hexadecimal value 0x13, is an invalid character. Line 311, position 36.
There were errors in loading the format data file: C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO 12.0\COMMON7\IDE\EXTENSIONS\AUEN3JAD.VIJ\Modules\NuGet\NuGet.Format.ps1xml, Error in file C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO 12.0\COMMON7\IDE\EXTENSIONS\AUEN3JAD.VIJ\Modules\NuGet\NuGet.Format.ps1xml: '', hexadecimal value 0x13, is an invalid character. Line 311, position 36.
Try adding these lines to devenv.exe.config file in the runtime section. It may work.
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Management.Automation" publicKeyToken="31bf3856ad364e35" />
<publisherPolicy apply="no" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.PowerShell.Commands.Utility" publicKeyToken="31bf3856ad364e35" />
<publisherPolicy apply="no" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.PowerShell.ConsoleHost" publicKeyToken="31bf3856ad364e35" />
<publisherPolicy apply="no" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.PowerShell.Commands.Management" publicKeyToken="31bf3856ad364e35" />
<publisherPolicy apply="no" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.PowerShell.Security" publicKeyToken="31bf3856ad364e35" />
<publisherPolicy apply="no" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.PowerShell.Commands.Diagnostics" publicKeyToken="31bf3856ad364e35" />
<publisherPolicy apply="no" />
</dependentAssembly>
</assemblyBinding>
</runtime>
To do this, click Start, type Command Prompt or cmd in the Search box, right-click Command Prompt, and then click Run as administrator. If you are prompted for an administrator password or for a confirmation, type the password, or click Allow.
Type Command
C:\windows\system32>sfc /scannow
Adding the lines indicated above worked for VS2013, but then I had the same issue for VS2015, and it didn't work there. What worked there was Ed Vowles' comment here: https://github.com/NuGet/Home/issues/2836:
"I was able to resolve this problem by installing (or reinstalling) PowerShell from here https://www.microsoft.com/en-us/download/details.aspx?id=50395 (choosing this version: Win7AndW2K8R2-KB3134760-x64.msu for my windows 7 machine) and restarting."
Related
I've recently upgraded my solution to .net Framework 4.8 and updated a load of nuget packages and now I'm having problems getting my API project to launch.
I felt this smelled of bad binding redirect, but I've looked at this and they are as follows...
<dependentAssembly>
<assemblyIdentity name="Ninject" publicKeyToken="c7192dc5380945e7" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.3.4.0" newVersion="3.3.4.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Ninject.Web.Common" publicKeyToken="c7192dc5380945e7" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.3.2.0" newVersion="3.3.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Ninject.Web.Common.OwinHost" publicKeyToken="c7192dc5380945e7" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.3.1.0" newVersion="3.3.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Ninject.Web.WebApi" publicKeyToken="c7192dc5380945e7" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.3.1.0" newVersion="3.3.1.0" />
</dependentAssembly>
And here's the packages.config...
<package id="Ninject" version="3.3.4" targetFramework="net48" />
<package id="Ninject.Extensions.NamedScope" version="3.3.0" targetFramework="net48" />
<package id="Ninject.Web.Common" version="3.3.2" targetFramework="net48" />
<package id="Ninject.Web.Common.OwinHost" version="3.3.1" targetFramework="net48" />
<package id="Ninject.Web.Common.WebHost" version="3.3.2" targetFramework="net48" />
<package id="Ninject.Web.WebApi" version="3.3.1" targetFramework="net48" />
<package id="Ninject.Web.WebApi.OwinHost" version="3.3.0" targetFramework="net48" />
There's no specific redirect here for Ninject.Web.WebApi.OwinHost so I'm thinking that may be the issue or maybe one of the other libraries, but they never had redirects before and I've tried...
Get-Package MyApp.Api | Add-Bindings
(excuse the syntax here - it may be wrong as from memory)
...to add relevant bindings that were missing.
This was caused by a versioning issue with Nuget packages (This is why I don't use Ninject by choice anymore...)
I downgraded the WebApi package as follows...
<package id="Ninject.Web.WebApi" version="3.3.0" targetFramework="net48" />
So that it was in line with Ninject.Web.WebApi.OwinHost, cleaned, rebuilt and tried again and it all worked perfectly.
I would suspect that the Ninject.Web.WebApi.OwinHost package hasn't been updated yet and isn't compatible.
The package
<package id="Ninject.Web.WebApi.OwinHost" version="3.3.0" targetFramework="net48" />
was replaced by
<package id="Ninject.Web.WebApi.OwinSelfHost" version="3.3.1" targetFramework="net48" />
https://github.com/ninject/Ninject.Web.WebApi/issues/32#issuecomment-661886853
In my case I also needed to update Microsoft.AspNet.WebApi.Owin to version 5.2.7.
Getting this error "System.MissingMethodException : Method not found: 'Swensen.Unquote.UnquotedExpression Swensen.Unquote.Operators.unquote(Microsoft.FSharp.Quotations.FSharpExpr)" in Visual Studio 2015. Tried it in Visual Studio 2013 and it works.
You'll need to add an assembly redirect to an app.config file associated with your unit test project. Something like this ought to do it:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="FSharp.Core"
publicKeyToken="b03f5f7f11d50a3a"
culture="neutral"/>
<bindingRedirect oldVersion="4.3.1.0"
newVersion="4.4.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
We're having some build issues due to package issues, but one of our devs got a green build by downgrading a package in the project's packages.config:
<package id="Microsoft.Data.Edm" version="5.6.2" targetFramework="net451" />
This was also added to the project's config file:
<dependentAssembly>
<assemblyIdentity name="Microsoft.Data.Edm" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.6.4.0" newVersion="5.6.4.0" />
</dependentAssembly>
If we have amended the version in the packages.config to 5.6.2, but still point to 5.6.4 in our binding redirect, what version of the Microsoft.Data.Edm assembly is the project going to use?
For some reason the unit tests from a test project in VS 2013 (w/Update 3) doesn't show up.
Could not load file or assembly
'file:///C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO 12.0\
COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\TESTWINDOW\
Microsoft.VisualStudio.TestPlatform.ObjectModel.dll'
or one of its dependencies. Unspecified error (Exception
from HRESULT: 0x80004005 (E_FAIL))```
When checking the folder, the file is there.
My Chutzpah tests in another project in the same solution shows up. Couldn't find much info on this error when searching. Anyone had similar issues or know how to resolve this?
In my case , I have noticed in the Test Project's app.config file, that more than one assemblyIdentity where enclosed as part of tag, which should not be.
Improper configuration
<dependentAssembly>
<assemblyIdentity name="WindowsAzureTelemetryEvents" publicKeyToken="31BF3856AD364E35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.4.0.0" newVersion="2.4.0.0" />
<assemblyIdentity name="WindowsAzureEventSource" publicKeyToken="31BF3856AD364E35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.4.0.0" newVersion="2.4.0.0" />
</dependentAssembly>
Proper Configuration
<dependentAssembly>
<assemblyIdentity name="WindowsAzureTelemetryEvents" publicKeyToken="31BF3856AD364E35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.4.0.0" newVersion="2.4.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="WindowsAzureEventSource" publicKeyToken="31BF3856AD364E35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.4.0.0" newVersion="2.4.0.0" />
</dependentAssembly>
After hours of trial and error, I noticed there was a app.config file in the test project for some reason. Removing this worked :)
Related answer: I was trying to be clever and use the XML directive thingey to comment out large sections of app.config that included other comments. Don't use <?... ?> directives in app.config.
You can read web.config transforms documentation here and there, but there are two white-elephants that nobody seems to discuss:
How do you perform a variable substitution in a Condition or XPath transform, and...
Can a Locator be meaningfully nested inside a Transform?
Let me give an example that would benefit from either of those options. Suppose I have this:
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
Suppose I want to completely erase the dependentAssembly node, and its children, that matches the xpath //runtime/assemblyBinding/dependentAssembly[assemblyIdentity#name='System.Web.Mvc']. To do that, I might want something like this:
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity
name="System.Web.Mvc"
xdt:Remove
xdt:Locator="Condition(..[*#name=$name])"
/>
</dependentAssembly>
</assemblyBinding>
</runtime>
Well obviously I made up the syntax #name=$name based on xpath variable concepts, but this example demonstrates why I'd want that feature. Is this supported? How must I adjust my syntax to take advantage of this? I could put in a string literal, but I just want to know if this is possible.
Another way I might try to delete the dependentAssembly node, is with this:
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1" xdt:Transform="Remove">
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" xdt:Locator="Match(name)" />
</dependentAssembly>
</assemblyBinding>
</runtime>
Notice the Transform is on a grand-parent node, and the locator is on leaf node. Is the above legitimate? The idea is to remove only the dependantAssembly node that has an internal Locator Match.
These two approaches aside, how would you go about deleting the targeting dependantAssembly and all its child nodes?
The problem is the namespace attribute on the assemblyBinding tag.
Removing the AspNetHelper reference works for me with this:
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly xdt:Transform="Remove"
xdt:Locator="Condition(./_defaultNamespace:assemblyIdentity/#name='Microsoft.VisualStudio.Enterprise.AspNetHelper')">
</dependentAssembly>
</assemblyBinding>
</runtime>
#Thommy's solution worked for me, and #LifeintheGrid's solution used the actual assemblies I wanted to remove, so I combined the two and simplified to get:
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly xdt:Transform="RemoveAll"
xdt:Locator="Condition(starts-with(./_defaultNamespace:assemblyIdentity/#name,'Microsoft.VisualStudio.QualityTools'))">
</dependentAssembly>
</assemblyBinding>
</runtime>
This code ended up working for me. I moved the transform to the dependentAssembly node.
<runtime>
<assemblyBinding>
<!-- ending /dependentAssembly is required or tranforms fail -->
<dependentAssembly xdt:Transform="Remove" xdt:Locator="Condition(assemblyIdentity/#name='Microsoft.VisualStudio.QualityTools.HostAdapters.ASPNETAdapter')" ></dependentAssembly>
<dependentAssembly xdt:Transform="Remove" xdt:Locator="Condition(assemblyIdentity/#name='Microsoft.VisualStudio.QualityTools.Common')" ></dependentAssembly>
<dependentAssembly xdt:Transform="Remove" xdt:Locator="Condition(assemblyIdentity/#name='Microsoft.VisualStudio.QualityTools.ExecutionCommon')"></dependentAssembly>
<dependentAssembly xdt:Transform="Remove" xdt:Locator="Condition(assemblyIdentity/#name='Microsoft.VisualStudio.QualityTools.Resource')" ></dependentAssembly>
</assemblyBinding>
</runtime>