VS10 Crashes When Doing “Build” or “Rebuild” of C++ Project - c++

I posted this on programmers first, but was told it belongs here. Funny, I didn't think so.
I have VS10 installed on a Windows Server 2008 R2 box, along with several other versions of VS dating back years. This is our production build machine.
When I load or create any C++ project and do a Rebuild or Clean, the IDE crashes. In the crash details, I see this:
I have seen other reports what seems to be the exact same error on the web (example). Other than the advice to open a ticket, I've seen no solution.
Has anyone else encountered and fixed this problem? I've opened a ticket with MS, but I'm covering my bases posting here as well.
EDIT:
I ran a logfile as suggested in comments. These are the only entries that occured after I loaded up VS, so this includes the build & the crash:
<entry>
<record>229</record>
<time>2010/12/01 19:35:39.804</time>
<type>Information</type>
<source>VisualStudio</source>
<description>Entering function CVsPackageInfo::HrInstantiatePackage</description>
<guid>{68939055-38E0-4D17-92CB-8909710D8178}</guid>
</entry>
<entry>
<record>230</record>
<time>2010/12/01 19:35:39.836</time>
<type>Information</type>
<source>VisualStudio</source>
<description>Begin package load [Windows Forms Designer Hosting Package]</description>
<guid>{68939055-38E0-4D17-92CB-8909710D8178}</guid>
</entry>
<entry>
<record>231</record>
<time>2010/12/01 19:35:39.882</time>
<type>Information</type>
<source>VisualStudio</source>
<description>End package load [Windows Forms Designer Hosting Package]</description>
<guid>{68939055-38E0-4D17-92CB-8909710D8178}</guid>
</entry>

