Visual Studio 2010 "Setup Project" registry editor doesn't work - installation

I have an installation project that needs to add 1 simple string to the registry, and the built in Registry Editor in the Setup Project doesn't seem to work at all. It puts a base key HKEY_LOCAL_MACHINE\Software\[Manufacturer] by default into the install project, and that doesn't even work.
Here are the steps I used to add the key.
Right click setup project: View --> Registry
A mock Registry is displayed and I drill down creating keys as needed.
I create HKEY_LOCAL_MACHINE\Software\[Manufacturer]\[ProductName]
Run the installer. No errors are reported, but keys do NOT exist.
EDIT: Take a look at figure 5 on this webpage. It shows you kinda of what I see except in what looks like a much older version of visual studio.
I don't see how this could fail, it should be so simple. I've even tried simple keys and it just won't create anything, or at least throw an error. I've seen this solution but its ridiculous to add a post build step to manually edit the registry when there is built in functionality to do it. That post indicates that the feature is just broken, so don't use it.

If you have a 32-bit installer the keys will be redirected under HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ key
More details you can find here: http://msdn.microsoft.com/en-us/library/windows/desktop/aa384232(v=vs.85).aspx

Related

Remove Temporary key C# Windows 8 App

How do I Remove a Temporary key in a C# Windows 8 App? I downloaded a template that has one and got the error it expired. Do I need to put in a key of my own? I'm sure the author wont care its just the C# Windows Store Grid App XAML) Template that visual studios ultimate 2013 provides. The author just added a background image to show people how to do that. I removed his image and put in my own.
I'm a total noob at coding this is my first time using visual studios. All I understand atm is web design and adding snippets and changing values of code as well as compiling it.
I like to open, open source code to learn from it and see how it works.
Within your solution, double-click on the "Package.appxmanifest" file. This should open up the "App Manifest Designer". Go to the Packaging tab. Click on the button labeled "Choose Certificate..." and choose a new certificate. Chances are you want "Create test certificate...". You don't need a password. Hit OK and you should be good to go.
If you're looking to sideload the app onto other machines at your workplace or upload the app to the app store, you've got quite a bit of other work to do -- but that is I think outside the scope of this question.

How do I get my solution in Visual Studio back online in TFS?

