Entity Framework + Team Foundation Server - edmx error - visual-studio-2010

When I try to update the existing edmx Model while connected to TFS i receive an error:
"XmlModels involved in this transasction are not editable".
What's even worse, is that when I try to generate a new model, Visual Studio just crashes out.
It happens only when I'm working online on a project, being connected to team foundation server.
So far the only solution I've found was to edit .edmx file using text editor...
Thanks in advance for any responses.

From: http://connect.microsoft.com/VisualStudio/feedback/details/299134/vs2008-beta2-ado-net-entity-data-model-and-wpf-app-issues
Please make a copy of your edmx file before you attempt this action.!
For ADO.NET: Duplicate InheritanceConnectors and/or AssociationConnector seems to be the problem, so deleting everything in the edmx:Diagram tag except entitytypeshape fixes the problem when you save and open again.
Other people indicate that closing and re-opening the solution or rebinding to the source control system completely could have a positive effect.

Related

Discrepancy in solution file

we have recently updated VS/TFS within our team and everytime I open VS now, following warning message appears:
"There appears to be a discrepancy between the solution's source
control information about some project(s) and the information in the
project file(s)"
When I do check-in, I get a change in .sln file for
SccTeamFoundationServer = http://czphaptfs01:8080/tfs
instead of
SccTeamFoundationServer = http://czphaptfs01:8080/tfs/defaultcollection.
I've tried to fix the file manully via Notepad but again, everytime I try to check-in something, the .sln is overwritten back. That leads me to a conclusion there might be possible something wrong set in VS, however when I double check TFS Team Connection in Manager Connection, everything appears fine.
Any help would be greatly appreciated.
Thanks in advance.
I've resolved the issue by reconnecting to the project in Team Explorer.

P4VS Source Control Binding Error On Startup

