Is intellisense not working properly in VS 2008? - asp.net

I've got trouble getting Intellisense to work in ASP.NET source view.
For example, I register the Telerik RadControls DLL with a tag prefix, as it says in the samples:
<%# Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
But when typing <telerik: no intellisense appears.
Also, after adding a couple of controls, they get highlighted with the error "Unrecognized tag prefix or device filter 'telerik'". This is pretty annoying and I can't seem to find a solution.
Btw, the webpage itself works - its just the Intellisense that doesn't.

Intellisense may fail for various reasons so I am going to ask you a few questions:
Does design time work as expected?Sometimes if the design-time assembly is not loaded intellisense may fail.
Do you work on a remote drive by any chance? We have found issues with that as well. The remote drive needs to be added as a trusted location for assemblies.
If you are using an older version of RadControls you need to add reference to Telerik.Charting.dll as well. Which version do you use?
Finally we have found that upgrading to Visual Studio 2008 SP1 solves lots of problems. I strongly recommend you upgrade if not already.

Does your entire project compile? Intellisense often breaks if there are compile errors elsewhere (even compile errors in other pages).

ctrl + space is a shortcut to trigger it ...
probably won't help but at least you will know that the problem is probably with intellisense not being able to find its data.
do you get intellisense for other classes still?

I noticed a general problem with intellisense in VS2008 (with SP1).
As they started supporting JS intellisense a lot of things became slower - or not working sometimes.
I know the describe problem - not only with telerik controls, I also know it from other (and my own) control libraries.
Most of the time a rebuild - close of all pages, and restart of VS solves the problems for me.
My special problem (I guess it matters) is that I use a German release of VS2008.
But also other things rule (from my experiences):
The size of the project (somewhere above 50 pages things become worse).
The time I had to kill an app while debuging :)
General the time (in a session) I work on a project.
A last tip (which may help) I feel less problems when I add a ref to the controls directly in web.config. Additionally it frees me from havin the register directive on every page.
It looks like this:
<controls>
<add assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagPrefix="telerik" />
<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions,
HTH
Manfred

Just fixed this myself for VS2008 (for aspx/ascx and codebehind) by adding the Telerik .dlls to the GAC on my local development machine.
I've had this issue before and both times it occurred was when my project was hosted on a network drive, where the project's path would be something like: *\\networkmachinename\c$\inetpub\projectname*
The fix:
On your local machine, go to Start > Programs > Microsoft Visual Studio 2008 > Visual Studio Tools > Visual Studio 2008 Command Prompt (run as admin)
Using the gacutil tool and the following commands (or more depending on how many .dlls you wish to use), add the assemblies to your GAC:
gacutil.exe -i "C:\Program Files (x86)\Telerik\RadControls for ASPNET AJAX Q2 2008\Bin35\Telerik.Web.UI.dll"
gacutil.exe -i "C:\Program Files (x86)\Telerik\RadControls for ASPNET AJAX Q2 2008\Bin35\Telerik.Charting.dll"
Obviously modify the dirs as appropriate for your OS/Telerik/Framework versions, then close Visual Studio 2008 Command Prompt, close VS2008 (if open) and restart VS2008 again.
You'll find the intellisense works on the aspx/ascx files first, and given a few minutes it'll work on your codebehind files too. Close and retry if it still doesn't work.
One other note, if you have a small error somewhere in your website's root web.config file, you'll also lose intellisense for Telerik (and perhaps other) controls - so check your web.config files aren't erroneous first.

Related

Visual Studio file nesting aspx - aspx.py

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

ASP.net and devexpress scheduler, works local, does not work live

Hi guys I got some code here thats buggin me.
ive managed to create a page and get it working on local host, but when i publish this to go live and nav to the web page it comes up with this error.
Could not load file or assembly 'DevExpress.Web.v11.1,
Version=11.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a' or
one of its dependencies. The system cannot find the file specified.
(E:\web\shafteccom0\htdocs\Calendar\web.config line 44).
Ive tried adding all the references, and i mean all of the dev express ones, including ones i dont even need.
my project is a web project using visual studio 10, asp.net,C# & .Net version 3.5
ive also tried changing the .net version to 2.0, 3.0 and 4.0 but no luck.
If you need my code let me know and ill edit this.
Many thanks
That error means that the library that your application is looking for does not exist on the server you are deploying it to (or it cannot load it with the variables provided). Does the live server have the VS2010 references installed to it?
Just making sure: Are you sure your references set to "CopyLocal"?
I think DevEx installs it's assemblies in the GAC, so your local copy may be working but not when you deploy. Have you tried looking in the bin on the publish location to see if they are actually there?

