| Subcribe via RSS

Error when Opening VS.NET Project Moved to New Folder

September 8th, 2010 | Comments Off | Posted in visual studio

So from time to time, you need to move a Visual Studio project to a new folder to do some new fun things with it — upgrading code, replicating a project or just because. Well when you do this VS.NET doesn’t like you too much because all its references were pointing back to that original folder. In my case, I got hit with errors two fold. The first:

The local IIS URL http://[XXX] specified for Web Project [XXX] has not been configured. In order to open, the directory needs to be configured. Would you like to create a virtual directory now?

Sure Visual Studio. Knock yourself out. You Ok through only to get hit with:

Creation of the virtual directory [XXX] failed with the error: Could not find the server [XXX]. Creating a virtual directory is only supported on the local IIS server.

Couldn’t you have just saved me the extra error message and spit that out to begin with? So our culprit is the .csproj file. Open that up in text pad and scroll to the bottom. Within the WebProjectProperties XML block, there is a UseIIS node. Flip that from true to false. Save it out and you should be good to go.

Adding Project to Source Control in Visual Studio

December 8th, 2009 | Comments Off | Posted in visual studio
This is probably old hat to most here, but Source Control is still fairly new to me within the context of Visual Studio. Case in point, I was trying to take a local project I had developed on my box and integrate it into a solution already created on the Team Foundation Server. I checked the solution out then I was dead in the water. It seems the key is to right click on the name of your project in the Solution Explorer window then select ‘Add Solution to Source Control.’ Now all you need to do is check in your changes and you are set.

“The name xxx does not exist in the current context” when Importing Files into New Visual Studio Project

December 2nd, 2009 | Comments Off | Posted in visual studio
Ok this gets filed under idiotic things that took way longer to figure out than should have. I had a code file from another programmer that I was going to pull into Visual Studio and work off of. I went New > Project > ASP.NET Web Application then I added ‘Existing Items’ to my Solution. I go to do a build, and I get back 57 errors. What the what? All the ASP.NET controls are showing up as unrecognized with that nice error message saying “The name xxx does not exist in the current context.” After trying several fruitless things, I saw an option under my right click on the solution that said “Convert to Web Application.” Punched it, rebuilt the project and it is now error free. Its always the simplest things that get me.

VS Error: Visual Studio 2008 compiler could not be created.

May 5th, 2009 | Comments Off | Posted in visual studio
I tried to open an existing project I downloaded example source code for off the web and it triggered the error message “Visual Studio 2008 compiler could not be created. QueryService for ‘{74946829-37A0-11D2-A273-00C04F8EF4FF}’ failed.” Turns out we just need a quick registry edit. Pull up Run and launch regedit. Step down to HKEY_CURRENT_USER\Software\Microsoft\Visual Studio\9.0\Packages and look for the value SkipLoading. More than likely its DWORD value will be set to 0×00000001. Just update this value to 0×00000000 then try opening the project again which should give you the result you are looking for. Tags: ,

Visual Studio Templates Disappear

May 5th, 2009 | Comments Off | Posted in visual studio

I was working on building an autocomplete AJAX control. All of the sudden, things start erroring out and down goes Visual Studio 2008. The real surprise comes when I try to relaunch VS and there are no templates to choose from anymore when creating a new project. In digging through the Event Viewer we find multiple triggers of the following message: Error in Template (C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\ItemTemplates\Web\VisualBasic\1033\AdoNetEntityDataModelVB_ASPNET.zip), file (ModelObjectItemVB_ASPNET.vstemplate). Invalid template element (TemplateID) value (Microsoft.Data.Entity.Design.VSTemplate.ModelObjectItemVB_ASPNET).

Turns out recovering these missing templates is an easy fix. First verify that the Project Templates still exist under c:\Project Files\Microsoft Visual Studio 9.0\Common7\IDE\Project Templates\ (may vary slightly depending on what version of VS.NET you are running).Next, you simply need to reinstall them. At the command prompt, point to the directory c:\Project Files\Microsoft Visual Studio 9.0\Common7\IDE\. Now execute the command DEVENV /InstallVSTemplates. Close down Visual Studio and relaunch. All your default templates should be here again.

Tags: ,

Lost Visual Studio Project Files

April 30th, 2009 | Comments Off | Posted in visual studio

Save your work, save your work, for God’s sakes man save your work. Ok I feel better after getting that off my chest.

So evidently the new Visual Studio Express 2008 is saving files in a temp directory to enable you to create quick tester projects without cluttering up your Projects directory. I don’t know about you, but personally I’d rather have the clutter than lose a project I’d been working on and off for two days. In the world I had been living in, you can compile the project — it saves — you are good to go. Well I got in my final compile then I went to find the executable. No trace of it under the local Visual Studio 2008 Projects folder within my profile. I close out of VS thinking it would be there on last opened projects when I went back in. No go. Come to find out this temp project was being stored in C:\Users{Username}\AppData\Local\Temporary Projects while I was developing it, but there is no trace of it now.

After doing some research online, it has indeed disappeared like a fart in the wind. So for your sanity as well as mine, go into Visual Studio right now and go to Tools > Options > Projects and Solutions and check that box that says Save new projects when created. No one should have to go through this headache just because Microsoft decided it would be cute not to include this by default anymore.

My only partial saving grace is last night I had done a compile and pulled out the exe file to run in a directory on the root. You’d think it would have occured to me at the time that these project files really shouldn’t be in a folder marked ‘Temporary Projects.’ Anyway with the exe in hand, I decided to look for a c# decompiler program to at least recover part of my work. I found this great free app by Redgate called .NET Reflector. I just pointed it to the exe and it kicked back the code in the disassembler. Pretty cool stuff. Now if I just had the final exe to reverse engineer. Oh did I mention you should save your work?

Tags: ,