I had my solution in Visual Studio 2012 (which is under TFS source control) open and the TFS server (2010) was down. When I then made a change to one of the files and attempted to save it I got a prompt to ask whether I wanted to Overwrite the file saying the TFS server was down (can't remember the exact words) and the following message appeared in the Output window:
This solution is offline. [Team Foundation Server: http://tfs1:8080/tfs/server]
The solution was offline during its previous session and will remain offline.
How do I get the file change to be recognised as being among Pending Changes and the whole solution back online?
I searched for the solution online and found this solution but wasn't too keen on the registry change.
I found a better way: right-click on the solution name right at the top of the Solution Explorer and select the Go Online option. Clicking this allowed me to select the files that had been changed when I was offline and make the solution online again.
After finding the solution, I found the following msdn forum thread which confirmed the above.
Go to File > Source Control > Go Online, select the files you changed, and finish the process.
Rename the solution's corresponding .SUO file. The SUO file contains the TFS status (online/offline), amongst a host of other goodies.
Do this only if the "right-click on the solution name right at the top of the Solution Explorer and select the Go Online option" fails (because e.g. you installed VS2015 preview).
(Additional step from solution above for if you are missing the AutoReconnect or Offline registry value)
For Visual Studio 2015, Version 14
Turn off all VS instances
HKEY_CURRENT_USER\SOFTWARE\Microsoft\VisualStudio\14.0\TeamFoundation\Instances{YourServerName}\Collections{TheCollectionName} (To get to this directory on Windows, hit the Windows + R key and search for "regedit")
Set both the Offline and AutoReconnect values to 0.
If you are missing one of those attributes (in my case I was missing AutoReconnect), right click and and create a new DWORD(32-bit) value with the desired missing name, AutoReconnect or Offline.
Again, make sure both values are set to zero.
Restart your solution
Additional info:
blog MSDN - When and how does my solution go offline?
I am using Visual Studio 2017 15.4.0 version. Especially when i started use lightweight solution option, this offline thing happened to me. I tried to above solutions which are:
Tried to regedit option but can not see appropriate menu options. Didn't work.
Right click on solution, there is go online option and
when i choose it that gives this error message: "The solution is
offline because its associated Team Foundation Server is offline.
Unable to determine the workspace for this solution."
Then from File -> Source Control -> Advanced -> Change Source Control. I saw my files. I select them and then chose bind option. That worked for me.
You can go use registry editor.
Turn off all VS instances.
Open registry editor and go to:
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0\TeamFoundation\Instances
Find proper server e.g: team32system1
Go to Collection and nex DefaultCollection:
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0\TeamFoundation\Instances\team32system1\Collections\DefaultCollection
Set Offline key to 0
Open solution in VS. Afterwards pop up should appear which question would you like bring solution to online mode.
Neither of the above solutions worked for me on Visual Studio Community 2017 v15.7.1. Somehow, there was no "Go Online" option in the context menu. I tried registry edit as suggested here, but that only displayed me error that it could not find the binding. What worked for me is rebinding solution to the server from Change Source Control menu.
Go to File->Source Control->Advanced->Change Source Control and make sure that your solution is binded to your source control. If not (like mine) then click on bind button, it will automatically search online TFS server and rebind your solution to it.
i found another way without much effort.
Just simply right click your solution and then click undo pending changes.
Next, VS will ask you for acutally changed file where you want to undo or not specific file.
In this you can click no for such a file where actual change is happende, rest is just undoing. This will not lost your actual changes
You will need to do two steps here for a complete solution
First click on the Solution that you have open and then go File-> Source Control -> Go Online Then uncheck all the files that are being shown as being modified while you were offline.
Don't do the Get Latest version from Source Control Explorer. That will result in a dialog potentially showing a bunch of files asking you to resolve conflicts. Instead do this
In source Control explorer right click on the folder you want to get latest of and then Advanced - Get Specific Version. In the dropdown for version type choose Latest and then choose the first check box that says Overwrite writable files that are not checked out. This will automatically bring your folder in sync with latest on the server
One method I did with mine, is to "Add to Source Control", and select 'Git'.

Share a link to a location in code (source file / line number) in Visual Studio

I'm looking for a plugin (may be a TFS plugin) for Visual Studio 2010 that add a 'Copy uri' context menu entry in code editor and would make possible to copy paste a file/line number into an IM conversation (skype) or an email, and of course clicking the link would open the project/file at the correct line number (in an existing instance if VS if possible).
I'm working from home and that would be nice to be able to share easily a code location with team via skype (and sometimes email).
I googled and found nothing, but it's perhaps available in a big plugin like Resharper and not advertised.
I wrote an extension for this. It's called CodeLink:
https://marketplace.visualstudio.com/items?itemName=AuriRahimzadeh.CodeLinktm
I'm looking for testers and feedback. I only have so many solutions with which to test it :)
There's no such extension that exist from what I know.
However it wouldn't that hard to create a VSX that adds an entry in the Source Code context menu that will get the Source Control path from the Local Path using the TFS Api then putting the result in the clipboard.
In the meantime there's no easy way to come up with a workaround as I'm not aware of a way to get the Source Control path from the Local path in Visual Studio.
Its not a plugin, but you can now add a line parameter (eg &line=1234) to a TFS file browser url, and then email that link to a colleague, it will open the file in a browser with the specified line highlighted.

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 2010 Designer Bug: Unable to copy from obj\debug to bin\debug

Wondering if anyone has a solution to this 2010 bug. I have a project that built fine in Visual Studio 2008 that wont build in 2010 because Visual Studio is holding on to the dll after the application is run ONLY if a designer window is open. I created a really light weight project that shows this problem. If you create an application then create a lib dll. Put one form in the dll, open the form in design view and then run the application. It will run fine, then close the app, go to the code view of the form in design view, and change the code ( I just renamed a single variable) then try to recompile you get the following:
Error 1 Unable to copy file "obj\Debug\customlib.dll" to "build\debug\customlib.dll". The process cannot access the file 'build\debug\Customlib.dll' because it is being used by another process.
If you run Process Explorer and search for the dll, the only process holding the dll is devenv.exe!!!
I have done a ton of searching on this problem and have found similar issues with older versions of Dev Studio where people were able to just add a pre-step to move the locked dll to another name (.locked) and build. Well that works the first time, but the next time you run then edit you are locked out of both the current dll and the one you moved to .locked, so unless I am willing to add code to randomly generate a name for the locked dll, this wont work for me (I don't want my debug directory size to grow with files never getting deleted.)
I have only found one workaround and if you are in this same boat this is what I have to do to edit and run. I make sure EVERY design view window is closed BEFORE I ever run my project in the debugger. If you close all the open design view windows devenv.exe will not hold the dll.
Does anyone have a better solution to this problem?
I'm not sure whether this will work for you or not, but this similar question if you have this line in AssemblyInfo.cs:
[assembly: AssemblyVersion("2.0.*")]
changing it to:
[assembly: AssemblyVersion("2.0.0.0")]
will solve this isue.
The Visual Studio add-on "VSCommands" claims to have a fix for this problem. I've not tested it yet, but it also claims to have an in-IDE stackoverflow reputation tracker which intrigues me :)
Your "Close designer before debugging" workaround seems to be working for me (so far), for which I'm very grateful. It was beginning to get to the stage where am large part of my day was spent in the following workflow...
F5
loud expletive
ALT F4
WIN 3
waits impatiently...
F5
I have had the same problems for a long time and then suddenly they disappeared. I realized that the source of the problems was initializing code in the constructors of WCF services and WPF controls. After cleaning the constructors from any dependencies to other assemblies everything has been fine.
So my suggestion is: Clean your constructors.
In WPF it is possible that inserting:
if (DesignerProperties.GetIsInDesignMode(this)) return;
or similar will have the same effect.

Resources