VS2010 - "Unable to connect to a database specified in the solution" - visual-studio-2010

Having migrated to Win 8.1, I am now getting this message box when building an existing project.
I cannot workout how to get rid of this box as I dont need this feature. Where is the setting that is making this box appear?
On build I get this message box.
Unable to connect to a database specified in the solution.
Do you want to modify this database connection properties?
I have inspected the SLN and PROJ files and cannot see the cause. In the solution it happens for some projects and cannot see a pattern as to why two projects that are similar where one is and one is not showing the box on build.

Edit the {Projectname}.csproj.user file.
Remove the xml element
<DatabaseConnection></DatabaseConnection>
Then either restart VS to reload the project.
Or
Unload and reload the project from within the VS IDE.
Since I was getting the box due to a dependant other project in the solution, it would be a good idea to do an inspection of all csproj.user files for the xml element.

Related

Visual Studio builds are reverting code to pre-correction states

So, new to .NET Core and going slow. Followed a standard tutorial for ASP.NET Core MVC app using Entity Framework to connect to MSSQLLocalDB - this went well.
Converted the application to connect to MySql, and went equally well,
Changed the name of a table on MySql to Interests from Interest, and after a bit of fiddling around this to was put to bed, that is it was working as expected.
Went to run the application today and I get:
There were Build Errors Would you like to continue and run the last successfull build.
Code has reverted to Interest, from Interests in several places in Obj files,
for instance "Create.cshtml.g.cs"
Corrected the code and went to run, the same build error pops up, and all corrections are undone.
I make the changes again, save the files, exit VS, reload, the changes are as they should be, run and it reverts all changes, failing again.
I thought this might be some sort of cache issue so deleted the obj folder, again corrected the entries, but again run the build and the corrections reverted!
I solved this issue on my machine by changing the cshtml file properties. Right click the chstml file in the Solution Explorer window, click on Properties in the context menu.Then in the Properties window, change the "Copy to Output Directory" to "Copy if newer". Then make sure "Build Action" is set to "Content".

Error message and empty list of build definitions in VS2012 after adding favorites

We have a bunch of build definitions available through TFS, and these were visible under Team Explorer - Builds in VS until a few minutes ago, when I tried to add a couple of them to "Favourites".
All I did was right click a build definition, and select "Add to favorites", then repeat the process for another build definition:
The result however, is a now empty list of build definitions - I can't seem to find any of them again. Furthermore, I get the following error message:
An item with the same key has already been added.
Any ideas how to fix this? Anyone know where the list of "favorites" is stored? (My reasoning is that if I can find and empty that list, then perhaps this issue would disapear?)
I ran into the same issue today. I was able to resolve it with the following steps.
Close Visual Studio
Open C:\Users[username]\AppData\Local\Microsoft\Team Foundation\4.0\FavoritesStore
Move the xml file from that folder to some other location
Start Visual Studio, open team explorer and navigate to Builds
At this point, the Builds pane opened without the error and "My Favorite Build Definitions" was empty
Moved the xml file back to its original location
Refresh the builds pane.
After refreshing, my favorite build definitions were back!
You may try (this helped to me with the same issue) to delete all the files in the following folder and restart VS2012 (Source):
C:\Users[USERNAME]\AppData\Local\Microsoft\Team Foundation\4.0\Cache
This issue occurred for me today when I had a mystery dialog open and it was blocking user input. I could not locate it or bring focus to it. I had to force a shutdown of VS, and after restarting my favorites were corrupt.
I found you can delete the cache for the favorites directly and restart the IDE. As soon as it launches you will see that VS will recreate the folder, and as soon as you add your first favorite a new favorites file will be created at that location.
C:\Users\\AppData\Local\Microsoft\Team Foundation\4.0\FavoritesStore
Writing an application or clearing the adjacent Cache folder are not necessary.
Favourites are stored in metadata on the user or group. You'll need to write an app to clear them.
http://geekswithblogs.net/TarunArora/archive/2012/10/18/tfs-api-add-favorites-programmatically.aspx

How can you change the default deployment properties?

Our BizTalk Server got renamed, but when we create a new project it still keeps defaulting to the previous server. I have been looking but I can't find anywhere to set these default values and update it.
edit:
Since it might be more clear if I add an image, I did.
Basically now when a new project is created the Server in the below screen is BizTalkDev_1. Can we change this to always be localhost when we create a new project? A hidden ini file somewhere?
When you go to visual studio project. Right click the project ...go to the property...and in the deployment part you can change the server name ...

Workflow Foundation: Designer is not working

When I try to open any activity in design mode designer fails with message "The document contains errors that must be fixed before the designer can be loaded. Reload the designer after you have fixed the errors". The project builds and runs fine though. This happens even with a fresh newly created solution. I mean that if I create a new workflow project and add a new item -> activity the problem persists.
If I click "Reload the designer" I get the following error: "Undefined CLR namespace. The 'clr-namespace' URI refers to a namespace 'System' that is not included in the assembly". If I build the project the error disappears but the designer doesn't start working.
I'm using VS2010 Premium. The only plugin installed is ReSharper. However I tried removing it but it didn't solve the problem. I've also asked a friend of mine to reproduce the same error on his computer but everything worked well.
The problem was that there are several types of editor for .xaml files. If you right click open with you can choose one of them. In my case WPF designer was selected by default though it's better to choose automatic selection.
Hope this information will be helpful for someone else :)

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