ASP.NET Browser Caps update

I'm trying to update the browser caps using the ".browser" files (browserCaps section of the web.config is deprecated in .NET framework 2.0). So far, I found this project on CodePlex that provides updated files:
http://aspnet.codeplex.com/releases/view/41420
From the Visual Studio 2008 command promt, I ran the command "aspnet_regbrowsers -i" wich creates an assembly (ASP.BrowserCapsFactory.dll) and installs it in the GAC.
So far so good, the updated definitions take effect in my asp.net application.
The question is, is it possible tu use that assembly outside the GAC, like add it as reference in a Web application (I tried it and unless I'm doing something wrong, it doesn't work)?
I'm aware of the "App_Browser" folder solution, but I'm looking for a solution that will ensure the same browsers definitions for several web application without having to put an assembly in the GAC.
Thanks in advance for your answers!
ASP.NET 4 White paper
According to ASP.NET 4 whitepaper, you can manage browser capabilities within your code by extending the ASP.NET Browser capabilities or totally replace it. So far, it's the best you could do instead of using the aspnet_regbrowsers

generating an asp.net web application dll requirement list

I'm trying to set up a web app (32bit on ii7/win7, 32bit setting is enabled, everything is compiled to x86, using vs2008), but there's clearly some dll module loading issue happening. I've been watching procmon and fusion logs but I'm not seeing the name of the missing dll.
I'm a complete newbie to asp.net (but fairly heavy experience on other platforms).
I know I can call depends.exe on a binary to see what the dependancies are, but how do I do it for asp.net? specifically, is it possible to get a list of the dlls that iis7 loads for my application?
update: I manually blew away all of the binaries for my application and rebuilt (clean didnt seem to do the trick, I guess). it's now sort of working. or at least it's getting further and more detailed.
An asp.net web project dll shouldn't depend on anything that is not part of the default .net run-time or explicitly referenced in the project. I would start by reviewing the references. Noramlly an asp.net web project has a bin folder that contains the compiled website/webapplication and any dll's that it depends on (aside from the .net run-time). This is usually done by the programming tool used to create the project.
If you still don't find the culprit, you could try using Filemon (http://technet.microsoft.com/en-gb/sysinternals/bb896642.aspx) and use it to watch IIS to see what files it is looking for and isn't finding.
An additional option is to examine the web.config file that should have been included with the web site/application. Its an XML file and usually has an Assemblies section that lists assemblies that should be loaded. For example you might see:
<assemblies>
<add assembly="MySql.Data, Version=6.2.3.0, Culture=neutral,
PublicKeyToken=C5687FC88969C44D"/>
</assemblies>
This means that the code wants to use the MySQL.Data.dll, and specifically version 6.2.3.0 of that DLL. It is possible to have different versions of .Net dll files installed at the same time. So you might have the desired DLL, but not the correct version as specified in the Web.Config file.

Intellisense broken in 64 bit Windows when using mixed-mode (i.e. managed C++) assemblies

This is annoying more than anything, but I have no working Intellisense when I use any of my custom web controls in .aspx/.ascx pages. Intellisense in standard <asp:...> controls are fine, as it is in all code-behind files etc.
I'm pretty sure this is caused by Visual Studio attempting to analyse the website's bin folder for custom web controls, and throwing a hissy fit when it gets to one of the DLLs - a (mixed-mode) 64-bit managed C++ assembly (I'm running 64-bit Win 7). It seems that Visual Studio tries to load this assembly, and fails, due to VS being a 32-bit app.
Anyone have any ideas how to work around this? I looked for an option to get VS to ignore the 64-bit assembly (there are no web controls in it - they exist in another standard assembly), but alas, nothing to be found.
Note: this is VS 2010, but I'd imagine this would be a problem in any version.

Resources