I have created a class diagram in visula studio 2010 and saved it on the desktop with a .cd extension. After restarting my system, when I try opening the file once again, I get this error... "Cannot open file. Class diagrams can only be added to projects that contain source code".
I tried opening the project associated with it but since I hadn't written the source code before I restarted the system, everytime I open the .cd extension Class Diagram, I'm not able to view the diagram I created but rather I get to see a diagram without any associations, methods, or attributes.
I tried googling it but couldn't get a satisfactory solution. Please help me to view the document as how I have created it. I need to include this diagram in a document.
Related
I don't understand how it works. I'm new to Team Foundation Server and currently I have a small team. The co-worker can open my project file and run just fine (by double clicking the solution file right in the source control explorer window).
I can open my project file the same way but cannot open his project file. Clicking the solution file does load the solution but the files in there cannot be opened. It says something like this:
Cannot find the file "d:\....". It may have been moved or deleted.
The path "d:...." is actually the path on his machine. While in my machine it's mapped to a different path. But I don't understand why it cannot recognize it.
At first I thought the mapped path structure should be the same across all members' machines but if so my co-worker could have not opened my project file.
The status of the solution is Yes for Latest, meaning the files are loaded and copied to my local folder normally. Not sure if it matters but I'm using Visual Studio 2015 and my co-worker uses Visual Studio 2013.
I've tried searching around but could not find anything with the error message. It's so interesting that my co-worker does not have to do something special or self-aware so that he could tell me something to solve this. I hope you have some experience on this and give me some helpful suggestion. Thank you!
Edit:
To clarify it more, if I browse the file directly inside the source control explorer window, the file can be opened (but if it such as is some designer-supported file like .xaml - the designer then is not shown up). What I'm having trouble with is opening the file loaded in the solution (inside the Solution Explorer window). As I said clicking the solution file in Source Control Explorer window does load the solution, but because there is something wrong with the files path, I cannot open them as well as build and run the solution.
Right-clicking on the file in the loaded solution, select Properties, I can see that the Full Path is actually the path on his machine, so weird.
It sounds like your workspace is all messed up. Are you trying to share a workspace?
If so you should not. Each developer should have their own workspace local to their computer that is unique to them.
Try creating a new workspace and using that...
As of yesterday, my vbp file refuses to open '.vbp could not be loaded'. If i try to open the individual forms, some of them work (open in vb6), some of them produce error .log file with two class errors : Class TabDlg.SSTab of control mstTabArticles was not a loaded control class. Line 3672: Class MSComCtl2.DTPicker of control dtpTicketDate was not a loaded control class.
I cannot open the vbp in notepad neither (=empty) and in wordpad i only get small squares...
Any help please?
Your .vbp file is corrupt. You will either need to restore from your backup or source control (you do have both of those don't you?).
Failing that, you will need to recreate the project file from scratch and readd each of the forms. You'll need to figure out what controls and references were loaded though.
As for the errors when loading the form files, this is normal as the controls have not been added to the project.
One other possibility is to open your file with a hex editor. You may be able to rescue a good deal of the text from the corrupt file and copy it to a new one.
How do I associate/"bind" an resx file to a class file in Visual Studio?
For example, when a new windows form is created, an resx file is automatically associated with it.
I am asking this as the following code doesn't open the right resource file for another .cs file I have:
ComponentResourceManager manager = new ComponentResourceManager(typeof(MyClass));
This code works fine for frmLogin from above however.
The MSDN documentation for the constructor:
Creates a ComponentResourceManager
that looks up resources in satellite
assemblies based on information from
the specified Type.
That a form has an associated .resx file is an implementation detail that's specific to forms. You cannot otherwise associate an arbitrary class with a .resx file. I assume that you actually want to use a ResourceManager here.
Do note that there's one already built-in through Properties.Resources, giving you access to resources that you added to Project + Properties, Resources tab.
Should you have lost this indenting by adding existing files to a project, you can restore the indenting for files, though I have not tried it for all file types, by using the 'DependentUpon' node in the project file.
The technique is described in more detail at Code rant: Nested files with 'DependentUpon' in Visual Studio
I found an existing answer on SO since discovering the article above, but as the question is formulated so differently I'm keeping this answer in place.
When exporting a Visual Studio project to a Template (File/Export Template...) I get the following error upon clicking the Finish button:
Unable to read an exported file for the following
reason: The file cannot be opened with the selected
editor. Please choose another editor.
Screenshot http://img687.yfrog.com/img687/1756/templateerror.png
A Google search for this error has only led to several dead ends. There aren't any unusual file types in this project. Any ideas what could be going on?
By laborious trial and error (start with an empty project, add a folder, try to export template) I was able to narrow this down to a single Javascript file. As it happens, it's one of the language definitions for prettify.js (which is used on this site for code coloring). The file in question is lang-hs.js, and for some reason Windows on my machine treats this file differently from other Javascript files: It opens in Notepad, when I have the .js extension mapped to Visual Studio.
I'm not sure what the underlying explanation is, but I've already wasted enough time on this and I believe I can live without Haskell code coloring (!) so I'm just deleting this file and moving on.
It seems ".cur" files are often a culprit in this error. I have removed them from my project and now the exportation works correctly.
Microsoft staff suggest looking at log files (../windows/system32/compmgmt.msc) but this error does not spawn an entry into the Application EventLog.
Every few days VS2008 decides to get mad at me and fails to generate a designer file claiming it cannot find the file specified and that it's missing an assembly. Here's the scenario:
The aspx page has a reference to a custom user control (inheriting UserControl) which references another assembly in the backend. There are many other references to this "missing" assembly in other places in code which don't throw errors. rebuilding, updating the source to the clean copy, shouting at the computer, punching the screen, etc all fail to work.
Any suggestions? This is quite annoying.
We've had similar problems before, unfortunately I don't remember the exact solution.
If your using a "Web Site" project (no project file) then start by checking that both your page and your control both set the ClassName property in the first line of your aspx/ascx file and that you specify the full name of the class including the namespace.
Example:
<#Control Language="VB" AutoEventWireup="false"
ClassName="YourProjectName.YourUserControl"
Inherits="YourProjectName.YourUserControl"
CodeFile="YourUserControl.ascx.vb"
%>
Many times not setting all of these will still work but you will get odd compiler errors and behavior in VS.
If you using a Web Site Application project try deleting the designer file manually and then right click on your project and choose "Convert from Web Application." This will should recreate the designer file for you.
My only other suggestion would be to recreate the page and/or the user control from scratch.
Jared, you've hit it. Using "Convert to Web Application" to manually generate the designer file solves my problem. I'm glad you posted this before i started reinstalling. Thanks.
You might try archiving a template of a new file with its designer equivalent. If VS coughs then you can do an "Add Existing" option with the file you already have.
It seems, however, to be an issue with your installation of VS2008 so you might try reinstalling it.
I found that using a custom control, you would need to add a reference to the .dll. This fixed it for me after migrating from a web site to web app.