Nuget package manager console Not found error - visual-studio-2013

I'm using Visual Studio 2013 Premium. Out of nowhere the NuGet package manager console stopped working. Now it only displays Not found after the powershell initialization fails.
I tried reinstalling NuGet, restarting, removing the folder with NuGet extension.
Anybody has some idea what could be causing this or at least how to find out why is this happening?
Update:
Found this in ActivityLog.xml
Not found
at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorResults, Boolean enumerate)
at System.Management.Automation.PipelineNode.Execute(Array input, Pipe outputPipe, ArrayList& resultList, ExecutionContext context)
at System.Management.Automation.StatementListNode.ExecuteStatement(ParseTreeNode statement, Array input, Pipe outputPipe, ArrayList& resultList, ExecutionContext context)

The issue just randomly resolved itself. No idea why or how.

Related

Error in Visual Studio... Extension loading issue

I open up VisualStudio 2017 (latest - just updated). I navigate to a type script file (this might just be coincedence that it's this type of file) and I get the following prompt:
---------------------------
Microsoft Visual Studio
---------------------------
An exception has been encountered. This may be caused by an extension.
You can get more information by examining the file
'C:\...\AppData\Roaming\Microsoft\VisualStudio\15.0_c4122470\ActivityLog.xml'
In my activity log, I get quite a few warnings about packages:
Unexpected system error mode before loading package <enter package name here>
The real kicker is at the end of the file I get an error:
System.NullReferenceException: Object reference not set to an instance of an object.
at
Microsoft.WindowsAzure.StreamAnalytics.UI.ViewModel.JavaScriptFunctionViewModel.GetJSFunctionInputsCount()
at
Microsoft.WindowsAzure.StreamAnalytics.UI.ViewModel.JavaScriptFunctionViewModel.Initialize(JSFunctionInfo configInfo)
at
Microsoft.WindowsAzure.StreamAnalytics.UI.ViewModel.JavaScriptFunctionViewModel.InitializeForEditor()
at
Microsoft.WindowsAzure.StreamAnalytics.UI.ViewModel.JavaScriptFunctionViewModel..ctor(String jsFilePath, Action saveJsFile, Action setJsFileDirty)
at
Microsoft.Cosmos.ScopeStudio.VsExtension.EditorMarginExtension.JavascriptEditorMargin..ctor(IWpfTextViewHost textViewHost)
at
Microsoft.Cosmos.ScopeStudio.VsExtension.EditorMarginExtension.JavascriptEditorMarginFactory.CreateMargin(IWpfTextViewHost wpfTextViewHost, IWpfTextViewMargin marginContainer)
at
Microsoft.VisualStudio.Text.Utilities.ContainerMargin.<AddMargins>b__25_1(IWpfTextViewMarginProvider mp)
at
Microsoft.VisualStudio.Text.Utilities.GuardedOperations.InstantiateExtension[TExtension,TMetadata,TExtensionInstance](Object errorSource, Lazy`2 provider, Func`2 getter)
--- End of stack trace from previous location where exception was thrown ---
at
Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)
I have tried:
Clearing the temp folder
Clearing the Model Cache inside the VS folder
Updating packages
Updating extensions
Nothing seems to help. Does anyone have a thought as to what would be causing this?
Error in Visual Studio… Extension loading issue
According to the error info "An exception has been encountered. This may be caused by an extension.", you can try to run the VS with safe mode using the command: devenv /safemode, if it works fine, that means the installed extensions caused this issue. Since I could not know which specified extension causes this issue based on the error log, you can try to remove/uninstall the installed extensions one by one to find the culprit.
Besides, you can also try to run visual studio as administrator and update the Visual Studio 2017 to latest version.
Hope this helps.
It appears the bug or issue is cause by the back ticks in your JS or TS code, which were present in the files I was working in.
` <- back tick
Here is a thread in the VS developer community describing the issue and a potential solution.
NullReferenceException after opening javascript file
Solution For Me:
I had to upgrade to VS version 15.8.1 (For me ,the bug was still in version 15.8.0, which is what I was using when I posted the question). This version just got released.
So far things are working properly.

Imagination PowerVR SDK examples fail to be executed on Visual Studio 2013

I run into Visual Studio and I get an error and ask a question.
I installed POWERVRSDK_2017 and ran OGLESHelloAPI.sln which is a sample file after installation. After the execution, the program was terminated with no response because it was executed after the build without touching the code.
The error occurred in DynamicEgl.h when debugging was executed, and the error content was 'Unhandled exception at 0x760BB3E5 in OGLESHelloAPI.exe: 0xC0000005: Access violation executing location 0x00000000.'
"DynamicEgl.h"
inline EGLDisplay DYNAMICEGL_FUNCTION(GetDisplay)(EGLNativeDisplayType display_id){
typedef EGLDisplay(EGLAPIENTRY * PROC_EGL_GetDisplay)(EGLNativeDisplayType display_id);
static PROC_EGL_GetDisplay _GetDisplay = (PROC_EGL_GetDisplay)::egl::internal::getEglFunction(::egl::internal::EglFuncName::GetDisplay);
return _GetDisplay(display_id);
}
I attached the code. _GetDisplay seems to check for errors, but I do not understand.
How can we solve this problem? Thank for your advise
When I installed powerVR, I clicked Accept Path setting during the installation process and finally it worked normally. I used visual studio 2017.

VS 2013 Error-"No exports were found that match the constraint:"

I am using Visual Studio 2013 on Windows 10, Today I am getting error "No exports were found that match the constraint:"
I did following but still having same issue:
Solution giving in link
Error message "No exports were found that match the constraint contract name"
by removing/renaming "ComponentModelCache" folder, but still problem.
Run VS Repair, but still having same problem.
Finally, I Uninstalled Visual Studio 2013 and reinstalled, but still having
same problem.
Please suggest what do do now?
Finally, I did find answer myself, instead of deleting/renaming 'ComponentModelCache' folder in path
C:\Users\'username'\AppData\local\Microsoft\VisualStudio\12.0
I renamed folder 'Microsoft' in path
C:\Users\'username'\AppData\local\
This works for me.
You can see here more solutions which require deleting the cache in %APPDATA%.
In my case, the problem was that I was initializing and using class with the MEF framework but didn't declare the class as a MEF class.
How to import a MEF class:
[Import(typeof(ICalculator))]
public ICalculator calculator;
How to define and export a MEF class:
public interface ICalculator
{
String Calculate(String input);
}
[Export(typeof(ICalculator))]
class MySimpleCalculator : ICalculator
{
}
The code example is taken from here
Apologies for contributing to an old "answered" thread. however for me, using Win 10, VS 2013. I had to remove the 'ComponentModelCache' folder from each version of VS that I had installed before this issue was resolved.

"Object reference not set to an instance of an object." with NuGet.VisualStudio.IVsPackageInstaller.InstallPackage

The following code is raising NullReferenceException ("Object reference not set to an instance of an object.") on Visual Studio 2015, NuGet.VisualStudio v3.3).
try
{
this.PackageInstaller.InstallPackage(packageSource, project, packageId, version, ignoreDependencies);
}
catch (Exception ex)
{
string error = string.Format(CultureInfo.CurrentCulture, Properties.Resources.RES_Error_InstallingNuGetPackage, packageId, project.Name);
throw new NuGetServiceException(error, ex);
}
The PackageInstaller is an instance of NuGet.VisualStudio.IVsPackageInstaller.
The problem seems to have something to do with the values of version, and may be packageSource.
When this error is raised the values are:
packageSource = "All"
version = null
If I change the value of version to the latest available version of the package ("3.00.00.1041") then the exception is InvalidOperationException ("Unable to find version '3.00.00.1041' of package 'Primavera.Core.Patterns.Models'.").
This does not make any sense because this works perfectly in the Package Manager Console and it installs exactly that version. It seems to be a bug in the NuGet.VisualStudio code base.
Any ideas?
This question has been discussed on GitHub, but the short answer is that you should use a null source instead of "All" because the "All" keyword has no special meaning in the 3.x NuGet Visual Studio extension. Using null is the recommended way of installing a package from the user's configured package sources.
Note that this can be a brittle way of installing packages since the user's configuration is typically unpredictable from the VSIX developer's point of view. A more reliable way of installing a package is by explicitly specifying the package source (and even version) when installing.

TypeScript 1.3 protected error

Recently installed new TS version into VS2013 and tried to use protected modifier.
However TS validator shows me an error (and underlines protected word with a red line.
I get an error like
Use of future reserver word.
; expected
looks like it's looking into old TS definitions.
Checked the project file and there is 1.1 version of TypeScript.
also running tsc -v produces 1.3.0.
Does somebody of you guys experience that?
What i'm missing and what to do to fix that.
Thank you a lot for any help.
export class SomeClass {
protected metadata: Metadata;
protected subItems: SomeClass[];
constructor() {
}
}
thank you all guys. for your answers!
the reason was (oh, what's the shame =) ) the ReSharper.
It's validation was showing that error, suspending it i'm getting no errors now.
Looks like JetBrains guys should update their definitions like Web Essentials did.
As they aren't compatible with new TS version, 1.3. And no updates pending as for now.
Hope, it'll be useful for somebody else.
The answer to your question then is ReSharper 9.0 EAP.
It supports TypeScript 1.3 features: 'protected' modifier and tuples.
You're welcome to try it. Though, yes, it's a pre-release version, so overall stability is not strictly guaranteed.
Are you building from within Visual Studio, or from the command-line? What with different versions of the SDK being installed, as well as potentially the NPM package globally (if you've ever installed that), it can get quite messy as to which version gets picked up. For example, if I run 'where tsc' from the command prompt, I get the below hits (and this is without the 1.1 SDK on the path, though I am in the bin folder for testing the latest bits)
S:\src\TypeScript\bin>where tsc
S:\src\TypeScript\bin\tsc
S:\src\TypeScript\bin\tsc.js
C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\tsc.exe
C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\tsc.js
C:\Users\billti\AppData\Roaming\npm\tsc
C:\Users\billti\AppData\Roaming\npm\tsc.cmd
Can you verify via "where tsc" the locations and order you PATH is resolving the 'tsc' command?
That said, if you're building from within a VS project, it should locate the latest SDK via the build target. Does this also occur with a new TypeScript project (where the latest version and targets file should be referenced)?
Failing that, and I hate to say it... ready... did you try rebooting? :-) Sometimes updates to the PATH etc.. after an install don't get picked up until processes restart, and things like MSBuild can actually linger waiting for the next build as a perf optimization, rather than exit once the build is done (and thus may not pick up environment changes immediately).
It didn't work for me too. What I did to fix it was installing VS2013 Update 4 and after that, I executed the TypeScript 1.3 setup again and did a repair.
Also, you should make sure you don't have <TypeScriptToolsVersion>1.0</TypeScriptToolsVersion> in your csproject defined. Set it to 1.1 (not 1.3) or remove it entirely (then it will use the latest one). Hope that helps!
You can determine whether the issue is related to Visual Studio pointing at the wrong TypeScript version by following these steps.
Place this example code in C:\Temp\app.ts
interface Metadata {
something: string;
}
export class SomeClass {
protected metadata: Metadata;
protected subItems: SomeClass[];
constructor() {
}
}
export class OtherClass extends SomeClass {
constructor() {
super();
this.metadata = null;
}
}
var x = new SomeClass();
// Not allowed
// x.metadata = null;
Run the command:
C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.1>tsc --module amd c:\Temp\app.ts
Taking care to ensure you are pointing at the 1.1 folder in the TypeScript SDK folder.
The output should be:
C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.1>
i.e. nothing, except you now have an app.js file.
You can also re-run the test after uncommenting the x.metadata = null; line - at which point you should get the error:
c:/Temp/app.ts(22,1): error TS2445: Property 'metadata' is protected and only accessible within class 'SomeClass' and its subclasses.
Next Steps...
If the above fails, please supply details of the problem.
The only real answer we could give though it remove it and check the 1.1 folder is gone before re-installing it by fetching the installer fresh from the Microsoft website (perhaps you have a bad installer or there was some problem during installation?) You may also want to check that you are on Visual Studio Update 4, as I am testing it on Update 4.
If the above worked as expected, your Visual Studio is not pointing at the correct version.
This could be because of the project file as Dick van den Brink has correctly mentioned. Check that you have <TypeScriptToolsVersion>1.1</TypeScriptToolsVersion> and that it is the only element with this name.
It can also be down to any Visual Studio extensions that may be messing with your TypeScript (for example, if you had a really old version of Web Essentials - in which case, update it - if it is some other extension, try disabling it).

Resources