VS 2017 immediate window shows "Internal error in the C# compiler" - c#

I use Visual Studio 2017 (15.6.6). When debugging, I try to evaluate simple expressions like int a = 2; in the immediate window. An error
Internal error in the C# compiler
is thrown.
I tried to enable Use Managed Compatibility Mode as hinted at in this question but it didn't help.
Thanks for any help.

Searching further I found this issue on GitHub where an answer recommends to also check Use the legacy C# and VB expression evaluators. Visual Studio gives me a warning about checking this option, but turning this on I can evaluate expressions in the immediate window again.
It is even possible to turn off the Use Managed Compatibility Mode again.
Update: Notice though that using the legacy expression evaluators prevents me from inspecting local variables at debug time, so I wouldn't call it a solution.

In my case, the problem was occurring in a particular assembly. When we looked at the assembly information, (from the Solution Explorer, right click on project, select Properties, then click on Assemble Information), it was all blank.
So we gave it a Guid, then re-built and it worked.

I had the same issue. Don't know if it's your option but for me it was the next issue: instead of "Debug" version the "Release" was turned on. So as soon as I switched back to debug I got rid of this error.

I've got the same error when deal with own NuGet package.
In my case VS resolve a path to the copy of my assembly in "%userprofile%.nuget" folder instead of build output folder.
Currently, I don't known how to prevent this miss-resolving for new project types, where no hint is specified for references, but there's simple workaround: just remove unpacked copy of package from %userprofile%\.nuget\packages\%yourpackage% before debug.

It is happening in Visual Studio 2022 17.3.2 too and it can be found "Closed, not enough info" on feedback hub. As always, incompetent outsourced india strikes again.
Anyway stopping debugging and rebuilding solution works. It have something to do with completely f****d and useless Hot Reload.

Clearing the directory C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files solved the issue for me. I'll try to build a repo if the issue appears again...

Related

Visual Studio 2015 RTM - Debugging not working

