How to use visual leak detecter ( vld ) for com/atl dll projects? - com

I included vld.h file in my activex dll project. when i try to compile my project from visual studio 2008.I am getting the following error,
1>Registering output...
1>Project : error PRJ0050: Failed to register output. Please ensure you have the appropriate permissions to modify the registry.
How to use visual leak detecter for com/activex dll projects?

I don't think this has anything to do with the 'visual leak detecter' (sic?)... I'm not familiar with it.
Anyway, the PRJ0050 error occurs because Visual Studio attempts to auto-register the DLL generated by the project, using a post-build step (see Project Settings), and you are not logged in as a user with permission to modify the registry.
So, either Run Visual Studio as an administrator (if you're on Windows Vista), if you want to allow auto-registration, or remove the auto-registration post-build step from the project.

Related

Files needed to run a standalone exe built with wxWidgets

I have built an EXE with wxWidgets 3.1.4 under Visual Studio 2017.
I can start the EXE from Visual Studio but not outside Visual Studio.
I get the message:
Unhandled unknown exception; terminating the application.
EXE is built in Release/x86.
I have tried to copy the Release DLLs of wxWidgets in the same folder as the EXE as well as files from vc_redist_x86 but I still get the error.
Thanks for your help
It was an application error, a resource file was missing.
I have deleted the Release folder, rebuilt and copied the resource file and the EXE runs.
Release DLLs are in my %PATH% and I have installed vc_redist_x86.exe so I guess these two things allow my standalone EXE to start.
#MaximeVermier,
In order to build the library yourself:
Open ${WXWIN}\build\msw\wx_vcN.sln.
Select Build->Batch Build...
Select all project which says "Debug/Win32"
Click "Build".
The resulting libraries will be in ${WXWIN}\lib directory.
Now all you need is to change the project file for your application and rebuild.
Then you will not need wxWidgets DLLs.

Adding DLL in Visual Studio 2013 causes Compiler Error -107374181 (ERROR_ACCESS_DENIED)

I am trying to add a reference to a dll, but when I compile the project I get:
Compiler Error Message: The compiler failed with error code -1073741819.
I have tried:
changing the security permissions on the dll to allow full control
running visual studio as administrator.
I have added the dll with copylocal = false, but it fails at runtime with a "file not found" error.
I created a separate project with the same framework version (4.5) and was able to add the dll without any trouble, but unfortunately I need to add it to the existing legacy project.
The legacy project source files are in GitHub, but the bin folder where I am adding the DLL to is not in Github.

TeamCity build fails without windows kits reference in proj file

I'm having an issue on teamcity (9.1.7). I don't have visual studio installed on the build server. I have installed visual studio test agents and msbuild tools. Building one of the project fails with this error-
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\AppxPackage\Microsoft.AppXPackage.Targets(694, 9): error APPX1639: File 'Windows.props' not found. See http://go.microsoft.com/fwlink/?prd=12395&pver=1.0&plcid=0x409&ar=MSDN&sar=PlatformMultiTargeting&o1=Portable&o2=7.0 for more information
The link doesn't work. After looking up the error, it seems i need to install Windows Kits and I need to add this to my csproj file under the first property group -
<_WindowsKitBinPath>C:\Program Files (x86)\Windows Kits\8.1\bin\x86</_WindowsKitBinPath>
<_WindowsPhoneKitBinPath>C:\Program Files (x86)\Windows Phone Kits\8.1\bin</_WindowsPhoneKitBinPath>
<MakePriExeFullPath>$(_WindowsKitBinPath)\makepri.exe</MakePriExeFullPath>
<MakeAppxExeFullPath>$(_WindowsKitBinPath)\makeappx.exe</MakeAppxExeFullPath>
<SignAppxPackageExeFullPath>$(_WindowsKitBinPath)\signtool.exe</SignAppxPackageExeFullPath>
<MakePriExtensionPath>$(_WindowsPhoneKitBinPath)\x86\MrmEnvironmentExtDl.dll</MakePriExtensionPath>
<MakePriExtensionPath_x64>$(_WindowsPhoneKitBinPath)\x64\MrmEnvironmentExtDl.dll</MakePriExtensionPath_x64>
I really don't want to add this to my csproj file. I don't know why it is required/what impact it has. Can someone explain to me why this is needed? When i build my solution locally with visual studio, it works fine.
The groups of settings are basically bootstrapping parameters that are required by MSBuild in order to compile the project (A native windows phone app??). You've probably got the kit installed locally and something already integrated into Visual Studio, which is why it builds. Uninstall the Visual Studio add-in and it'll probably start failing.
You can setup your compile step to pass in these parameters without requiring them in the .csproj file if you don't want them there.
I normally abstract additional build parameters to a variable in TeamCity
Hope this helps

Making a Stand-Alone EXE File

I'm currently using Visual Studio 2010 to make a Visual Basic project. I'm trying to make a standard .EXE file for distribution but everytime I go to publish, I keep seeing it make a Click Once application.
Is there a way to complete and build a project in VStudio 2010 without making it as a Click-Once application?
Don't Publish it; that is what is making it a clickonce application. Just Build Solution; this will create the exe in the specified output directory (usually debug or release depending on your current Configuration.

How to run .NET 4 code analysis on build server

On a Windows Server 2003 R2 with .NET 4 SDK but without Visual Studio 2010, I have tried building a Visual Studio 2010 solution with
msbuild MySolution.sln /p:RunCodeAnalysis=true
but that fails.
What is required to run code analysis on such an environment?
I get this error message:
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\CodeAnalysis\Microsoft.CodeAnalysis.targets(129,9): error MSB6003:
The specified task executable "FxCopCmd.exe" could not be run.
Could not load file or assembly
'Microsoft.VisualStudio.CodeAnalysis.Sdk, Version=10.0.0.0, Culture=neutral, PublicKeyToken= b03f5f7f11d50a3a'
or one of its dependencies.
The system cannot find the file specified.
I have installed FxCop from the SDK and without luck pointed the variable FxCopDir to the installed location of FxCopCmd.exe, and also setting this registry entry to that location:
HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\Setup\EDev#FxCopDir
I had the same problem on my MSBuild server and fixed it by:
Installing Windows SDK 7.1
Setting up the registry keys FxCopDir and StanDir in HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\Setup\EDev (in Win32).
I then copied over from the dev PC, to the FxCop folder on the build server, the following:
The folder Rule Sets (default installation target is here: C:\Program Files (x86)\Microsoft Visual Studio 14.0\Team Tools\Static Analysis Tools\FxCop)
Microsoft.VisualStudio.CodeAnalysis.Sdk.dll
Microsoft.VisualStudio.CodeAnalysis.Phoenix.dll
phx.dll
Do a search for them on your dev PC with Visual Studio installed to locate them.
Then use the .NET 4.0 version of gacutil.exe to install Microsoft.VisualStudio.CodeAnalysis.Sdk.dll to the GAC.
You should then be able to run code analysis as part of an MSBuild build and have it work properly.
An alternative to FxCop would be to use the tool NDepend that lets write Code Rules over C# LINQ Queries (namely CQLinq). Disclaimer: I am one of the developers of the tool
More than 200 code rules are proposed by default. Customizing existing rules or creating your own rules is straightforward thanks to the well-known C# LINQ syntax.
Rules can be verified live in Visual Studio and at Build Process time, in a generated HTML+javascript report.
Another option might be calling FxCop executable as a build task (from msbuildtasks), saving the result as an XML file that can be parsed within most of the CI tools (like Hudson and CC.NET)