The Problem
If I have Visual Studio 2010, Service Pack 1 installed, and I go to Data, Add New Data Source and click Database, it brings up the standard Choose Your Data Connection wizard page.
On that page, if I have an existing connection configured, I can then select it, and add that data source to my project, no problems, no issues.
On the other hand, if I click New Connection... it just bombs out, wizard closes, as if I had done nothing. Now keep in mind, Visual Studio doesn't close, and there are no exceptions, errors, or warnings, the dialog window just disappears.
Unsuccessful Attempts to Resolve Issue
I've checked the simple things, using a debugger, and a valid machine config file, not sure what else I might be missing.
Using a Debugger
I tried starting a 2nd copy of Visual Studio as I did this, and
attaching a debugger to the process, with all exceptions checked in
my debug menu, and still nothing.
Validating machine.config file is valid
I backed up my machine.config file, and used another person's working machine's machine.config file, and I'm still having issues.
I have since reverted back to my own machine.config file.
I suspect the machine.config might be the issue, but I thought
taking a working one should work, unless I'm missing one of the
registered providers? I don't know enough about how this wizard
works behind the scenes though, or what sections/lines of the
machine.config file exactly drive the wizard.
Uninstalling all third-party database providers
I have recently tried uninstalling Oracle, SQLite, beta versions of SQL Server Compact Edition, and MySQL providers in hopes that one of them set a registry entry or configuration entry that was negatively impacting my ability to create new connections and the error still occurs.
Reinstalling Visual Studio
I reinstalled Visual Studio, complete uninstall, and reinstall, no extensions, or nothing, and the issue exists, definitely convinced its a configuration error at this point, I could use the expert opinion of someone who knows more about the configuration behind the scenes for this dialog though.
Any help in resolving the issue would be greatly appreciated.
Visual studio 2012 solution.
Close visual studio.
Open the event viewer, go to Application Log, and find Errors with source devenv.
Mine said
The following information was included with the event:
.NET Framework Data Provider for MySQL: An unexpected error occurred in the data provider.
Then i opened registry editor and went to:
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0_Config\DataProviders\
And deleted the key that reffered to the faulty data provider
{c6882346-e592-4da5-80ba-d2eadcda0359}
(default) = .NET Framework Data Provider for MySQL
I have the same issue. Delete all records in event viewwr and works.
Start -> run
Type "eventvwr"
Select application
Select "Action" > "Clear All Events" from menu
Save or not as you wish the events backup. Do the same with "System"
Try using Server Explorer window to add your Connection.
Try defining your Connection String from Settings.settings file
Try moving/deleting all the *.datasource files from the project/solution before adding the connection
Try creating a new, empty solution and see if the problem is solution-indepentent
Try finding out what registry keys and files Visual Studio uses when the issue occurs with Process Monitor from Sysinternals
I have had the same issue today.
Solved it by removing a tag in machine.config file:
**32-bit**
%windir%\Microsoft.NET\Framework\[version]\config\machine.config
**64-bit**
%windir%\Microsoft.NET\Framework64\[version]\config\machine.config
Tag to remove:
<DbProviderFactories/>
The problem is that when the dataset is modified, the dataset is linked to the bi object. I solved the problem like this: I made a change and registered the dataset and it came up an error. I then undo it with CTRL + Z, the error is resolved. Then I moved forward with CTRL + Y, and the error went away. Thanks to this solution, I added the query, added a new table.
Related
I just took over a project that is using a VS Database project and I am hitting an early road block. There is a file localhost.publish.xml that I am assuming will build the local database (is that correct)? When I click Generate Script I am getting the error "Unable to connect to the target server" and everything I have read online talks about installing the Data Tools which I did and it isn't helping. It has been a few years since I have even opened Visual Studio so I know I am just missing the obvious, but I cant find documentation anywhere that is giving me a clue about what I am missing. I havent included any of the code because at this point I am not even sure what would be helpful to anyone.
When you double-click localhost.publish.xml and it opens the Publish Database dialog, take a close look at the Target Database Connection. Make sure this is the database where you plan to run the SQL script and that this is a valid server you can connect to. Click the Edit button to change it. Your problem is either a) this is not a valid server, or b) you can't connect to this server from your computer (different network, firewall rules, etc).
The reason Visual Studio needs to connect to the database in order to generate the script is that it needs to determine if the script should contain CREATE or ALTER statements for your db objects based on whether or not they already exist.
The error reads,
TargetFrameworkMoniker: An error occurred saving the project file
'yadayada.csproj'. Access is denied.
I'm trying to switch from .net 3.5 to .net 4.0 or higher.
The project is hooked into TFS in Visual Studio 2010 (also tried VS 2013, same error). I'm in a VM environment.
Any clues about this error? Google returns very little information. It seems like I have proper access to the file, but how is VS accessing it?
It sounds like either:
1)The file has been marked read only. Check this by viewing the properties of the csproj.
Or
2)Your user does not has sufficient permissions to change the file - check security on the csproj.
I have found that if you get the error, hit save, close visual studio and reopen the project you will find that 86.5% of the time the setting was changed.
Try running the Visual Studio in administrator mode and also check if your project folder is set to read only.
Deleting everything in bin file of the starting project did it for me.
I got this error in my environment, which is straight VS 2013 Pro: no TFS and no VM. Unsetting the read-only box only changed the dialog display because reinvoking the dialog still showed read-only. I thought I changed the ownership of the project file to me by virtue of changing the ownership in a higher level directory and checking "Replace all child object permission entries with inheritable permission entries from this object." Of course the project file and everything else had inheritance turned off. Once that was corrected I was able to save things without being Administrator.
I was getting this error and it ended up being the app.config file, as well, that was write-protected. Changing the target framework not only changed
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
in the .csproj file but also changed the project's app.config:
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
(I wanted to add this as a comment to pixelmeow's Jun 27 answer, but StackOverflow policy prevents me from doing so until I have enough reputation points. I did vote for him/her, though!)
I was getting this error and it ended up being the app.config file that was write-protected. Once I cleared the read-only property, everything worked fine.
I was getting this error in visual studio 2010 because of my start action setting. Each time I would hit debug, I think the browser window was trying to launch too fast (this is an ASP.NET MVC 4 with intranet settings project).. and I would randomly, sometimes consistently get access denied. So I changed the start action to: "Don't open a page. Wait for a request from external application."
And this seemed to fix the issue. You will just have to access the web application manually rather than VS launching the browser for you. You can click on the running server icon (bottom right of taskbar) and access the link from there if you don't remember it or your browser didn't store it as a history url for whatever reason.
I just encountered this error message in my Visual Studio 2022 Solution after updating to Version 17.1.5. I managed it to run again by closing VS and deleting/renaming the bin and obj folder. Restarting VS and the debug session ran without trouble.
This question is NOT answered at the link above...
I had some problems with TFS where visual studio builds on the local machine no problem, but when I try to build on the server I get build errors. The errors are not relevant to this question.
The issue I have is that in order to fix the errors I had to manually edit some of the files on my local machine, and since they were manually edited, TFS doesn't detect the change so it wont let me upload my change set to the server which would have fixed the problems there.
My first, and main question is:
How can I force TFS to copy all my local files to the server. Sort of like the reverse of the whole:
Goto View / Other Windows / Source Control Explorer / Right click on the relevant project / Advanced / Get specific version / Check "Overwrite all files..." / Press ok.
Which (arguably, cause it doesn't always get everything in my experience) gets a full file set from the server to the local machine.
I am so tired of TFS uploading partial file sets and then when the solution is removed locally, and then re downloaded from the server, I have to pull in the missing files and references from some backup. If it was uploaded fully, and correctly at the start, I would probably have less of these problems. So this is my main question. How do I force TFS to upload all my files regardless if they have changed or not according to it.
To explain further a problem I am having in particular with nuget package manager. I disabled the option "Allow NuGet to download missing packages during build". So locally I got actual build errors. Yes that's right, Build errors. like this...
Project XXX: Package restore is disabled by default. To give consent,
open the Visual Studio Options dialog, click on Package Manager node
and check 'Allow NuGet to download missing packages during build.' You
can also give consent by setting the environment variable
'EnableNuGetPackageRestore' to 'true'.
Which now forces me to re-enable this option to get rid of the errors. I am annoyed at this because such errors should be presented as warnings so as not to prevent a build. This is seriously disappointing and as a result I have a very poor opinion of NuGet.
Anyways enough ranting, I re-enabled this, not like I had a choice. But the version where this was disabled went up to the server. Now I get this error on the server. I tried re-enabling it and doing a check in, but TFS wont let me. (Warning...No pending changes). Of course not, its just a silly check box. What could possibly have changed. But now I get an error on the server that I cannot fix all because someone at NuGet didn't put some taught into properly designing their warnings (as opposed to preventing a build by causing errors).
So, once again, how can I force TFS to take all my files, changed or unchanged, verbatim, to the server. This way, when I fix a problem locally, it "should" fix it also on the server. Or at least, when I next download it, I am assured to have the whole file set.
Apologies if this sounds like I am being negative, but I am at this for 5 solid days and it has completely stopped development costing me and the company a lot of money. Any help would be very much appreciated.
There is no way to tell TFS to take everything in my file system. What you need to do is a multistep process. First Check Out the entire directory, this will not overwrite your manual changes but will allow you to check back in and have it detect those changes. Second, if any new files were created you need to add at the root directory and get all new adds. Lastly check in all of your changes. It really should be that simple.
If you are using TFS 2012, then Local Workspaces would be a good solution for you.
Just to be clear - Local Workspaces does not mean that your developers are working locally. All code is still under Source Control in exactly the same way with Server Workspaces.
Local Workspaces are new to TFS 2012 and would resolve your issue. The main advantage for you is that files are no longer marked read-only. This allows you to be able to edit them from anywhere (notepad, any other IDE, Visual Studio) without first doing a checkout. Visual Studio will then automatically detect that the file has changed and list it in the Pending Changes window.
Good article comparing the different types of workspaces: http://blogs.msdn.com/b/willy-peter_schaub/archive/2011/11/30/team-foundation-server-trying-to-understand-server-versus-local-workspaces.aspx
I like to use the Source Control Explorer window, then right click on a folder and choose Compare. You can choose to see what is different in the target folder, or what is a new file. The files that are different appear in red. You can then right click on them and check out and check in files, or use control-click to select more than one file at time.
Yes i know before the flames start to arise, this is not conventional....but working in unity I encounter this problem quite often. Literally dealing with it now as i updated to unity 5.5 and it fubared a lot of stuff in my current project. After the resolutions from unity, my project is completely out of sync... and for whatever reason vis stu refuses to monitor these changes... It is rather annoying to be sure, but not to worry as I have resolved it successfully every time over the iterations by doing the following:
create a backup folder in a separate location and copy the entire thing over.
It doesn't matter where you back up to as long as its in a unique separate folder. Be sure to copy FOLDERS not individual FILES as some files may be hidden.
do a full get of the latest version (according to TFS).
This can take some time and is why you back it up in a separate location. Be sure to KEEP VS OPEN AT THIS POINT!!!
overwrite ALL the files you "got" with the backup that you made in step 1.
The local work-space will monitor the changes to the files as you overwrite them with the backed up copy into your local space, and mark them as having pending changes accordingly if the new one has any difference.
update your pending changes to the TFS server in source control explorer. Any change detected during the overwrite will be added to the included changes section.
Voila you have forced your files, work, and will onto the TFS server!
Designer file is locked and when go to project properties it gives this error.
An error occurred trying to load the project properties window. Close the window and try again. The CurrentContext property of the LicenseManager is currently locked and cannot be changed.
.net framework 3.5
VS 2008
Just a random suggestion:
Close VS, then try deleting any .suo or .csproj.user files. These store per user settings like which files you have open etc, and can sometimes get corrupted. (maybe back them up first just in case)
See following
http://social.msdn.microsoft.com/Forums/en-US/winformsdesigner/thread/b3bf3b31-85ac-4073-be2b-2f061b240e63
Some of the resources that you use in your project are compiled with different versions of
the .net framework.
Right click on your project, choose properties and change Target framework to the framework
that the resources are compiled with, or remove those resources and continue.
I agree with Simon.. I was getting this error and could not resolve this.. I removed all unused references from mysoftware properties under project menu and then i removed the unused data base. it resolved my problem. i m sure it will work for you.
Sometimes some corrupted files causes this problem although you never applied and sort of licensing to your software.
njoy..
SandeepV
Adobe Certified Expert
Microsoft Certified IT Professional
This occurs when the designer codes hits a while true Application.DoEvents infinite loop in a button/dropdown/control constructor.
You can see VS.net taking up one cpu core completely and you can debug this pretty easily with another Visual Studio instance.
If you get this error on opening a form design ( not the xml type), you can close the form, open project property, select build tab, click on .net framework version and you can choose the same version again,
close the project property, open th eform again. that's how I got rid of the error,
closing visual studio and re-opening the project did not help me
I'm working on a moderately sized WebForms project. Due to the peculiarities of management here, I have to upload the site to a remote server in order to test (no localhost testing). I'm using the 'Publish' command in Visual Studio 2008. Sometimes, it even works. Most of the time, I inexplicably get a "publish failed" in the bottom left corner, with no further details.
The few googled articles/forum posts I read suggested making the target local folder for the publish operation readable/writable for everyone. Doesn't help.
Is there are way to get further details as to WHY a publish fails in VS2008, and if not, is there a better way of doing these deployments? I'm spending more time building/pushing to the web server than actually debugging.
It's worth checking the output window. I've just had a publish fail because I had deleted an image outside of VS so VS was complaining that the image couldn't be found, but this information was only displayed in the output window.
See this link for more information:
http://ericfickes.com/2009/08/find-out-why-visual-studios-publish-fails/
It happens to us when there is an error in markup (!). Bad thing is that VS will just swallow the error and just tell you Failed.
What I suggest is to run your publish from command line using MSBuild. It's not that straightforward but it works (once you get into it).
I've since discovered that the reason for these particular publish failures was due the "Delete Existing Files" option being checked. Using Visual Studio 2008 under a non-administrative account on Windows Vista could cause a permissions error while attempting to delete the existing files. The publish would fail silently after encountering a file that Visual Studio had insufficient access to delete. Once the files were deleted manually outside of Vidual Studio, the publish functioned normally.
I have not had this issue with Windows 7; I assume the UAC changes in Windows 7 fixed the problem.
I mostly work with Web Forms, and I encounter this problem daily.
It seems to me that publish fails when it fails to delete a file it is trying to replace. Even if I don't have any files open, it still fails sometimes. Not sure why.
Not only VS publish fails very often, it is painfully slow as well.
I just publish to empty local directory and use separate FTP client to upload files. It's more work, but works.
This is probably not the case for you, but I've seen this happen when I'm publishing a web site. If the app_offline.htm file is not excluded from your project (if you use this file), the publish will fail.
Same happened to me.. what I did was include images files that was not included in the project and delete images that were not used.
After struggling with a similar issue for about 30 mins with no clue as to what was causing it closed down VS and reopened my project. Started working fine. No idea why but it worked.
You should always stop the IIS instance running on the machine your are publishing to. Google the word "iisreset". Other hosting providers like DiscountAsp and Arvixe offer you tools to "Stop" and "Start" your app pool on their IIS remotely. This is very necessary because IIS may have locked some files as "in use", so your publish fails when it tries to write over them. When your publish is complete, then just restart IIS (or press "Start" from a web tool if you're using a 3rd party hosting provider).
When all else fails, check your "Output" window (the tab to the right of your "Error List" at the bottom of Visual Studio). Scroll through all of it after a failed publish and look for anything that says "Unable to add". If you keep seeing the same "Unable to add" errors on the same publish, then ftp into the folder, delete the the problematic files manually, and try publishing again.
I got this when my ProjectName.Publish.xml file was read-only. Once I checked the file out of source control, I no longer got the error and could publish.
Just to add to this thread, I found that, for some bizarre reason, only the Mercurial files were being published to the server, everything else just wasn't being copied across.
Another strange thing was that only the Debug configuration was available; Release was nowhere to be seen.
After reading other threads around S.O., I found that there were many for VS 2010 and 2012, but not much to cover the same problem with 2008.
The fix, I found, was to delete the [solution].suo file and then attempt a publish. That seemed to do the job, though it took a long time to complete.
What I found and work in my case. It is to use a different version of VS.
I recently had the problem, the solution works perfectly in VS2015 build, compile and tested.
However, when I try to publish was failing silently.
So, I closed the solution and open it with VS2017 that use the same file structure for the projects/solutions. Then rebuild it and publish without any problems.
I believe it could be VS related and it is complicated to debug.
This is a workaround if you work with multiple Vs instances in your local machine.