There was a registry fix for Visual Studio 2005 to prevent it from checking references in .aspx files, but it does not seem to work for 2008. With variable renames, finding all references in an ASP.NET project is extremely slow. Is there a way to prevent this in VS2008?
This is one thing I have given up hope for ever working right in Visual Studio. This is also one of the primary reasons I started using ReSharper in the first place.
Other than some 3rd party plugin, I have no other suggestions for you.
Related
I have a huge enterprise asp.net application that perfectly builds and runs on servers. We've been using Visual Studio 2013 in our workflow. Now we want to migrate to newer IDEs. But if I build this application in Visual Studio 2017 I'll get this error.
Error BC40004 sub 'PreInit' conflicts with event 'PreInit' in the base class 'Page' and should be declared 'Shadows'.
I think it's a problem with VB compiler version (again vs2013 builds project). Do you have any idea how to fix this?
My solution contains 40+ projects. The main project is asp.net webforms app written in VB.net. Other projects are services and code libraries written in C#.
I tried to specify VB.net version in .vdproj manually. But it didn't solve my problem.
edit: Fine. Thank you all for your responses. I got that problem is about code and that visual studio analyzer has changed a lot in the last few years. I'll try to find out the reasons why this code have been working without exceptions.
BC40004 is a warning, this shouldn't prevent you to compile the solutions unless you set the Treat warnings as errors on the project's property under the tab compilation.
We have been encountering more and more frequently the Visual Studio error of being unable to generate the designer file in a web project. This problem has been occurring for a few months now, in several of our ASP.NET projects.
The errors occur when saving a file or when building the project, and are variations of errors like this:
Generation of the designer file for [filename] failed: Error HRESULT
E_FAIL has been returned from a call to a COM component.
Generation of the designer file for [filename] failed: Unspecified
error (Exception from HRESULT: 0x80004005 (E_FAIL))
Generation of the designer file for [filename] failed: An entry with
the same key already exists.
Generation of the designer file for [filename] failed: Value cannot
be null.
Sometimes, additional error messages are displayed for valid, previously-working code/markup; errors such as:
The name 'Eval' does not exist in the current context
This is with Visual Studio 2013 (Premium), with "Web Application Projects" type projects using the .NET 4.5 framework. Some of the projects were originally created in Visual Studio 2010 or Visual Studio 2012, but one of the projects was a new project created in Visual Studio 2013.
We have a few Visual Studio extensions installed, such as "Web Essentials 2013", but I have tried disabling all the installed Visual Studio extensions and the same designer file errors still occur. We do not have Resharper or CodeRush installed. We are also using a third-party components package (DevExpress) for ASP.NET. We are using IIS Express for the local development web server.
All available updates (including Update 1 for Visual Studio 2013) have been installed for Visual Studio, the operating system (Windows 8.1), .NET, Visual Studio extensions, and DevExpress.
I have searched StackOverflow and the web for this issue, and have found some suggestions but no solutions, and I have also seen that the issue has been reported to Microsoft several times, dating back some years.
Many indications are that the problem with generating designer files is caused by some invalid syntax (in an ASPX file), or multiple elements with the same ID in the same scope, or collisions in namespace or class names, etc. I have searched through our projects as best as I can for issues like this, but haven't found any.
I found the Redesigner project on Sourceforge (thanks very much to the author), and I tried using that to verify the designer files, but unfortunately it can't handle the DevExpress components (it reports that DevExpress elements are using invalid child tags when the tags are valid and correct for DevExpress).
I have also tried clearing the Visual Studio development cache on my workstation (that is, deleting everything from the folders "\Temp\IISExpress", "\Temp\Temporary ASP.NET Files", and "\Microsoft\WebsiteCache" folders in the %localappdata% folder, rebooting and restarting Visual Studio.
I also found a website that explained how to turn on additional logging for Visual Studio to help with tracking down designer file generation issues. For Visual Studio 2013, this requires adding a key HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\12.0\WebApplicationProjects\Debug and then adding values under that key for "Enabled" (set to 1), "LogFieldGeneratorFailures" (set to 1), and "LogFile" (set to a path and filename that you have permission to write to).
When I added this key, Visual Studio 2013 did write to the debug log file, but it only included error messages similar to the error messages above plus a small stack trace plus the entire content of the ASPX file for which the designer file could not be generated (with no apparent indication of where in the ASPX page there might be an error or invalid syntax).
I think I have tried essentially all suggested approaches in this topic:
How do you force Visual Studio to regenerate the .designer files for aspx/ascx files?
None of these have worked for me. The "Convert to Web Application" option for the ASPX file is not available for me in Visual Studio 2013 in these projects.
Does anyone have any suggestions for potential causes or fixes for this desinger file issue or for any other troubleshooting approaches?
The latest that we have discovered with this issue is that it's related to the Source Control option in Visual Studio to "Get everything when a solution or project is opened".
Having this option UNCHECKED seems to have resolved the problems for our team so far (for the past few days).
There is also this issue posted at Microsoft Connect: http://connect.microsoft.com/VisualStudio/feedback/details/760443/visual-studio-2012-ide-loses-intellisense-and-reference-resolution
The comments at the link above suggest that the bug is caused by asynchronous retrieval of files from source control or the asynchronous solution load when Visual Studio is opened. The choices suggested for fixing the problem are to either turn off the asynchronous solution load or to disable the "get everything on open" option.
There are also suggestions that deleting the .suo (Solution User Options) file in the project directory resolves the problem, but this seems to be only temporary.
The only solution that I've found to work is to delete the Visual Studio cache # C:\Users\<>\AppData\Local\Microsoft\VisualStudio and then running Visual Studio with the /resetuserdata switch. It's a horrible solution that deletes all of your local settings, and resets Visual Studio.
(You can try exporting and importing your settings before and after the surgery.)
Links
(Delete the 2013 cache)
http://blogs.msdn.com/b/willy-peter_schaub/archive/2010/09/15/if-you-have-problems-with-tfs-or-visual-studio-flush-the-user-cache-or-not.aspx
(Fixing the error in 2010, which is slightly different)http://rathodkrunal.blogspot.com/2011/11/visual-studio-2010-error-hresult-efail.html
It's also an open item on connect, if you want to bug MS into fixing it.
https://connect.microsoft.com/VisualStudio/feedback/details/799832/constant-call-to-com-component-fails#tabs
Ran into a very similar issue assisting a colleague. The project had been converted from 2010 to 2013 and was working for most developers. To "resolve" this, we had him close the solution, then delete all of the source control files at the solution level, (vsssc). Once reopening the solution, all was fine.
I've had this issue constantly in different dev environments for the last while. I managed to solve it in one case without using the cache clearing technique by launching component services->DCOM Config. When I did this I was prompted to register a missing key. (didn't quite catch it but something related to EventManagement). Clicked OK and lauched visual studio...hey presto...back in business. Hopefully this advice might catch a few cases out there.
Is it possible to have .aspx and .aspx.py (IronPython codefile) nested underneath aspx files in VS 2010 ? I've seen some people added Windows registry entries for Visual Studio so other files would show up as nested underneath aspx, but I've no idea how to do it for IronPython if possible
I found the solution just in case someone needs the same, for websites which is what I needed (for web applications is easier because there's an installable tool)
Add a registry entry key ".py" in
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0_Config\Projects{E24C65DC-7377-472b-9ABA-BC803B73C61A}\RelatedFiles.aspx
I know this is a strange situation, but consider a situation where two programmers are working on one project. One programmer is working on a database driven website in ASP.NET in Visual Studio 2012, while other programmer is working on Visual Studio 2008 on another part of the same database driven ASP.NET website.
What in your opinion is the best way to integrate the two codes?
PS: Downvoters please explain in comments, before downvoting. :-)
Make the second developer update his VS copy to 2012. If you are working with two disparate versions of VS, you will very simply be unable to have either developer work on any part of the codebase that was built with (or upgraded to) the other version.
Once everyone's working on the same platform, and thus can load and build the same solution, project and source code files without error, "integrating" the two codebases becomes rather trivial. Of course, the conversion process may not be so trivial.
My first step would be to ensure that a reliable backup of the entire codebase has been taken; you can copy the flat files to a file store, or more reliably you can use a centralized VCS like Subversion to make sure a single authoritative copy of the codebase as-is exists and can be easily retrieved. Then, while the 2008 dev is updating his machine to 2012, have the 2012 developer pull the whole codebase and load whatever solution the 2008 dev had been working in, and run through the conversion wizard. This wizard will update the XML behind the project and solution files to support features of the new IDE version.
If you absolutely positively cannot get both devs onto the same IDE version, there's still hope. Have the 2012 developer open a new solution file in his copy, and pull in the 2008 projects. If VS asks to convert them, you're SOL; the other dev will HAVE to upgrade, or the 2012 dev will have to revert. But, if the IDE doesn't complain, the 2012 dev can save the new solution under a different name and work with the projects and their source code using that solution file, while the 2008 dev can continue to use the original one. Understand that as long as this state of affairs continues, the 2012 dev cannot use any features of C# 4.0/4.5, such as dynamic types, covariance/contravariance keywords, optional parameters/named arguments, async/await keywords, etc cannot be used in any source code that must remain usable by the 2008 dev. Language-wise, the 2012 developer is limited to C# 3.0, and the .NET Framework 3.5. This does not solve the problem of the 2008 dev not having access to code written from scratch by the 2012 dev in projects created by that IDE; he simply must upgrade to work in these parts of the codebase.
Visual studio designer for asp.net applications is generally very slow and i would like to know if there are any tips or guidelines for settings in order to get better.
The problem is usually noticed when i try to make a change in design or source view, especially in source view it may get non-responding for a couple of seconds.
I experienced a very similar issue when I first installed Visual Studio Team System 2008 Development Edition. I have issues with VS design view and could not switch to "Split View"
Reference the following ASP.NET thread link to see if any of this information helps..(Warning: It is quite long).
Do you notice any difference when starting in Safe Mode?
devenv.exe /SafeMode
I assume that you have already installed the hotfix for VS2008 ASP.Net Designer performance issues? Link