I have installed VS 2015 RTM (nothing else) and I'm unable to debug any solution, not matter if it's an existing one or a brand new one (created with VS 2015 and compiled against .Net Framework 4.6), it only opens a new tab in VS which is called Break Mode with the following text:
The application is in break mode
Your app has entered a break state, but no code is executing that is supported by the selected debug engine (for e.g. only native runtime code is executing).
And if I check the Debug --> Module Window:
VS2015Test.vshost.exe no symbols loaded (even if I click load symbol it does not work)
VS2015Test.exe symbols loaded
And it also doesn't show the output on the console(it's a console application that just has the following lines of code:
class Program
{
static void Main(string[] args)
{
Console.WriteLine("TEST");
Console.ReadKey();
}
}
I tried to reinstall VS 2015, restarted the computer, deleted all files in %temp%/AppData/Microsoft/Visual Studio/14, started VS in Admin Mode but nothing seems to work.
One thing which makes debugging working is this option:
Tools --> Options --> Debugging --> Use Managed Compability Mode
^^But that can't be the solution to use an old/legacy mode.
BTW: Debugging in VS 2013 is working fine.
Any help would be appreciated.
In my case this solution is useful:
Solution: Disable the "Just My Code" option in the Debugging/General settings.
Reference: c-sharpcorner
I was having this same problem with VS2015. I reset the settings, as suggested but still had trouble.
What I had to do to fix it was check "Use Managed Compatibility Mode" and "Use Native Compatibility Mode". Not sure which of those 2 is necessary but checking both and I no longer get the Break Mode issue.
I had a very similar issue recently, related to debugging settings.
Firstly have you tried resetting all your settings? I think it may be related to that as you say it is project independent and you've deleted all application data.
Tools-> Import and Export Settings Wizard -> Reset all settings
Don't worry, it gives you the option to save current settings.
Secondly if this fails, I would suggest looking at the event log.
Entering break mode would suggest that the DE (debug engine) is sending a synchronised stop event to visual studio like IDebugExceptionEvent2. I would take a look at the event log for exceptions like failures in loading referenced assemblies (like .NET runtimes, etc) or environment access restrictions.
Something is telling the debugger to stop your running application, its just a case of finding it.
Thought I would post this in case it helps anyone. I installed a clean Win 10 and Visual Studio 2015, tried to debug an existing solution and had problems. Followed some advice listed here and other places but none worked.
How I got the debugging to work as normal was to change the Solution Configuration just below the menus. I had it set previously to Release mode, changed this to Debug and then cleaned/recompiled and hey presto, debugging started working as normal. See the image for info:
My solution suddenly stopped to work in debug.
I received a message during debug.
[Window Title]
Microsoft Visual Studio
[Main Instruction]
You are debugging a Release build of NettoProWin.exe. Using Just My Code with Release builds using compiler optimizations results in a degraded debugging experience (e.g. breakpoints will not be hit).
[Stop Debugging] [Disable Just My Code and Continue] [Continue Debugging] [Continue Debugging (Don't Ask Again)]
I chose to continue to debug, but it still did not work.
The solution was simple. It is necessary in the project properties -> in the build section -> remote the check "Optimiz code"
Check the "Code Type" before attaching to a Process. For example, I had to switch from CoreCLR to v4.*
In my case,
I have changed Platform from x86 to x64 in Debug Configuration Manager. It worked for me.
I disabled avast file system shield and then all worked normal again.
avast-setting wheel= active protections- top button off.
Same is required to publish projects. A real nightmare
I had a problem similar to this when trying to use Debugger.Launch to debug a web application: the JIT Debugger Selection window never appeared. I knew it wasn't a problem with VS debugging mechanism itself because it fired just fine with a console app.
Eventually a colleague mentioned a "global debugger registry setting" which set off a light bulb.
I was using Microsoft's DebugDiag some months ago to troubleshoot IIS crashing, and I had a rule registered to capture IIS crash dumps, which obviously (in retrospect) registered the Debug Diagnostic Service as the debugger for w3wp (IIS worker process).
Removing the rule in DebugDiag, or stopping the Debug Diagnostic Service ("C:\Program Files\DebugDiag\DbgSvc.exe") re-enabled Visual Studio's JIT debugging.
Hope this helps someone.
Uhg. I hit the bottom of this page so I started ripping apart my project. I found a solution for my particular problem.
My Issue: I couldn't hit the break-point inside a threaded process. Nothing fancy, I'm just starting a new thread in a console app and the debugger wasn't stopping on the break points. I noticed the thread was being created but it was getting hung up in .Net Framework external calls and specifically the ThreadStart_Context. That explains why my breakpoints never got hit because the .Net Framework is getting hung up something.
The Problem: I found that I could solve this by changing my startup code. For whatever reason, I had a program.cs file that contained Main() and was inside the Program class as you would expect for a console app. Inside Main(), I was instantiating another class via this code;
new SecondClass();
This normally works fine and I have a bunch of other projects with Threaded calls where it works fine (well, I haven't debugged them for some time so perhaps a service pack came along and is causing this regression).
The Solution: Move Main() into my SecondClass and instead of invoking the SecondClass constructor via 'new SecondClass()', update the SecondClass constructor to be a standard static method and then call it from Main. After making those changes, I am able to debug the thread once again.
Hope this helps.
After installtion of vs 2017,while debugging the solution,there was an error like "Webkit has stopped functioning correctly; Visual Studio will not be able to debug your app any further.",this makes unable to proceed the debugging.To resolve this issue,Go to Tools->Options->Debugging->General then disable the javascript debugging for asp.net
I have had similar issues on my svc application run on visual studio 2015, the solution was to change solution platform from "Any CPU" to "x86", if you cannot see the x86 option then click on "Configuration Manager" and go to your target project and change the platform, you'll need to select the dropdown and click "New", on the pop up, click the drop down list under "new platform" and select x86, save your changes and rebuild(See attached)
Stop debugging.
Edit csproj.user file
Find section wrote below:
<SilverlightDebugging>True</SilverlightDebugging>
Change Value to "False"
Unload and reload your project in Visual Studio.
Sometimes it needed to close Visual Studio.
A friend had the same problem, he couln't debug in VS2015 but it was ok in VS2013. (our project is in .Net v4.0)
We have found that it was the "Code Type" option in Debug / Attach to Process that was set to "Managed (v3.5, v3.0, v2.0)" instead of "Managed (v4.5, v4.0)"
I had this issue, and none of the (myriad of) posts on here helped. Most people point towards settings, or options, turning on Debug mode, etc. All of this I had in place already (I knew it wasn't that as this was working fine yesterday).
For me it turned out to be a referencing issue, a combination of DLLs that were included were to blame. I can't say exactly what the issue was, but I have a couple of classes that extended base classes from another project, an implemented interface that itself extends from another interface, etc.
The acid test was to create a new class (in my case, a Unit Test) within the same project as the one failing to Debug, then create an empty method and set a breakpoint on it. This worked, which further validated the fact my settings/options/etc were good. I then copied in the body of the method that failed to Debug, and sure enough the new method starts failing too.
In the end I removed all references, and commented out all the lines in my method. Adding them back in one by one, checking Debug at each step, until I found the culprit. I obviously had a rogue reference in there somewhere...
We had this issue, after trying all other options such as deleting .vs folder, Renaming IISExpress folder name, Updating various setting on properties etc it did not work. What worked though, was uninstalling IISExpress 10.0, and Reinstalling it along with turning all IIS related features on from Windows Features. Hope this helps someone.
I changed my Platform Target from "Any CPU" to "x64".
Setting available at : Project Properties -> Build -> General: "Platform Target"
I use VS 2015.
I found I had to go to the project settings -> web, and tick the Enable Edit and Continue checkbox. I cannot say why it was unchecked to begin with, but this solved it for me.
from Solution Explorer -> Web -> Properties
select Build tab -> Configuration combobox:
Just change your Configuration from "Release" to "Active (Debug)"
In my case it was due to the project Target platforms were different.
Consider : ProjectA (Entry) --> ProjectB
ProjectA's platform in properties was set to x64.
And ProjectB's platform was 'AnyCPU'.
So after setting ProjectB's target platform to x64 this issue got fixed.
Note: It's just that Target Platform has to be in sync be it x64 or
'Any CPU'
In my case, I found a hint in the output window that the exception that stopped the debugger was a ContextSwitchDeadlock Exception, which is checked by default in the Exception Settings. This Exception typically occurs after 60 seconds in Console applications. I just unchecked the exception and everything worked fine.
I had this same issue. In my case, the dll I was trying to debug was installed in the GAC. If your debugging breakpoint hits when you aren't referencing any object in the target assembly, but doesn't when you reference the assembly, this may be the case for you.
I had this problem after deinstallation of RemObjects Elements 8.3 Trial version. Reinstall Elements 8.3 is a quick bugfix.
I got in this issue as well. I'm using VS 2015 (Update 3) on Windows 10 and I was trying to debug a Windows Forms Application. None of the suggestion worked for me. In my case I had to disable IntelliTrace:
Tools > Options > IntelliTrace
I dont know the reason why, but it worked. I found out the root of the problem when I opened the Resource Monitor (from Windows Task Manager) and I realized that IntelliTrace process was reading a tons of data. I suspect this was causing locks in vshost process, because this one was consuming 100% of a cpu core.
I hade the same problem. After trying the other solutions here without luck, I had to repair the installation through the installer.
Control Panel > Programs > Programs and Features
Then scroll down to Microsoft Visual Studio, right click it, then "Change". Then at the bottom of the window, click Repair. The repair process will take a decent amount of time, and at the end you will have to restart your computer.
This fixed the problem to me, and I hopes it will help you.

Visual studio cannot start debugging because the debug target is missing [duplicate]

When I try to build my solution, I get the following error:
Visual Studio cannot start debugging because the debug target 'c:\target' is missing. Please >build the project and retry, or set the OutputPath and AssemblyName properties appropriately >to point at the correct location for the target assembly.
My output path is set correctly to bin\Debug, but the exe is never created in that folder. Instead, all I get are the exe.config, vshost.exe, and vshost.exe.config files.
Any idea what's going on?
Make sure that output path of project is correct (Project > Properties > Build > Output path)
Go in menu to Build > Configuration Manager, and check if your main/entry project has checked Build. If not, check it.
Go to properties > Application , and select the output type of your project
I've had the same problem;
Here are solutions that didn't work for me:
Building/rebuilding entire solution
Making sure the output path was correct (MyProject > Properties > Build > Output > Output path)
Here's the solution that did work for me:
Rebuilding just the project
You could open the project file with a text editor and replace 'c:\target' by 'bin\Debug'
EDIT
There are other more helpful answers but I can't delete mine since it's the accepted one.
#CZFox Answer
#Yehuda Shapira Answer
steps for changing target path is
Go to Properties
Then go to Debug
Browse the Start external program and select the bin/Debug/.exe file
I have solve this type of problem follow this step
1.VS2010 right click on the solution explorer and select the Build.
Again press Ctrl+F5 or F5
You can try the following steps to resolve the problem.
Step 1:
Right click on the solution and select the property
Step 2:
In Configureation property select the Build option button
I just stumbled across this problem, but I'm using Visual Web Developer Express 2010 and couldn't find any wrong path either within IDE or in the project file. Rebuilding or deleting build folders didn't help.
But after examining the projects .user file, which I've never done before, I discovered that the bad path was in there. Very simple if one knows where to look.
I had the same problem and the real solution was embarrassingly easy:
If, in your project, Visual Studio has never successfully compiled the program (before finding the first bug), you will get this error. What I did was remove all offending code (in my case, leaving just a simple button1_Click with no code). Run/Compile the code one time; exit the running program, and this message goes away.
The Compiler builds various directories and files on a first successful compile and these are used by the debugger. I am now recommending with all new projects, define the form, compile, close, and then begin coding.
I've found that this can happen if all the files are deleted from the bin folder. ReBuild the app to force a full build: right click on the project in solution explorer and select ReBuild.
Please follow the below steps to overcome this problem:
If you are working with VS2010, change platform target to x64
Select .net framework as 3.5
If you are using any custom code for Sharepoint and like to debug or deploy the use the above....and my bad sake i dont abt the .net applications
I had this error too (in VS2010), and in my case (two projects in one solution, with one being for unit tests) the answer was to go into the solution's (not the project's) properties and set a single startup project. I would've thought it also necessary, in that project's settings, under Application, to specify the "Startup Object", but it's working for me with or without that.
Although this has already been answered, I found that my own solution was none of the above. Admittedly a rookie mistake, within my solution I had multiple projects, and thus when trying to run solution, the wrong project was set as the Startup Project.
So in my own case, not to say others, the solution was to right click the project and select Set as Startup Project
I tried everything mentioned in this thread but none worked.
Then, i tried the simplest thing and it worked.
Close visual studio and open it back up again.
This was a really annoying error!
I kept trying to start a debug instance but it just wouldn't make an exe! Though there were errors in my ConnectionString (while trying to make an SQL connection). There were two backslashes that were supposed to be a part of a path and the tutorial I was following told me to ignore it.
Well, turns out that was the error. A backslash marks the beginning of some escaping that you want to do, and the way to have a backslash displayed is \\ instead of \.
Got rid of that, and it worked for me.
EDIT: It would seem that you have to get rid of the tiny errors that you have made while writing your code to let it compile properly.
I have solved this problem by changing the Platform Target to "any CPU".
If the above explanation does not help you, then you could have error in the program. I have the same issue and I solved it as I cut the functions used in the same class and one of the functions were the cause of it.
I had a very very similar problem, but almost non of the solutions worked for me, finally when i reset the VS setting, it fixed...
To reset settings:
Tools Menu >
Import and Export Settings >
Select Reset all settings radio >
Next >
Next (You can backup your current settings in this step) >
Finish
Problem:
The problem was I had bad nuget source configuration, so the solution could not start properly despite the fact it was build correctly because it still saw old dll references.
Solution:
It was not enough to change nugget source url, I just had to remove entire nugget source and add it again with proper url.
Clean solution and rebuild it.
There are many issues that can lead to this problem, after losing 2 days to this issue I think I have the root cause of this issue and also the problem of the Form Designer throwing an error when switching to the Design view (also seems to effect the DataSet Designer):
A language syntax error that Intellisense doesn't catch.
Once I went through my code with a fine tooth comb I found a couple of really boneheaded mistakes that I kept overlooking, once those were resolved the solution compiled just fine and the output was in the correct place.
Here is the solution for this problem, no need to change anything for this problem.
You all know C# is case sensitive language and we have to write all methods and statements in correct case.
We all are just missing this thing and we just have to change method 'main() --> Main()'
This thing solved my problem please let me know if you still find any :-)

Visual Studio "Rebuild all failed"

Why does Rebuild fail with no errors?
Since this morning, this error keeps showing up. I build the entire solution (25 C# managed projects) and a "Rebuild All failed" appears, but without any errors! (I have 13 warnings about COM not supporting Generics, but it's "normal" because one dll is exposed as COM.)
Not an answer per se - but you're better off looking at the output window and seeing what it says there.
Also, to help with that you might want to look at your MSBuild verbosity - as shown on this screenshot (last two options):
Beware - the highest level generates a MASSIVE amount of information.
Finally - running msbuild from the solution folder in a command prompt will really nail the issue - because error messages and warnings come up in red and yellow respectively.
I found my own solution and it is simple:
When this error occurs, save the project and close VS 2013. After that, re-open VS2013 and open the last project.
It works like a charm. But it is very annoying every time!
Many people reported this problem in VS2010, VS2012 and VS2013.
Could be a corrupt Solution User Options file.
Close the solution, delete its .suo (.v12.suo for VS2012+), reopen the solution, and Visual Studio will build a new one. You will lose the StartUp Project, breakpoints, bookmarks, which files are open, which projects/folders are expanded, etc. But that's all minor compared to the solution not building!
I had the same problem. I was trying to refrence a higher .net framework version(4.5.2) to lower .net framework version(4.5) which was causing build error. I made the version same in both projects and it worked.
Check the Output Window (View -> Output) as that will tell you what's going wrong. Sometimes a reference might be missing or there is an issue with the targeted version of .NET for one project in a solution.
Have you tried to clean the solution befor rebiuld it?
This is the list of checks & things I would do if I were you (try to build after each step):
Is error list activated? (Sometimes I forgot to activate and I can see only warnings & messages)
Check output window for error messages..
Clean solution.
Double check after clean that everything is deleted from debug folders.
Build it in release mode.
Build solution project to project until you isolate problematic project.
Remove COM and comment code to see if is this the source of problem.
Restart VS2010.
Restart windows.
Few moments ago I fix it with repair of .NET Framework installation (.NET Framework v4.0 Extended in my case).
I had the same issue in VS 2015. I tried the following with no success:
Close VS project and reopen
Close all open VS projects and reopen just the project that had the issue
Clean solution
Rebuild solution
Delete all files in bin\debug and bin\release
Lastly I tried Keith Robertson's answer, delete .suo (\Visual Studio 2015\Projects\[ProjectName]\.vs\[ProjectName]\v14\.suo). Although this didn't get me a good build, it did finally give me an error message stating that I had two entry points to my application. I went to application properties (Alt + Enter) and select a Startup object from the drop down.
This error seems a bit generic to me. I also went through this situation, but I managed to solve it differently than any of the ones mentioned here.
I have a project and several dependencies. And one of these dependencies has undergone a change.
When compiling the main project in debug mode, I verified that everything was ok.
However, switching to release mode and recompiling the problem occurred.Rebuild all failed and 0 Errors
By analyzing the debug output, I encountered an error:
Although the build dependencies are configured correctly. When compiling in release mode, the main project did not find the new method created in the secondary project.
So I had to recompile each secondary project one by one in release mode. After that, I recompiled the main project and everything worked.
Hope it helps someone!
I just had the same thing. For me, it helped to restart VS and run it as Administrator.
Select the appropriate target framework
- Right click on project
- Properties
- In application tab, Select the target framework
clean the solution
Try and build each project and see where the issue is.
Check each of the references (of each project) to make sure not have the yellow warning sign
Has the solution ever built?
I just had this happen to me, and realized that I left a '#error' line in my code and forgot about it. When I tried to build, the build failed but the #error line didn't show up in my errors.
Try searching all for '#error'
I fixed it on my new implementation of Visual Studio 2013 by going to the database project / Project Settings and noticing that the Target Platform was SQL Server 2014 instead of 2012 like it should be.
Once chance of getting this error is when we try re naming the service reference name, we give some other name in the service reference, but in the namespace some where it will be referring the old name, so if you delete and add a service reference then keep the same name, else we may face this error, but we can see the error in the Output window.
There are apparently many causes of this. I just found the cause of my issue: the .NET version of a new project I created was higher than the version of the top-level project. (4.5.2 vs 4.0)
I got a similar issue today, and fixed it with repair.
Start
Run…
Appwiz.cpl
(Find your installed Visual Studio version)
Right click
Change
Repair
In my case it was the wrong date and time of computer.
I was getting no feedback/messages/errors. Just that all projects failed to build.
I closed and tried again--I noticed an error saying "you are not authorized to access..."
I clicked on my account, re-entered my credentials, and rebuilt the solution.
Voila! I got what I am used to seeing when I build a solution -- plenty of errors in all their glory.
Hope this helps someone.
Here's yet another reason which may sound familiar to some. I had integrated some code into my solution that wrapped a DLL. The C# code file that came with it offered a nice managed API and handled the low-level LoadLibrary stuff to access the DLL. Both had the same base name, so I had SomeName.cs and SomeName.dll. I could just drop it into any project and it would work.
This wasn't so nice after a while as I started using it in different projects. I got copies of both the DLL and the wrapper code in multiple projects. So I figured it would be better to drop the wrapper code and the DLL into a new class library project and then reference that new project from other projects.
After I had done that, I started to get this issue. The build went well up until the very last stage and then failed without error. Output showed nothing but successes.
The problem was the name of the wrapping class library project. I used the same base name (SomeName) for this. By default the assembly name would be SomeName.dll and I already had one such file (the DLL to be wrapped), thus I had a conflict with output files.
After renaming the wrapping project and its output assembly to SomeNameWrapper, the problem went away.
This may not be your exact cause but it seems likely you have some name clash or deployment issue as well. And it is not surprising the compiler won't give you an error because there is no problem in the compilation phase, the trouble starts with deployment and apparently this does not come out in an obvious way.
I had the same problem the original poster was displaying with 0 errors and Rebuild all succeeded. The Output tab showed a message that a referenced dll was built with a higher version of the .NET Framework.
Changing the .NET framework to match resolved the issue I was having with 0 Errors and Rebuild All succeeded.
The solution:
Because Prerequisites not set for debug set only for release
01-Change solution configuration ( in main screen )
set (debug to release)
set solution platform to (Any CPU)
02-Set Prerequisites for debug ( If you want to continue in debug mode )
03-set target platform version for all Projects
Some of the files included in your solution are not in the correct directories, or you have changed the name of one or more directories in your application. In the solution explorer under Setup review the list of all files and remove those that are not properly listed in the SourcePath Property.
One of my dependency in View file caused this. Check your view files for any dependencies which is not injected yet.

Resharper: Cannot resolve symbol 'Eval' in VS2010 SP1

I just installed SP1 for VS2010, and since then I get error messages from Resharper for stuff that used to work and be ok for Resharper (5.1) before.
The error messages are "Cannot resolve symbol 'Eval'" and some other methods other than Eval.
How do I solve this?
Is there a fix?
Is there some resharper cache that I must delete/clear?
(The code compiles and runs as usual)
I would try deleting the _ReSharper.{SolutionName} directory completely if clear cache fails.
You might want to close VS2010 before you do that.
EDIT: Try this only if #Andrew Finnell solution doesn't work.
Try:
Resharper Menu -> Options -> General -> Clear Cache button
I had this problem in spades in my multi-project VS solution. Tried Julien + Andrew's solutions and they did not resolve the issue. But everything compiled just fine and worked as normal -- it was simply the "Errors in Solution" that kept showing the errors (which also showed up when you looked at the code in the right-hand-ReSharper-margin).
It turns out I had inadvertently deleted the web.config file in one of the solution's web projects during some version control operations. Who knew that thing was important?
I restored the web.config file, cleared the cache and deleted the R# cache directories and then rebuilt all of the projects individually and the issues went away.
Phew!
The solutions of #Andrew Finnell and #Julien Bérubé, alone and combined, did not fix my problem of "Cannot resolve symbol".
The comment of #bdwakefield pointing to here finally shed light on my problem.
It turns out that my "not resolved symbol" contains a web reference, and ReSharper gets lost there somehow.
By the link above it is possible to see that this is also an issue for many people, but JetBrains guys were not able to reproduce the error until now (see here).
I was having the same problem with one of my projects. I reported the issue to JetBrains and they requested a VS solution which has the problem.
So, I decided to spend a few hours trying to narrow down the problem as much as possible. I found out that the issue is related to a tool I use which strips out information from .DLLs.
If I don’t strip the .DLLs, Resharper works fine without showing any “cannot resolve symbol” errors. However, If I do strip the .dll, then ReSharper starts to show these “cannot resolve symbol” errors. In both cases, Visual Studio compiles the program and the program runs fine.
I am working with JetBrains to get the issue resolved.
In the mean time, I am able to workaround the problem by using versions of my .DLLs which do not have any information stripped out of them.

Debug Target Is Missing?

When I try to build my solution, I get the following error:
Visual Studio cannot start debugging because the debug target 'c:\target' is missing. Please >build the project and retry, or set the OutputPath and AssemblyName properties appropriately >to point at the correct location for the target assembly.
My output path is set correctly to bin\Debug, but the exe is never created in that folder. Instead, all I get are the exe.config, vshost.exe, and vshost.exe.config files.
Any idea what's going on?
Make sure that output path of project is correct (Project > Properties > Build > Output path)
Go in menu to Build > Configuration Manager, and check if your main/entry project has checked Build. If not, check it.
Go to properties > Application , and select the output type of your project
I've had the same problem;
Here are solutions that didn't work for me:
Building/rebuilding entire solution
Making sure the output path was correct (MyProject > Properties > Build > Output > Output path)
Here's the solution that did work for me:
Rebuilding just the project
You could open the project file with a text editor and replace 'c:\target' by 'bin\Debug'
EDIT
There are other more helpful answers but I can't delete mine since it's the accepted one.
#CZFox Answer
#Yehuda Shapira Answer
steps for changing target path is
Go to Properties
Then go to Debug
Browse the Start external program and select the bin/Debug/.exe file
I have solve this type of problem follow this step
1.VS2010 right click on the solution explorer and select the Build.
Again press Ctrl+F5 or F5
You can try the following steps to resolve the problem.
Step 1:
Right click on the solution and select the property
Step 2:
In Configureation property select the Build option button
I just stumbled across this problem, but I'm using Visual Web Developer Express 2010 and couldn't find any wrong path either within IDE or in the project file. Rebuilding or deleting build folders didn't help.
But after examining the projects .user file, which I've never done before, I discovered that the bad path was in there. Very simple if one knows where to look.
I had the same problem and the real solution was embarrassingly easy:
If, in your project, Visual Studio has never successfully compiled the program (before finding the first bug), you will get this error. What I did was remove all offending code (in my case, leaving just a simple button1_Click with no code). Run/Compile the code one time; exit the running program, and this message goes away.
The Compiler builds various directories and files on a first successful compile and these are used by the debugger. I am now recommending with all new projects, define the form, compile, close, and then begin coding.
I've found that this can happen if all the files are deleted from the bin folder. ReBuild the app to force a full build: right click on the project in solution explorer and select ReBuild.
Please follow the below steps to overcome this problem:
If you are working with VS2010, change platform target to x64
Select .net framework as 3.5
If you are using any custom code for Sharepoint and like to debug or deploy the use the above....and my bad sake i dont abt the .net applications
I had this error too (in VS2010), and in my case (two projects in one solution, with one being for unit tests) the answer was to go into the solution's (not the project's) properties and set a single startup project. I would've thought it also necessary, in that project's settings, under Application, to specify the "Startup Object", but it's working for me with or without that.
Although this has already been answered, I found that my own solution was none of the above. Admittedly a rookie mistake, within my solution I had multiple projects, and thus when trying to run solution, the wrong project was set as the Startup Project.
So in my own case, not to say others, the solution was to right click the project and select Set as Startup Project
I tried everything mentioned in this thread but none worked.
Then, i tried the simplest thing and it worked.
Close visual studio and open it back up again.
This was a really annoying error!
I kept trying to start a debug instance but it just wouldn't make an exe! Though there were errors in my ConnectionString (while trying to make an SQL connection). There were two backslashes that were supposed to be a part of a path and the tutorial I was following told me to ignore it.
Well, turns out that was the error. A backslash marks the beginning of some escaping that you want to do, and the way to have a backslash displayed is \\ instead of \.
Got rid of that, and it worked for me.
EDIT: It would seem that you have to get rid of the tiny errors that you have made while writing your code to let it compile properly.
I have solved this problem by changing the Platform Target to "any CPU".
If the above explanation does not help you, then you could have error in the program. I have the same issue and I solved it as I cut the functions used in the same class and one of the functions were the cause of it.
I had a very very similar problem, but almost non of the solutions worked for me, finally when i reset the VS setting, it fixed...
To reset settings:
Tools Menu >
Import and Export Settings >
Select Reset all settings radio >
Next >
Next (You can backup your current settings in this step) >
Finish
Problem:
The problem was I had bad nuget source configuration, so the solution could not start properly despite the fact it was build correctly because it still saw old dll references.
Solution:
It was not enough to change nugget source url, I just had to remove entire nugget source and add it again with proper url.
Clean solution and rebuild it.
There are many issues that can lead to this problem, after losing 2 days to this issue I think I have the root cause of this issue and also the problem of the Form Designer throwing an error when switching to the Design view (also seems to effect the DataSet Designer):
A language syntax error that Intellisense doesn't catch.
Once I went through my code with a fine tooth comb I found a couple of really boneheaded mistakes that I kept overlooking, once those were resolved the solution compiled just fine and the output was in the correct place.
Here is the solution for this problem, no need to change anything for this problem.
You all know C# is case sensitive language and we have to write all methods and statements in correct case.
We all are just missing this thing and we just have to change method 'main() --> Main()'
This thing solved my problem please let me know if you still find any :-)

Categories

Resources