Have recently upgraded to Visual Studio 2013 Pro and am having some teething problems.
Primarily if I change any HTML or CSS in either a .aspx page for Web Forms or .cshtml for MVC, the changes aren't always reflected on the page I'm working on when I debug it and don't appear not matter how times I refresh or clear my cache.
Am using web essentials, which should put the changes straight on the page with have to refresh the page but this doesn't seem to be working either.
Also occasionally, but not always, if I stop debugging, change the code behind then run the project again it says it's running from a different version of the code than the one being debugged and I have to stop it, rebuild and then debug.
Have never had these problems on previous version of Visual Studio.
Any suggestions?
Go to Tools-Options
Under Projects and solution -> Build and Run select "Always build" under "On Run, when projects are out of date"
I had the same issue today. I already had that setting on (Always Build). Cleaning & rebuilding the solution didn't do the trick. I looked under C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\ and I found a folder named root with a lot of temporary hexa-numeric named folders. Only one folder had today's date. I closed all VS 2013 windows and removed that folder. After I restarted VS 2013 I simply run the project and my changes are now back.
I just spent the past hour trying every answer and none of them worked. I simply cleared the cache on the browser I was using to debug (google chrome) and it updated my changes. This question had the correct answer:
visual studio not updating html / javascript to server / browser
I was experiencing old code in the debugger with a console application calling a DLL. I believe it was occurring because the previous version of the DLL was installed in the Global Assembly Cache (GAC), and the Visual Studio debugger was calling the DLL in the GAC (Which had the old code) instead of the current version. I uninstalled the DLL from the GAC and the problem was resolved.
Uninstall an assembly from the GAC (MSDN)
I had this issue and tried all the Build config changes etc without success. I'm running VS2015 in a Parallels VM and saving the project on a drive on the Mac. It appears that there is some odd/tiny difference between the Mac time stamps and the Win10 clock.
Setting the Win10 clock back 5 seconds resolved the issue. Bizarre but saved my sanity...
for my case, I tried all the before mentioned answers but nothing worked. and then I went to the system logs and found a hint about failure in loading IIsexpress for the running application. I changed the port that the application used and voila! everything is back to normal. thought this might help someone
I had a similar issue and found the solution by checking the path of the virtualDirectory for your sites that are found within your applicationhost.config file.
Typically located here:
C:\Users{your user name}\Documents\IISExpress\config
You want to make sure the physical path for both locations are the same since sometimes they get wonky when working on various branches/projects etc.
it's not a bug at all, and has nothing to do with the above answers.
Go to solution explorer and click on --> sync with active document. as shown bellow:
Related
I just changed to Visual Studio Community 2015 and I'm having a weird issue running a project. The project builds without any errors. But, when I go to start debugging I get the following error:
There is an error in web.config. Please correct before proceeding. (You might rename the current web.config and add a new one.)
This only happens if web.config is not open in the editor in Visual Studio. If I open web.config in Visual Studio and try to run the project, I am able to do so and no errors are reported.
Has anyone suggested that we close and reopen Visual Studio?
I had the same problem in a Web API project in VS Enterprise 2015. I knew there was nothing wrong with the Web.config file because, like you, all I had to do was to have it open before hitting F5. It went away after I removed and re-added the project to the solution during solution re-organizing. You might want to try that. No logics here but then the error seems illogical too.
I fixed/stopped the issue above and wanted to communicate what my fix was with the exact same symptoms as above. I had switched to a different published environment when this started happening (from UAT to Dev) and I commented out a section in the web.config file. Double checked to make sure I commented out the exact text. I even cleaned my solution and rebuilt it, same problem. Strangely, I could publish to the dev environment and the application would run (Web app with IIS 7).
The only difference between my local environment from when it was working and this problem was my web.config file. So I was thinking VS was having trouble accessing the file when not open in the IDE. I checked properties and the file had the appropriate settings. I then checked in the solution into our source code repository and the issue went away. We implement an SVN solution here.
Hope this helps.
After copying the project to another laptop/ PC, when I want to open the solution, VS2010 shows the error "One or more project was not loaded properly". I have tried running visual studio in admin mode but that did not solve the problem.
This is usually a result of an inconsistency in your solution or projects. Open the solution file in an external editor (such as notepad) and check that the path it has to the projects is available and did not change. There shouldn't be any absolute paths in the solution file.
Maybe because the project from where you copied was configured with IIS configurations and you are trying to run the project in visual studio's default environment.
you have to right click on your project and set as a start up project after that you have run your project,
I seem to have found unloaded project, after noticing there's one missing by manually counting and comparing it to the number of projects the solution explorer reported. It was deep inside another folder in the solution explorer that I never used and assumed that had nothing worthwhile.
It's a familiar issue. Looks like the project you are trying to open was created in higher version than what you have. If the project is in MVC, make sure you have installed MVC OR Make sure you have appropriate version of .NET installed in your system.
I work with NopCommerce and a couple of times I downloaded new version and got same error message. It goes away once I install the dependencies.
Because you tagged it ASP.NET make sure you have all the ASP.NET components installed. Those are not part of .net framework but might be necessary in your project.
I am getting the following error when trying to compile and test any type of project in Visual Studio 2012 Professional.
Error 1 The specified task executable "Csc.exe" could not be run. The
specified executable is not a valid application for this OS platform.
After testing multiple suggestions online nothing has fixed the problem. Anyone know what is causing this? Is there a new version of Csc.exe I need to get a hold of? I know this is the compiler just not sure what I need to do to fix the problem.
I had this exact problem today on my Win7 Machine. As Hans suggests, 'Navigate to C:\Windows\Microsoft.NET\Framework\v4.0.30319 and type "csc".'
The file may still exist but if you can open it with notepad, it will probably show just plain text of some errors. This is the indication that your compiler has been destroyed. At my office we have come up with a theory that a Windows update may be causing this because only a few machines have been affected, but I haven't read much online about it until now.
We fixed this by copying someone else's csc.exe into the C:\Windows\Microsoft.NET\Framework\v4.0.30319 directory and recompiling. Be sure to set the options on the file to read-only so this won't happen again. Good Luck!
The problems associated with csc.exe in Visual Studio 2012 can mostly be solved by repairing Visual Studio.
You need to repair Visual Studio. Go to Control Panel -> Programs. Then select your version of Visual Studio you are using and press "Change"(or right click it and press "Change"). When the setup appears, click "Repair".
I am on Visual Studio 2017 but this is the first google result that pops up for "csc.exe not found"
When I got this error I had to restart Visual Studio, being sure to select 'Run As Administrator'. Everything worked after that
I've faced this problem while i am trying to move Asp.Net Mvc Project from one computer to another ; error message was : The specified task executable location "c:\users\mypcname\documents\visual studio 2015\Projects\TestMVC\packages\Microsoft.Net.Compilers.1.0.0\build\..\tools\csc.exe" is invalid.
I solved this by
Creating new Mvc Project ;
going to that folder \Microsoft.Net.Compilers.1.0.0\build..\tools
and Copied the csc.exe file to my Projets >> \Microsoft.Net.Compilers.1.0.0\build..\tools\
i think when i was copying the project from the original Computer i left that csc.exe file in the specified folder.
Hope this will help someone.
Check your solution properties (right-click on Solution and select 'Properties') and make sure that the 'platform' field (Configuration Properties) is set correctly.
I think this problem is caused due to improper PC clean up. I was running Quick Heal PCTuner 3.0 software on a 64-bit windows 7 machine but suddenly due to loss of power my machine was shut down then when i opened it again I was getting this problem in VS 2013. Even TortoiseSVN checkout was not working and throwing internal error and something like corrupted disk also was shown when trying to delete some files on the harddisk.
I ran the PC Tuner again doing the Disk, Registry and traces clean up and it got fixed. maybe this problem may occur due to other cases also but is mostly related to the system's files In my case this is the fix
Regards.
in my case helped (I had .net framework 4.5.1 and vs c# 2010 express):
download the newest .net framework and run repair
On Visual Studio 2013, the same problem solved by doing this for me:
Right click the solution and open Configuration Manager. For the project(you may see at least one there), I've changed the Platform from Any CPU to x86 for the project that may causing the problem.
I've tried to delete and move csc.exe file but it doesn't do anything.
Then simply I upgrade .net version and than downgrade (returned to its original state) and it works.
I solved my problem by copying the whole folder containing my visual studio solution
From C:\Users\me\Google Drive...
To: C:\Users\me\OneDrive...
The problem I have run into twice now is that my program seems to be running code that no longer exists. I figure that some old version is stuck some how but have no idea how to get the compiler to run the updated code I've written.
The way I have spotted the problem is by observing that bit maps I've loaded keep getting drawn even after I've removed instructions to do so. The problem persists even after removing every reference to the image in question, content load lines included.
The first time this happened restarting the compiler didn't fix the problem but restarting the computer did. Now the problem has persisted after a full shutdown.
I m using ms C# 2008 express edition if that has any bearing.
My first thought would be that the build is failing and that Visual Studio is running the old version. I don't have VS 2008, but in VS 2010 the option to change this option is in Tools->Options->Projects and Solutions->Build and Run.
You have to figure out where the mismatch is coming from.
What happens when you run the .exe from outside VS? What about from inside VS? Can you verify that after a build, the binary you're executing has an updated timestamp? Is the stale code in a .dll where the new version isn't getting pulled in?
In my experience this happens when configuration profile is changed from debug. For instance if I am running the debug profile, it works. Then I change to the QA profile and make changes and then build the new assemblies. The assemblies are built to a directory called "QA" however, when I debug through visual studio it runs the code from the debug profile. I can remove references, recompile the code, visual studio will still run from the debug profile. It appears that none of the changes I made are in the code. When in reality I'm inadvertently running a old build.
I wrote a WPF application in C# using VS 2010. The application will run fine in debug mode using Visual Studio, but when I go to run the .EXE from the bin\release folder, nothing happens. I do not get any error messages from windows and there are no errors or warnings in VS. I have tried to build, rebuild and clean the solution (in every possible order) with no luck. My solution contains 2 projects, both of which use .NET 4.0 framework, and I have .NET 4.0 installed on my PC. I have tried on both XP and Win7 and still nothing.
I also just noticed that the output from Debug when I run the application in debug mode says: "Cannot find or open the PDB file" after each .Dll it loads.
I am compiling to the Release folder every time, but i did try changing it to the debug folder and clean/rebuild just to see if that would make a difference, and it didnt, so I changed it back, tried it again, and still nothing.
Any Ideas?
Here are a couple of ideas that come to mind
If you are on a x64 machine, try changing the application from being AnyCPU to x86. This the mode that applications default to in debug mode and it's possible an issue running in x64 is causing a problem in release builds
Possible the Release binaries are out of date. Delete the binaries from the Release folder, rebuild and run the newly generated runs
Run the release build under the debugger in Visual Studio and see if it till crashes
I was experiencing the above issue too, however none of the other solutions worked for me.
My Application logs in Event Viewer listed event ids 1018 and 1022. This appeared to be bizarrely related to an ASP.NET 2.0 dll (bizarre; as this was a blank WPF project only). The logs contained messages like this:
Windows cannot open the 64-bit extensible counter DLL
ASP.NET_64_2.0.50727 in a 32-bit environment
In the end it turned out to be resolved when I disabled my anti-virus. I had read that this resolution worked for someone with McAfee; and it also worked for my environment, which has Avast.
I assume you tried on a machine that doesn't have visual studio installed, and also none of the components you are using for development.
You have only one option: start the application with a debugger on the machine that causes problems and check for exceptions there. (use WinDBG for example - it's light and easy).
This looks like a problem with missing dependencies, but might be something else also.
The Debugging Labs should give you enough information on how to use windbg to find your problem:
.NET Debugging labs
Also use this:
WinDBG Cheat Sheet
(JaredPar) answer looks right (x64), but if not try right clicking on the EXE and running in admin mode for win 7.
I had a very similar issue.
Check out this setting on your App Pool entry:
Go to Advanced Settings.
Change 'Enable 32-bit Applications' to 'TRUE'.
This worked for me!
I'm going to go with a wild guess that:
Either you have some odd corruption in your .NET Framework installation
There is some debug/release-specific code using #if DEBUG or the such that is substantially different to cause issues.
You have not compiled recently into Release yet (Try changing it to Release before compiling your latest code and make sure you get no errors).
Those are the only things I can think of off the top of my head.
I had run into a similar issue, I was missing a custom folder in the release mode I was referencing in the constructor. Adding the folder to the release fixed the problem.