I'm developing a C# solution in Visual Studio 2013 under Perforce source control (P4VS plug-in). When I first load Visual Studio I can perform a connection to my perforce depot no problem. Then I select "Choose Solution/Project in Perforce Depot" to open my project...
This is where the fun starts. In the P4 file chooser window I can see my Depot (good) and I can navigate its directories (also good). However when I expand any of the directories I receive an error the Perforce Source Control output window. Say for example I expand the Depot root directory, I receive the following (error) message:
E_WARN: //depot/* - file(s) not in client view
And so on for every directory I expand.
Now there's even more fun when I open my solution file, I get the dreaded "Source Control - Unable to Access Database" warning dialog. It contains the following:
The associate source control plug-in is not installed or could not be initialized.
Temporarily work uncontrolled - Microsoft Visual Studio will attempt to reconnect the solution or project to source control after closing and reopening the solution
Work offline in disconnected mode (greyed out... I won't go into the detail)
Permanently remove source control association bindings
I select "Temporarily work uncontrolled" and the solution is loaded outside of Perforce source control. Not good.
Now in order to open the solution under source control I have to go to Tools -> Options -> Source Control and re-select P4VS as my source control plug-in and then reopen the same solution that I have open outside of source control. This works fine and I now have the solution open under Perforce Source Control.
My guess is this has SOMETHING to do with the source control bindings, however I haven't the slightest clue how to handle such a problem. As always all help is appreciated!
Sorry you ran into challenges. Often times the error:
E_WARN: //depot/* - file(s) not in client view
points to an issue with the client workspace configuration ('View' file map field) needing to be modified. Not enough details to know for sure if this is your exact issue with the Perforce client that is being used to manage the Visual Studio project. See 'Refining workspace views' under Configuring P4 in the Perforce User Guide.
In terms of bindings: Not sure if you used a previous source control, but if a project was used with another plugin (even P4SCC) you must first remove those source control bindings.
For reference, here are some step-by-step docs on using P4VS with Visual Studio with new or existing projects:
http://answers.perforce.com/articles/KB_Article/Create-New-VS-2010-Project-in-Perforce-using-P4VS
http://answers.perforce.com/articles/KB_Article/Add-VS-2010-Project-to-Perforce-using-P4VS
I hope this has been somewhat helpful. Perforce Support support#perforce.com can further assist you as well.
I'm still not sure as to why the
source control plug-in not installed or could not initialize
warning appears, however I've figured out the
E_WARN: //depot/* - file(s) not in client view
messages. It's due to some voids in my workspace mapping. My depot is under this structure...
//depot/sub/sub2/sub3/project_folder
whereas my workspace is configured as follows...
//workspace/project_folder
thus every time I navigated in visual studio through the perforce depot, looking for the project to open, any depot directories that didn't have a matching workspace directory posted this warning.
Makes sense, the files I was viewing in the depot were "not in client view", client being my client side P4V.
Hope this helps clarify part-way for anyone having a similar problem.

How to solve Intellisense not working in VS 2010

I am opening files from a server ASP.net and the VB codebehind files, and my visual studio is not working correctly, Intellisense is dead and if i right click the "Go to defenition" option is disabled. These files are not part of a solution.
This is strange though because it was working properly yesterday. If I create a new project the intellisense works great, yet opening this single file it fails.
I have tried to re enable intellisense by resetting visual studio, I tried editing the text editor settings so that Auto list members and Parameter information are both checked. I even tried installing ReSharper and nothing worked. I have rebooted twice and even tried copying the file to a local drive to work on yet nothing.
Does anyone know why this is happening and what I could do to solve the problem? Im working on a rather complex problem and intellisense would make it a lot easier.
I managed to fix this problem which manifested itself after my ReSharper trial expired.
Steps to fix are:
Tools/Import and Export Settings
Reset all settings
Back up your config
Select your environment settings and finish
Intellisense started working again straight away.
For me simply hitting Ctrl+Alt+Space to re-enable Autocompletion fixed it.
I had the same problem. It only affected one of my solutions. Others seemed fine.
To correct it I deleted the solution's user options file (.suo).
When I opened the solution again, intellisense was working.
For the benefit of searchers, Nicks suggestion is good, but if you don't want to reset all your settings, you could follow the recommendation in this post.
It states - "go to "Tools | Options | Text Editor | C# | General and check the "Auto list members" and "Parameter information" checkboxes"
I should first note that upgrading my RAM from 4 to 16GB seems to have made this issue go away.
Here's the steps I go through:
If only one file/window appears to be affected, close/reopen that file. If that doesn't work, try below.
In Visual Studio:
Click Tools->Options->Text Editor->All Languages->General
Uncheck "Auto list members"
Uncheck "Parameter information"
Check "Auto list members" (yes, the one you just unchecked)
Check "Parameter information" (again, the one you just unchecked)
Click OK
If this doesn't work, here's a few more steps to try:
Close all VS documents and reopen
If still not working, close/reopen solution
If still not working, restart VS.
For C++ projects:
MSDN has a few things to try: MSDN suggestions
The corrupt .ncb file seems a likely culprit.
From MSDN:
Close the solution.
Delete the .ncb file.
Reopen the solution. (This creates a new .ncb file.)
Sometimes, it could be because of different extension style that you are using for the files.
In my case Intellisense is working in all the files except for a file in a different project of the same solution.
When I have changed the extension of the file to cxx from cpp,it started working.
The includes and other files in the solution are of extension .cxx or .txx.
Thank you
Save your solution. Closing the VS2010 instance for this solution and re-oprning worked for me.
Here I assume that Intellisense was working OK but stopped for some unknown reason without changing any default settings.
Prabhdeep
After uninstalling ReSharper, the squigglies that show up underneath a syntax error stopped showing up in the code editor.
This blog post helped me fix the issue.
Try this:
Close any open instances of visual studio, delete the folder 10.0 inside `C:\Users[username]\AppData\Roaming\Microsoft\VisualStudio\' and restart the visual studio. Issue will be fixed.
In my case, none of the above worked (although I discovered that sometimes the *.suo file is the trouble maker - in those cases deleting it helps).
I fixed it successfully the following way: Let's assume your solution has the name MySolution. Do the following:
Reset the settings (as described here). Close Visual Studio 2012.
Locate the file MySolution.sln.DotSettings (it is in the same folder as your MySolution.sln file)
Rename or delete it (for example rename it to XMySolution.sln.DotSettingsX so VS won't read it)
Open your solution by double-clicking on the MySolution.sln file
And afterwards Intellisense was working again just fine. I assume the file MySolution.sln.DotSettings got corrupted.
Note: The file MySolution.sln.DotSettings was created and checked in to TFS by a team colleague who had installed ReSharper. The issue occurred on a different PC without ReSharper where the same project was opened.
For me, this was related to an incorrect xaml file build action in an Azure WorkerRole project (bizarre, though it may seem!). Please see my entry in this post if you want to know more:
C# VS2010 Entering break mode failed
The fix for the error in the above thread also resulted in the intellisense starting to work again.
I fixed this problem by removing Sybase Power Designer VS extension.
You can try to disable other extensions.
Exactly the same issue, though would appear only on certain projects (even within a single solution).
Removing the *.*proj.user file (e.g. *.csproj.user) for the projects in question properly reset the missing features ("Go To Definition", "Organize Usings", Intellisense on certain types, etc).
In our case, I suspect this happens sometimes when we switch branches with an SCM that uses a single working directory (like git). If setup properly, it wouldn't track *.user* files but that means that if there are incompatible changes in it across different branches, you need to regenerate it.
So of course the "sometimes" would depend on the current branch and the next branch.
Unfortunately I don't see a very good solution if that's the case. Sometimes you really want to keep the user settings across branches if they're compatible, sometimes you want to regenerate them unconditionally. Ideally, you might even want to only change parts of them when switching, while keeping other parts.
If you never need to keep them and are fine with regenerating them every time, then you can configure your SCM to always remove these files while switching branches (e.g. using hooks for git). This is a pretty naive solution however, doing it more universally correctly would require a smarter system (aware of the semantics behind the .user files and capable of capturing/prompting user intent when needed).
save, close and reopen the source file you are working on. This works every time for me.
Try to add the statement:
<%# Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb" Inherits="IP_Updater.Default" %>
...at beginning of your page. The above example is applied for page Default.aspx written in VB.NET.
This is the problem related to Microsoft MSDN , your MSDN might be getting some problem. The solutions to this is uninstall MSDN and then re-install . before going for this make sure that you system is free from virus attack.
Hope that after doing , the Microsoft Intellisense will start running

Visual Studio loses bindings to TFS suddenly

Why would my VS solution lose its TFS bindings suddenly? I have been working on a project for six months and this never happened. As soon as I opened a VS project/solution, I could check in/out, view history by right clicking on any given file. But suddenly, I dont see those options to checkin checkout etc any more when I right click on a file in VS studio solution explorer.
The team explorer window still brings up the source folder structure and I can get latest or get specific from there but did any one see this kind of behavior? Please let me know what I can do to avoid these situations in future.
Did you lose connection to the TFS server any time recently? I've had this happen in the past on unreliable network connections when working via TFS remotely. The solution and all projects therein would "go offline" and would appear to lose their bindings. This made it particularly unintuitive when the connection was re-established because changes made while "offline" weren't always found.
If you right-click on the solution or the projects, is there an option to "go online"? You might check the various menus for such an option as well.
Did you move the source files to a different location on your harddrive, or change your workspace mappings?
Try opening the solution/project by double-clicking the .sln file in Source Control Explorer instead of opening it from windows explorer.
You can also try bringing up the Bindings dialog by going File -> Source Control -> Change Source Control
I recently had a very similar experience. I had made several changes which I thought may have influenced my connection resilience. After reversing out of 2 of them and the problem persisted, I finally clocked what it was.
One of the new extensions I am using is NuGet (http://nuget.codeplex.com/). Every time I attempt to add a library my TFS connection fails and is unrecoverable till a restart of VS 2010.
See: http://nuget.codeplex.com/workitem/725
There is a work around that has been reported and working which may help you even if this is not your problem.
see http://blog.rthand.com/post/2011/08/26/Fixing-combination-of-NuGet-and-Team-Foundation-in-workgroup-configuration-401-Unauthorized.aspx
Happened to me also. I was removing a whole bunch of mappings for old releases under the local workspace. It was taking over 40 minutes so I killed it. The mapping has been removed to the older branches but the branch left behind had been disconnected from TFS.

generation of designer file failed

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.

Resources