Tracking down references to a service - asp.net

I get this error in my ASP.NET 3.5 website:
Error 3 Cannot update project reference 'Services'. Source project not available.
How can I track down any reference to this assembly so I can then delete it? It must be called from somewhere. I no longer have an assembly in my project with this name.
Thanks

Check your references: in your Reference Paths Dialog Box (Visual Basic) or the Reference Paths Page, Project Designer (C#, J#).
See this link in MSDN for details: How to: Add or Remove References in Visual Studio

I didn't have much luck with the previous answer for web projects, so I thought I'd offer another way. Web project references are kept (non-intuitively) in the solution file, and with care you can edit this file to remove the reference.
Close the solution if you have it open, then open solution file in a text editor.
Search for name of the project that failed to load. This should bring you to the configuration section for your web project.
Inside that should be a line beginning with "ProjectReferences", with a semicolon-separated list of projects.
If you CAREFULLY remove the offending project, which includes a GUID and the assembly name for the project, then save the solution file, you should be good to go.
Be sure to allow yourself a backup strategy in case something goes wrong.
I'm using Visual Studio 2008; I don't know if it works exactly the same way in other versions.

Related

Cannot rebuild ASP.NET Web Applicaiton missing solution file

I am taking over an ASP.NET Web Application using C# and all the code (including C# source) was given to me without the solution file (something.sln) so whenever opening the Web Application in Visual Studio 2017 I have to open by "Folder..." instead of by "Project/Solution...". Once open, I am able to make the necessary changes to the code behind files such as Default.aspx.cs or somethingElse.aspx.cs, but when I try to test the code changes by going to Run > Start Without Debugging, I couldn't find the Run menu option; I see the Build Solution button but it's disabled (greyed out).
Every time I try navigating directly to my site at http://dev.mydomain.com. The code changes I made did not get compiled neither.
So how do I get the Run or Build menu option enabled?
The easiest way to correct this issue is probably to create a new, empty ASP.NET WebForms project (and a new solution file as well if necessary) and copy your code files into it. You can then tell Visual Studio to "include" those files in the project.
You may (or may not) need to make the odd other minor adjustment too but those basic steps should get you started.
Not sure if this is related, but adding the sln file to the git ignore removed its visibility from VisualStudio. I had to open the project csproj file in VisualStudio.
THen on close, the prompt was asking me to save a new SLN file with the same solution name i was looking for. I was then able to go to the directory with the original solution in it, and then I was able to open it again in Visual Studio.
For all those who come to this post in the future, I would check your gitignore files and see if they ignored the sln file.

Can't upgrade from MVC2 to MVC3

I've got myself an MVC2 web applicatin using .NET Framework 4 and am following these instructions to the T. However at step 10 when I save the updated ProjectTypeGuids I get a message saying "The project file projectname.csproj cannot be opened. The project type is not supported by this installation."
I do have MVC3 installed and am running VS2010, so I don't know what could the going wrong. Anyone have any thoughts on the matter? Thanks!
EDIT:
For what it's worth. If I create a blank project from scratch, I have the ability to create a new MVC3 project. However, if I right click on my solution and click add->New Project... I can only add MVC2 projects. This leads me to think that the solution is configured somehow to only support MVC2, however I can't figure out how to change it.
There is an extra package which is ASP.NET MVC 3 Tools Update, you must download and install it too.
Solution 1:
Open the visual Studio Find In Files Dialog and Select your project folder, then search for old GUID and replace it with new one exactly. Backup the directory before doing this.
Actually You must select the whole solution folder and search all the files not a specific extension.
Solution 2:
You must take a careful look at your csproj and sln files and compare it with a working one on your system to find the difference. if you have file compare tools like winmerge, use it to compare files character by character

What is assembly EnvDTE 8.0.0.0?

I made a small console app in VS 2010 and I just published it and went to install it on another pc (Win XP Sp3). The installer made me update the .Net framework, which I did and then when i went to run th second part which actually installs the app I am getting the following modal box:
Unable to install or run the application. the application requires that assembly EnvDTE Version 8.0.0.0 be installed in the Global Assembly cache (GAC) first.
Please contact your system administrator.
What in the world is EnvDTE v8.0.0.0????
This is a tiny app which does a small web call to an api and returns the results. I do make a DB call for a select and and update using some generated code from Codesmith/Nettiers (including enterprise Library). These files are referenced in the app though already.
Any ideas how to fix or work around this?
EnvDTE.dll is, as Zabba said in his comment (not sure why he didn't answer with this) used to automate Visual Studio. For some reason, you have added a reference to this in your project.
Open your solution, look at the References node in all your solution projects, and delete any reference pointing to EnvDTE.
It doesn't normally magically appear in your reference list; you either have to add it, or the project template you used to create your project referenced it, or you added an item whose template added this reference.

recover project in visual studio 2010

i have 4 project in my solution, framework , domain objects,business objects and website ...
but this morning website project couldnt be loaded... when i tried firsttime to open solution... "The solution file has been modified outside the enviroment" message seemed and press reload then error is project file is corrupted... how can it happen... how can i fix this...
thx..
One way... if its from some source control , get the latest and leave the changed part by you.
If you dont have any source control then you can have the two options
- Create a new solution and add all your projects to it and rebuild it. Check for the errors.
- If your code is completely corrupted and files are unreadable, that is unrecoverable,
then you must have to follow this
copy the projects dlls out of bin
dir,
use red gate reflector and extract
all the class file in new project
file.
Now for aspx.cs you can create a new
project add all aspx file in that new project and also the
new cs files generated by the reflector addin. Do it for all pages. When done , right click on Project of web app(if its), then choose convert to web application. Also check the Page header of each page that they are using the same class files.
I know this is little bit tough , but will work....to recover almost that much code, when your app was last compiled.
Note : Also you will have to maintain the hierarchy of the project as the reflector add in (FileGenerator on Codeplex) might miss the actual project hierarchy.
You can open your solution file (.sln) in notepad and check for the consistency of the document.
The sln file will be in a hierarchical structure (like we have an xml).
You can also open csproj files of different projects that you have in the solution check the xml of the csproj.

What is a dll.refresh file in ASP.Net?

In our ASP.Net web project we seem to have some .refresh files associated with some of the 3rd party Dlls we're using. Any idea what they are and how/when they are created?
These files give the path to the DLL in question to tell Visual Studio where to find it (you can check this if you open them in a text editor). They will be created each time you add a new reference to the project.
They normally appear when you are using a project type that does not create a standard Visual Studio project file, as normally paths to referenced DLLs would go in there.
From here:
In an ASP.NET project, adding a file-based reference will add a .refresh file in the Bin folder. When the project is under source control, this file is then added to source control. *.dll.refresh files that litter the bin directory. Every time you add an external reference, you'll find a dll.refresh file right next to it. These dll.refresh files are an exception to the rule, and they should go into source control. Its the only way your web project will know where its references live.
Some information about the refresh files after trial and error. These experiments were done with Visual Studio 2012. The references were added to a C# asp.net web project.
As was discussed, adding a reference to an assembly through browse adds a .refresh file. However, if there are additional dependent DLL's on the explicitly added DLL in the directory that you add from, the dependents are implicitly added as well, but without .refresh files! So for example, I add a reference to "MyAssembly.dll" I will get also "MyAssembly.dll.refresh". But if there is an assembly "MyDependentAssembly.dll" that "MyAssembly.dll" depends on I will not get a "MyDependentAssembly.dll.refresh". So what happens is that the one assembly is refreshed but not its dependents! You must add the DLLs one at a time in reverse order of dependency and then things will work better.
Some other things to be careful of.
Adding "MyAssembly.dll" will also add "MyAssembly.pdb" if it is present. Also "MyAssembly.xml" will be added to the references if it is present. Those two files will refresh too when "MyAssembly.dll.refresh" is present.
But, when does Visual Studio decide to look for refresh files? Now remember, in a web project, the project file does not keep track of referenced DLL's specifically. You will not find the DLL's listed in the project file only project dependencies. So when does the refresh happen?
The answer to when refresh happens is during a build when the referenced assembly has to be loaded. That means, though that building a prebuilt updateable website may not grab all of the DLLs. I kept having a DLL that would not refresh and then I realized it was being used only inside of a .ascx file. Unchecking the "Allow precompiled site to be updateable" checkbox in the MSBuild Options project page fixed that problem for me.
Still if you add referenced DLLs that are loaded through reflection in your code, they will not be updated through a reference. You will have to use build events to copy them into the bin directory.

Resources