How about contacting MS support directly? If this is blocking your work, you can push them to have it fixed (don't know about costs though, will probably depend on the product and specificities of your license...).
Alternatively, you can build your solution in the commandline: open a VS 2010 command prompt (shortcut is located somewhere in the start menu):
msbuild yoursolution.sln /p:Configuration=Debug
That shouldn't use devenv.exe (which is the thing crashing here) and invoke the tools directly.

The P8 bucket has a strange value, at least when compared to my machine. Check this post for a way to reverse-engineer the crashing method. The crashing assembly is stored in the C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.VisualStudio.Shell.10.0\v4.0_10.0.0.0__b03f5f7f11d50a3a directory on my machine.
The P7 bucket (note that yours doesn't match the linked one) points to ServiceProvider.GetService(). The P8 bucket gives an IL offset of 0x4b but I see the method end at 0x41. However, I haven't yet figured out how accurate that can really be when the JIT compiled code gets optimized.
If this is anywhere accurate then you don't got much for a lead. A GetService() method is hopelessly generic. Although it certainly looks like it came up with a bad one that didn't survive a cast. It is the kind of stuff that addins can mess up.
Btw, this doesn't actually affect the build output, MSBuild.exe runs as a separate process.

For anyone still having this problem, the answer that fixed mine was that I had tried to completely wipe Internet Explorer from my computer- leading to the DLL call failure that crashed devenv.
Here is their official solution page:
http://support.microsoft.com/kb/983279
My question to Microsoft is... Why would a dependency on internet explorer to compile applications even make sense under any circumstances?

Related

Qt Installer Framework: strange license error when updating

Sometimes when I use the maintenancetool.exe on Windows with "Update components", an error is displayed after the update has been downloaded and installed saying:
Error during installation process (com.myapp.windows_x86_64): Can not write license file: C:\Program Files(x86)/MyApp/Licenses\license.txt
with an option to ignore the error, retry, or quit. I can't figure out how to prevent this error. My package.xml file has the following line:
<Licenses>
<License name="MyApp Public License Agreement" file="license.txt" />
</Licenses>
and license.txt is stored in the same directory as package.xml as per the instructions in https://doc.qt.io/qtinstallerframework/ifw-tutorial.html#adding-licenses.
Edit: I realized I was inadvertently using qt installer framework version 1, so this may be bug QTIFW-315 as pointed out by Sergio. I have updated to version 3 and that seems to solve the problem.
It is a fairly broad question, and it is difficult to reproduce the same specific issue, hence the lack of answers.
I checked in the Qt bug tracker and nobody has reported a similar issue so far. It would be useful to know if this happens with different computers or just with one.
Usually you receive this kind of error messages either if the process doesn't have enough priviledges to write the file or if another process has locked the file. You may check if there is a process locking the license.txt file with utilities like Process Explorer (have a look here).
I hope this helps.
I also got this error. I found out that the problem is the space in the path "C:\Program Files(x86)/MyApp/Licenses\license.txt".

VS2017 Heap Profiling does not work due to Internet Explorer

I have a C++ Application developed using Visual Studio 2017.
I would like to locate memory leaks using the Heap Profiling feature which is part of diagnostic tools. I can easily take snapshots of the heap, and I can see cumulative differences, but then I want to pinpoint the details of leaftover memory allocations. Unfortunately when I cleck on the links or when I want to inspect the heap, Visual Studio shows me a black page saying:
"The Content requires a new version of Internet Explorer"
I then click on the link for the message and I find myself in a microsoft webpage stating that:
"If you’re running Windows 10, you already have Internet Explorer 11, so there’s nothing you need to install. However, Microsoft Edge is a brand-new browser that also comes with Windows 10, and what’s more, it’s your default browser. Be sure to check it out!"
I jsut checked and I have Internet Explorer AND Edge Installed... both of them appear to be updated to most recent versions.
I see there is an open issue on the VS support site but it is under investigation since July.
Is this really such a rare issue?
Any help is appreciated, I already tried to fake IE version in registry as suggested in similar issues, but the problem was not solved.
Sounds like VS has been having problems with both Diagnostic Tools and Heap Profiling unable to open and presenting this error message. Microsoft has had a couple of stabs at fixing both issues already in:
Diagnostic Tools empty content window
Heap Snapshot reports 'The content requires a new version of Internet explorer'
Have a read through both links to see if any of the provided information can help you resolve the problems (I suspect mshtml.dll issues in the first link).

Visual Studio 2015 crashes when starting debugger

When compiling my C++ project or running it, everything is fine.
But when starting my project with the debugger, Visual Studio 2015 crashes.
I tried this, I have found two errors:
<entry>
<record>484</record>
<time>2017/02/14 14:09:32.187</time>
<type>Error</type>
<source>Color Theme Service</source>
<description>The color &apos;Popup&apos; in category &apos;de7b1121-99a4-4708-aedf-15f40c9b332f&apos; does not exist.</description>
</entry>
and
<entry>
<record>558</record>
<time>2017/02/14 14:10:08.617</time>
<type>Error</type>
<source>VisualStudio</source>
<description>Loading UI library</description>
<guid>{8C0C630B-37F1-11E3-8259-6C3BE516EAD0}</guid>
<hr>800a006f</hr>
</entry>
I don't know what to do to make VS's debugger work.
Edit: I use the dark theme if this can help...
One issue is that whether all projects have the same issue or just the specific one.
(1) Collect the crashed dump file and debugging it is also a good suggestion for the crashed issue.
(2) I also provide some suggestions which could narrow down this issue.
Please uncheck symbols server under Tools -> Options -> Debugging -> Symbols.
Uncheck "Edit and continue", "Load dll exports (native only)" and "enable just my code(managed only)". Debug it again.
Disable the IntelliTrace under TOOLS->Options->IntelliTrace, and "Use Native Compatibility Mode" under TOOLS->Option->Debugging->General or mix mode/native debugging project property(right click project->Debugging). Test it again.
I met the crashed issue before which was related to certain settings, so if possible, you could test it in your side.
But if all projects have the same issue, I suggest you repair your VS, or install the latest update package for your VS, and then debug it again.
If just one specific project has this issue, we would think about the project itself.
Update:
As our discussion, I found that you have reported this issue here:
https://connect.microsoft.com/VisualStudio/Feedback/Details/3123487
I will help you vote it and add my comment there. If I get any latest information from the report team, I will update it here.

visual studio removes backslash from path, generated by cmake [duplicate]

We just did a move from storing all files locally to a network drive. Problem is that is where my VS projects are also stored now. (No versioning system yet, working on that.) I know I heard of problems with doing this in the past, but never heard of a work-around. Is there a work around?
So my VS is installed locally. The files are on a network drive. How can I get this to work?
EDIT: I know what SHOULD be done, but is there a band-aid I can put on right now to fix this and maintain the network drive?
EDIT 2: I am sure I am not understanding something, but Bob King has the right idea. I'll work with the lead web developer when he gets back into the office to figure out a temporary solution until we get some sort of version control setup. Thanks for the ideas.
While we do use Source Control, we do also run all our projects from Network Drives (not shared directories, private directories on network drives). The network drives are backed up nightly, and also use Volume Shadow Copy, so if you need to revert to something before it made it's way to SC, then you can.
To get projects to run correctly with the right permission, follow these steps.
Basically, you've just got to map the shared directory to a drive, and then grant permission, based on that Url, to all code. Say you map to "N:\", then use "N:\*" as your Url pattern. It isn't obvious you need to wildcard, but you do.
The question is rather generic so I'll give an answer to one issue I was facing.
I run Visual Studio 2010 using a Parallels virtual machine on my Mac while keeping all my projects on the mac side via a network share. Visual Studio however wouldn't load the projects assembly files from there. Trying to set the rights using "caspol" alone didn't help in my case.
What finally worked for me to allow Visual Studio to load assemblies from a network share was to edit the file
"C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe.config" (assuming a default installation).
in the xml "<runtime>" section you have to add
<loadFromRemoteSources enabled="true"/>
You may have to change the permissions on that file to allow write access. Save the file. Restart Visual Studio.
In the interests of actually answering the question, I copied this comment from jcarle.com:
Trusting Network Shares with Visual Studio 2010 / .NET Framework v4.0
January 20, 2011, 4:10 pm
If you are like me and you store all your code on a server, you will have likely learned about trusting a network share using CasPol.exe. However, when moving from Visual Studio 2008 (.NET Framework 2.0/3.0/3.5) over to Visual Studio 2010 (.NET Framework 4.0), you may find yourself scratching your head.
If you are used to using the Visual Studio Command Prompt to quickly get to CasPol, you may find that some of your projects will not seem to respect your new FullTrust settings. The reason is that, unless you are carefully paying attention, the Visual Studio Command Prompt defaults to adding the .NET Framework 4.0 folder to its path. If your project is still running under .NET Framework 2.0/3.0/3.5, it will require setting CasPol for those versions as well. Just a note, I have also personally had more success with using 1 as a code group instead of 1.2.
To trust a network share for all versions of the .NET Framework, simply call CasPol for each version using the full path as below:
C:\Windows\Microsoft.NET\Framework\v2.0.50727\CasPol -m -ag 1 -url file://YourSharePath* FullTrust
C:\Windows\Microsoft.NET\Framework\v4.0.30319\CasPol -m -ag 1 -url file://YourSharePath* FullTrust
I would not recommend doing that if you have (or even if you don't have) multiple people who are working on the projects. You're just asking for trouble.
If you're the only one working on it, on the other hand, you'll avoid much of the trouble. Performance is going to out the window, though. As far as how to get it to work, you just open the solution file from VS. You'll likely run into security issues, but can correct that using CASPOL. As I said, though, performance is going to be terrible. Again, not recommended at all.
Do yourself and your team a favor and install SVN or some other form of source control and put the code in there ASAP.
EDIT: I'll partially retract my comments. Bob King explains below the reason they run VS projects from a network drive and it makes sense. I would say unless you're doing it for a specific reason like Bob, stay away from it. Otherwise, get your ducks in a row before setting up such a development environment.
So I was having a similar issue. Visual Studio wouldn't recognize a network location I had mapped for a drive letter for anything. The funny thing is, it worked for a day. I set up my project and began working on it and had no issues. Then, I shut down and the next day nothing works. I couldn't read/write files in code, output my executables or anything. My project is local but my output was intended to be thrown up on the network.
Anyways, the problem is probably about the administrator context but one way to fix it which I found while digging around online is to get Visual Studio to browse to the drive in question some how. There are plenty of ways to do this but VS will magically be able to recognize mapped drive letters. My solution is to go the the Debug Output Location in the Project Properties, click browse and go to my previously made output location on my network drive and Voila!!!
I wanted to put this up because I spent half a day trying to figure this out and figured it might save someone else some time. Thanks much and good luck!!!
Erik
I understand this is an older thread, but this was the best thread I found when looking to solve a similar issue I had visual studio 2013 on a virtual box (using Win 8.1) and the code on the host machine (Win 7). Although I could open the solution, I could not compile. All of the other answers on this relate to older software, so I am adding this answer to update this frequently found question with the solution that worked for me.
Here's what I did; Made a registry entry to be able to use a UNC path as the current directory.
WARNING: Using Registry Editor incorrectly can cause serious, system-wide problems that may require you to reinstall Windows NT to correct them. Microsoft cannot guarantee that any problems resulting from the use of Registry Editor can be solved. Use this tool at your own risk.
Under the registry path:
HKEY_CURRENT_USER
\Software
\Microsoft
\Command Processor
add the value DisableUNCCheck REG_DWORD and set the value to 0 x 1 (Hex).
WARNING: If you enable this feature and start a Console that has a current directory of an UNC name, start applications from that Console, and then close the Console, it could cause problems in the applications started from that Console.
Found this information at link: http://support.microsoft.com/kb/156276
How about we rephrase this into a question that everyone can answer? I have the exact same problem as the initial poster.
I have a copy of VB 2008 (recently upgraded from VB6). If I store my solutions on the backed up network drive, then it won't run a single thing ever. It gives "partially trusted caller" errors for accessing a module, even when "allowpartiallytrustedcallers" is set in the assembly. If I store the files on my (not backed up) C:, then it will run wonderfully, until I put it on the share drive for everyone to use, and I'm back to my same problem.
This isn't a big request. I just want to be able to put a solution and executable on the share drive and run it without an absurd amount of nonsense about security. I shouldn't have to cram all my work into form files.
-Edit: I found the problem with why it was ignoring the AllowPartialllyTrustedCallers command. I'm trying to reference ADODB, which doesn't allow partially trusted. So, no network executable can access a database? What does Microsoft have against intranets anyway?
I was facing the same issue just recently so this answer is more for the sake of keeping track of my own knowledge. Anyway, should soumeone find it useful, below is the issue and the solution.
Issue:
NET 4.0 projects, SVN repo, checkout folders are on local drives, referenced assemblies are build by build server and available on a network drive. Visual studio on W7 is is able to add the reference but unable to build projects.
Solution:
Since NET 4.0 does not automatically provide a sandbox anymore for network assemblies, you have to make those full-trusted via machine.config update. http://msdn.microsoft.com/en-us/library/dd409252.aspx
I had a similar problem with opening Visual Studio projects on a network drive, and I fixed it by creating a symbolic link on my local C:\ drive that points to the UNC directory
e.g.
mklink /D "C:\Users\Self\Documents" "\\domain.net\users\self\My Documents"
then you can just open the project using the C:\Users\Self\Documents\ path, instead of the UNC path
(You have to be careful, because Visual Studio will automatically redirect you to the '\\domain.net..' path if you double click the symlink when you're browsing for the project. I had to copy paste the 'C:\Users\' path to get it to open with the drive letter path)
Don't do it. If you have source control (versioning), you do not want your files on a network drive. It totally bypasses all you want to achieve by using source control, because once your files are on a network drive, anyone can modify them .... even while you're currently building your project. Ka-boooom!
PS: this sounds like a typical case of over-engineering to me.
Are you having any specific problems?
If you allow more than one person to open the solution, your first problem will be that the .NCB file (Intellisense) will be locked exclusively and only one user will be able to browse the class tree. And of course you have the potential for one user's changes to overwrite the other user's changes.
You should be warned that some feature in Visual Studio will refuse to work with network drive.
For example, mdf file of SQL Express user instance must be located in local drive.
For another example, if you use UNC path, you have to make sure they are short enought.
i found this helpful while trying use vc11 with parallels which run on mac:
http://social.msdn.microsoft.com/Forums/en-US/toolsforwinapps/thread/2ffdcb01-c511-4961-834b-afd5f2fbb8e1, and specifically:
1) You can switch from local debugging to remote debugging and set the machine name as 'localhost'. This will do a remote deployment on your local machine (thus not using the project's directory). You don't need to install the Remote Debugger tools, nor start msvsmon for this to work on localhost.
In case this helps anyone else, I had to do the steps outlined here to add the network share location to Windows intranet zone. In particular, I was having trouble with Visual Studio hanging on load when opening a solution on a network share (i.e. using VMware Fusion and opening a solution from my Mac's hard drive). I also had problems with PostSharp running in this scenario.
If i understand you correctly, your Visual Studio project files are stored on the network drive and you are running them from there. This is what I do and don't have any problems. You will need to make sure that you have set the security policy. You can use Caspol to do this, or via the control panel-admin tools menu.
"How can I get this to work?"
You have a couple choices:
Choice A:
1. Move all files back to your local hard drive
2. Implement some type of backup software on your machine
3. Test said backup solution
4. keep on coding
Choice B:
1. Get a copy of one of the FREE source control products and implement it.
2. Make sure it's being backed up
3. Test it
Choice C:
Use one of the many ONLINE source control repositories available. Google, SourceForge, CodePlex, something.
Well, my question would be why you are asking this. Is it not working when you are storing it on a network drive? I haven't tried this myself, and one problem I could envision would be that .NET code running from a network drive (ie. from the bin\Debug directory, also located on the network drive) would be running in a sandbox mode, unless you mess around with CASPOL (or use 3.5 SP1 which I hear has removed that obstacle).
If you have specific problems, ask about them. Never ask "Why is doing X not working?".
You're not saying if you're just one person or multiple persons accessing the same remote drive, but I'm assuming you're just one for each network directory. Is this correct? If not, no, there is no band-aid. Get version control, move the files back to a local disk.

Unable to reload ActiveX control in Windows CE 6

I am developing an ActiveX control targeted at Windows CE 6 (on a Motorola Workabout Pro 4, if specifying helps). I have stage one working, in the sense that I can compile in Visual Studio, and have deploy using a simple CAB file.
However, I am finding it very hit and miss as to whether I can update the control on the device. If I perform a clean rebuild (ensuring that all intermediary files are removed beforehand) and redeploy the CAB file, I find that any changes aren't reflected in the deployed code: The output is unchanged, both in IE on the device, and when connecting and debugging via the Visual Studio 2008. Secondly, any breakpoints that I have added in the debugger no longer hit.
If I manually replace the dll file, this still has no effect. Even stranger, the control still continues to work if I completely remove the dll!
I'm a bit of a beginner when it comes to WinCE and ActiveX development, so any hints as to what I am missing here would be greatly appreciated!
In this instance, my problem was that I was failing to correctly register my dll with COM.
The simplest solution was for me to change the CAB file so that the the dll self-registered. In my case, this was done by changing a parameter in the CAB file properties for the dll in Visual Studio. This results in <parm name="SelfRegister" /> being added to the CAB _setup.xml file:
...
<characteristic type="%CE2%" translation="install">
<characteristic type="MakeDir" />
<characteristic type="output.dll" translation="install">
<characteristic type="Extract">
<parm name="Source" value="OUPUT~1.002" />
<parm name="SelfRegister" />
</characteristic>
</characteristic>
</characteristic>
...