I recently upgraded my visual studio from 2012 to 2015 every thing was working perfectly fine on VS 2012 but i am getting
"An unhandled exception of type 'System.StackOverflowException' occurred in WebGrease.dll" when i run my application/code
below is details about version
package id="WebGrease" version="1.1.0" targetFramework="net40"
Update: the fix i found
There seems to be compatibility issue of webgrease(1.1.0) with vs2015 updrading it to WebGrease 1.6.0 solved the problem
I recently ran into this, but for a very specific use case. I am using Syncfusion products in a project for a client.
My dev machine has(had) Visual Studio 2013 Ultimate and Visual Studio 2015 Enterprise installed, side by side. My WebGrease package was fully updated to 1.6.0.
When I updated to the latest version of Syncfusion, I started receiving the WebGrease StackOverflowException shown above, but only when I was in VS 2015. 2013 did not give me the same error.
I also did not get the error unless I added a specific Syncfusion JS file to my bundles. Everything ran as expected until I added that one bundle.
I even went through the trouble of removing the built-in bundling support of the project, by removing Antlr, WebGrease, System.Web.Optimization, etc. Doing that fixed my error, but it was not the solution I was looking for.
After some back & forth with Syncfusion support, they stated that they were able run the project on their machines that were using Visual Studio 2015. They stated that the problem must be on my machine.
I keep a very clean dev machine, only installing software that I absolutely need and nothing else. I was certain that the problem wasn't on my end and was in denial about the whole thing.
I tried to repair Visual Studio 2015 as well as uninstall/reinstall Visual Studio 2015. Neither worked.
Yesterday, I bit the bullet and wiped my machine and reinstalled everything. Now the project runs without error.
It's not the fix anyone wants to hear, but it is what ultimately solved my problem.
Cliff's Notes: I had the same problem. The fix ended up being wiping my machine and starting from scratch.
Related
Essentially I was upgrading VS studio last night and had a power cut, any time I open VS studio I get "Assembly CSharp(failed to load)", I've tried everything in this thread
Missing vc_runtimeminimum_x86.msi and installation won't work
I'm just a bit lost with what my solutions are as I need to use vs quite soon.
See image below for error i get whilst installing
https://imgur.com/a/BgRU949
I have error in my project on time of build csc.exe exited with code -2146232797 visual studio 2017(Professional) in other Team's computer project building and running fine, so I not want to update nuget compiler,
Is there any permanent solutions there?
This issue happened for some people with vs 2017. you need to reinstall .net via
microsoft site
as requested and if the above link does not help, there is a thread in visual studio development community stating they fixed the issue in visual studio 2017 v15.5:
We have fixed this issue and it's available in Visual Studio 2017
version 15.5. Thank you for helping us build a better Visual Studio!
more over, there is another solution stating:
using the 2.2 compiler made the problem go away.
Multiple times I got this issue in VS 2019. I closed other VS projects and then build successfully.
I'm having an issue with the mentioned error in several .net core applications. I'm using vs code version 1.18.0 but the error started to appear already in the previous version.
The error appears in every .cs file for every datatype like string, int, void etc. and also for class imports.
All the projects still compile and run properly. Also on another workstation I'm not having the issue in the same projects, so it seems to be a local omnisharp/ vs code or windows? problem.
Has anyone had something like this and managed to fix it or any suggestions on what i could try?
I've reinstalled vs code and omnisharp already, but I'm still having the problem.
example Error:
Predefined type 'System.Object' is not defined or imported [GG]
I found a fix ( or workaround) for my problem:
short version: I changed the omnisharp msbuild instance by uninstalling Visual Studio 2017 Pro.
long version: A few months ago I installed VS 2017 Pro to check out the features, used it for 2 weeks in trial mode and forgot about it for several months.
Around one week ago I opened it (by accident :D) and got a notification, that my trial period expired, also VS locked itself.
It didn't bother me , because I wasn't using it. In #VahidN 's Link I found out that omnisharp is using "the most native" msbuild instance that is installed, which in my case was the one of the locked VS 2017 Pro. 1+1 I unsinstalled VS and I'm good.
I'll reinstall VS 2017 ( Comunity) and post a comment if it still works fine.
EDIT:: I reinstalled VS 2017, everything works fine, so the actual solution is updating VS 2017, which i couldnt do besause it was locked prieviously.
Thanks for sharing your fix. Unfortunately, that didn't work for me. What worked for me is to reinstall the latest OmniSharp.
Copy-pasted from this ticket:
The fix for this has been pushed into OmniSharp. You should be able to get the fix by setting the "omnisharp.path" option in VS Code to "latest". That will cause C# for VS Code to download the latest build OmniSharp at start up.
I've Visual Studio 2017 community edition. I have a C# project created using Visual Studio 2015. When I try to open the project in VS 2017 I get an error message prompt:
--------------------- Microsoft Visual Studio
Project 'dataStructureInCSharp' could not be opened because the Visual C# 2017 compiler could not be created.
Please re-install Visual Studio.
--------------------------- OK
I'm trying to obtain help if anyone else has faced similar issue. I feel going the uninstall and then reinstall route is very costly for me and would try that option last if I've got no other resort.
What I've done so far :
Tried starting visual studio with administrative privileges
But problem remained same.
I tried creating a new console project solution from scratch but in that case I get very same error and an additional error error also shown below:
System Environment: Windows 7 Ultimate Service Pack 1
You can try to close all VS 2017 instances and delete the folder %localappdata%\Microsoft\VisualStudio\15.0_xxxx\ComponentModelCache, then open VS to create a new Console project.
Or
please re-run the VS 2017 installer as administrator, click the icon beside ‘Launch’ button and choose ‘Repair’ to repair as shown below:
Just to brief the history of my problem, I had first installed Visual Studio(VS) 2017 community when it was in RC stage. This was first time when I saw the workload based UI of visual studio installation. Initially I simply chose .Net desktop development workload to get started as I was interested in creating only console applications to get my hands dirty.
Initially it was all working well. One fine day I added all other workloads I was interested in namely Universal Windows Platform Development, Azure Development, ASP.NET and web development,Node.js development, and Mobile development with .Net. I'm not sure if there any of the specific workloads to be blamed for the issue I've posted.
Just to avoid the case if RC and RTM release builds might not have messed up my entire environment, I simply uninstalled the entire stuff, rebooted my machine and installed it again from scratch from latest RTM release for Visual Studio Community.
I would strongly recommend that you first try possible solutions suggested by #Sara-MSFT before doing clean reinstall just in case if it works. It can save you couple of hours required in whole reinstallation process if it works.
Am doing a back end project in C# in Visual Studio. My team mate had done it using Visual Studio 2012 express and everything seems to work there. But when i used git to clone it to my system where am using Visual Studio 2013 express, one part of the project says its incompatible with the current version of VS. I could clean and build the project, but was unable to run the project. I searched and found that one solution is to go to Programs and features, select VS, right click,select repair. But even after doing this, the problem persists. Is there any work around?
When I was learning ASP.NET MVC by Informit tutorials I was in the very similar situation. I downloaded the sample sources that was created in VS2013 but had VS2015 installed. It was some kind of bug \ magic, but VS didn't recognized some libraries in VS2015 even they were installed. What is more strange is the fact that when I decided to totally rewrite the project line by line it worked!
Of course, I tried to clean, rebuild, reinstall NuGet packages.
So, if you have an access to sources *.cs, then just try to create new project and copy-paste code.