Quantcast
Channel: MSBuild forum
Viewing all 2763 articles
Browse latest View live

GetProcAddress definition in ATL

$
0
0

I am trying to port some projects to 64 bit MFC using Unicode from existing 32 bit projects. I was making good progress when suddenly the compiler started complaining about GetProcAddress(). In libloaderapi.h GetprocAddress is defined as:

WINBASEAPI
FARPROC
WINAPI
GetProcAddress(
    _In_ HMODULE hModule,
    _In_ LPCWSTR lpProcName
    );

but the references to it in atlcore.h, atltransactionmanager.h etc do not have the 'L' in front of the literal strings used in the argument list. For the life of me I can't figure out what has happened. If I compile just stdafx.cpp with all of the afx*.h includes commented out, no problem. But, if I include any of the afx*.h files I get multiple errors like:

Error    2    error C2664: 'FARPROC GetProcAddress(HMODULE,LPCWSTR)' : cannot convert argument 2 from 'const char [18]' to 'LPCWSTR'    E:\Microsoft Visual Studio 12.0\VC\atlmfc\include\atltransactionmanager.h   271    1    Control (Control\Control)

The line in atltransactionmanager.h looks like:

            pfCreateTransaction = (PFNCREATETRANSACTION)GetProcAddress(hKTM32, "CreateTransaction");

Note no "s (quotes) around CreateTransaction.

Can anyone tell me why I'm seeing this. I even tried creating a new empty MFC project with the same result.


fatal error CS0013: Unexpected error writing metadata to file 'Not enough storage is available to complete this operation'

$
0
0

We have a Visual Studio 2010 solution running with just 3-4 projects in the solution.  This is a Windows Server 2008 32 Bit OS and 4GB RAM.  

More often when building the solution, the error "fatal error CS0013: Unexpected error writing metadata to file 'Not enough storage is available to complete this operation" occurs and it fails the build. 

A general research talks only about similar errors in VS 2005 and the fix to apply SP1.  But its suprising the error is continuing even in VS 2010.

Any recommended solutions would be appreciated!

FBX MSB4018 error in VS2013

$
0
0

Trying to convert the simplest possible FBX file to CMO. The FBX was exported from 3DSMax and is just a plain cube. VS2013 keeps throwing an error from VSGraphcis when trying to convert: 

The "MeshContentTask" task failed unexpectedly.
System.Exception: VsGraphics failed, error code 4317 returned.
   at Microsoft.VisualStudio.Graphics.Api.VsgTask.Execute()
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__20.MoveNext()

Any ideas ? Is there any way I can see some more sensible errors as to why it failed ? Maybe a log file somewhere. Seems that I m neither the first nor the last person having these FBX conversion problems, as I've seen posts going back to VS2012 RC dealing with this same issue, but haven't found the solution for my case yet. 


code generator

error MSB4018: The "MIDL" task failed unexpectedly when I use VS 2012 to compile my C++ projects

$
0
0
1>Build started 3/14/2014 8:50:36 AM.
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.CppCommon.targets(1179,5): error MSB4018: The "MIDL" task failed unexpectedly.
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.CppCommon.targets(1179,5): error MSB4018: System.TypeInitializationException: The type initializer for 'Microsoft.Build.Utilities.FileTracker' threw an exception. ---> System.IO.FileNotFoundException: The system cannot find the file specified. (Exception from HRESULT: 0x80070002)
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.CppCommon.targets(1179,5): error MSB4018:    at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.CppCommon.targets(1179,5): error MSB4018:    at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode)
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.CppCommon.targets(1179,5): error MSB4018:    at Microsoft.Build.Shared.NativeMethodsShared.ThrowExceptionForErrorCode(Int32 errorCode)
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.CppCommon.targets(1179,5): error MSB4018:    at Microsoft.Build.Shared.NativeMethodsShared.GetShortFilePath(String path)
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.CppCommon.targets(1179,5): error MSB4018:    at Microsoft.Build.Utilities.FileTracker..cctor()
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.CppCommon.targets(1179,5): error MSB4018:    --- End of inner exception stack trace ---
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.CppCommon.targets(1179,5): error MSB4018:    at Microsoft.Build.CPPTasks.TrackedVCToolTask.ComputeOutOfDateSources()
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.CppCommon.targets(1179,5): error MSB4018:    at Microsoft.Build.CPPTasks.TrackedVCToolTask.SkipTaskExecution()
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.CppCommon.targets(1179,5): error MSB4018:    at Microsoft.Build.Utilities.ToolTask.Execute()
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.CppCommon.targets(1179,5): error MSB4018:    at Microsoft.Build.CPPTasks.TrackedVCToolTask.Execute()
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.CppCommon.targets(1179,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.CppCommon.targets(1179,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__20.MoveNext()
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:00.67

Modifying one source file causes "Forcing rebuild of all source files due to a change in the command line since the last build"

$
0
0

We had a VS2012 solution with 106 projects (C/C++). Recently, when a cpp or c file is changed, hitting Build will cause the whole project rebuild. Sometime when I modify a file and hit Compile (active file only), I can even see that StdAfx.cpp being compiled in the output window (but of course I never modify it), this is a really strange behavior that we never see before.

So I changed output verbosity to Diagnostic and I saw another post describes the same issue, see:

http://social.msdn.microsoft.com/Forums/vstudio/en-US/aca632fa-e1e0-4511-aa03-a309ae547a5b/how-to-see-the-command-line-forcing-rebuild-of-all-source-files-due-to-a-change-in-the-command?forum=msbuild

However, none of those mentioned methods fix the issues.

And by the way, I can see this LNK2011 error now and then:

precompiled object not linked in; image may not run

I had to rebuild the projects dumping this error to continue my work, we never see such error before, so I am wondering it might be related.

So I am wondering whether there is a switch or something like that to tell me exactly which part of the command line had been changed, or, at least tell me the original command line and the new command line? Or specifically, what can be done to help to get this resolved?

By the way, this issue does not happen all the time, it seems to occur randomly. 

Thanks,

Kenny




CheckRemoteFx45 Target failing

$
0
0

I'm performing a Web Deploy of a provider-hosted SharePoint app using Visual Studio 2013.

When publishing (rightclick, and publish), I get the error

Error 4 The "CheckRemoteFx45" task could not be loaded from the assembly C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Web\Microsoft.Web.Publishing.Tasks.dll.  Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.  0 0 ProviderAppWeb

Microsoft.Web.Publishing.Tasks.dll exists.

The targets file contains

<UsingTask TaskName="CheckRemoteFx45" AssemblyFile="Microsoft.Web.Publishing.Tasks.dll"/>

 <!--********************************************************************-->
    <!-- Target _CheckRemoteFx45-->
    <!--********************************************************************-->
    <Target Name="_CheckRemoteFx45" Condition="'$(TargetFrameworkVersion)' == 'v4.5' and $(_Enable45Check) != 'false'">
      <CheckRemoteFx45 Condition="'$(MsDeployServiceUrl)' != ''"
        ServiceUrl="$(MsDeployServiceUrl)">
       </CheckRemoteFx45>
    </Target>

Can i safely disable this check?

Jørgen


Jorgen

VS Publish Max Connections exceeded can't publish

$
0
0

I was publishing to host server and got a socket error on one of the dlls.  After that, publish quit working with the following error any time I try to validate connection or publish: The maximum number of connections for this site has been exceeded.
Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_EXCEEDED_MAX_SITE_CONNECTIONS

The MS link doesn't even discuss that error.  I've googled until my fingers are about to bleed, web host has not fixed (its been 3 days), I've asked in several forums.  I've tried everything I can think of, I've deleted everything (folders & website from Website Panel), I've deleted temp app pool files from local inetpub, and using an entirely different solution.  I am able still able to publish other solutions to different domains. 

Is this a problem with Visual Studio that I can fix locally or is this something my host has to fix.  In either case, does anyone know how to fix this?


error MSB6006:"cmd.exe" exited with code 9

$
0
0
I try to compile my C++ project under VS2010 x64 and I got this error :

C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB6006: cmd.exe" exited with code 9.

I read a lot of things about this error, but never with the code 9... I also check my custom build command and execute it in an external cmd and everything seems to be correct...

Do you have an idea?

Thanks!

Trying to create a Oauth type authentication

$
0
0

Hi all,

I'm trying to create a Oauth type of authentication application. I have a simple SQL database with a table with columns like uID, uName, uPassword(encrypted) etc. I have a basic interface which contains a text box for username and password and a submit button(I will paste code below).

I so far have the user able to authericate from the database using the interface and this can redirect them to a page. I want to be able to once the user has been authenticated create a token of some sort which I can store to pass round the application to allow them access to other applications.

The purpose of this is I would like to use this token basically like Oauth works and allow access to other applications which I may have linked to this application to save users having to sign in multiple times. The main purpose of this is that we have multiple applications but would like to create a custom home page with applications which will hold icons of applications the users have access too but only need to sign on once(I started looking at single sign on today to no knowledge of that too). Any help would be appreciated.

Public Class _Default
    Inherits System.Web.UI.Page

    Public tools As New toolkit
    Public _js As New mcgCore.clsJavascript

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub


    Private Sub cmdLogin_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdLogin.Click

        Dim t As String = tools.userLogin(Me.txtID.Text, Me.txtPwd.Text)
        Select Case t
            Case "Login failed!"
                _js.AlertPostRender(Me, t, "strKey1")
                Me.lbForgot.Visible = True
                If tools.checkEmailAddress(CType(tools.userSelect(Me.txtID.Text), DataTable).Rows(0).Item("uEMAIL")) = True Then
                    Me.lbForgot.Text = Me.GetLocalResourceObject("ForgotPass")

                Else
                    Me.lbForgot.Text = Me.GetLocalResourceObject("EmailAdmin")
                End If
            Case "Login successful!"

                Session("userID") = Me.txtID.Text
                Session("termsfile") = tools.userSelect(Me.txtID.Text.Trim).Rows(0).Item("oTERMSFILE")
                Response.Redirect("launcher.aspx")
            Case Else
                _js.AlertPostRender(Me, t, "strKey1")
                Me.lbForgot.Visible = False
        End Select

    End Sub

End Class
<%@ Page Title="Home Page" Language="vb" MasterPageFile="~/Site.Master" AutoEventWireup="false"
    CodeBehind="Default.aspx.vb" Inherits="Test_Login._Default" %><asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent"></asp:Content><asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent"><br /><br /><div align="center"><table border="0" cellpadding="5" bgcolor="WhiteSmoke" style="width: 320px" ><tr><td id="tdlblUserId" runat="server" style="width:42%; " ><asp:Label ID="lblUserId" runat="server" meta:resourcekey="lblUserId" CssClass="TEXTBOX"></asp:Label></td><td id="tdtxtId" runat="server" width="58%"><asp:TextBox ID="txtID" runat="server" CssClass="TEXTBOX"></asp:TextBox></td></tr><tr><td id="tdlblPwd" runat="server"><asp:Label ID="lblPwd" runat="server" meta:resourcekey="lblPwd" CssClass="TEXTBOX"></asp:Label></td><td id="tdtxtPwd" runat="server"><asp:TextBox ID="txtPwd" runat="server" CssClass="TEXTBOX" TextMode="Password"></asp:TextBox></td></tr><tr><td align="right"></td><td id="tdcmdLogin" runat="server"><asp:Button ID="cmdLogin" runat="server" Text="Login" CssClass="BTN" meta:resourcekey="cmdLogin" Width="90px" /></td></tr><tr><td align="right"></td><td align="left"><asp:LinkButton ID="lbForgot" runat="server" Visible="False" CssClass="TEXTBOX"></asp:LinkButton></td></tr><tr align="right"><td id="tdlblTC" runat="server" colspan="2"><p style="font-size:11px"><br /><asp:Label ID="lblTC" runat="server" meta:resourcekey="lblTC"></asp:Label><br /><strong><asp:label ID="lblSupport" runat="server" meta:resourcekey="lblSupport"></asp:label></strong><br /><asp:Label ID="lblContact" runat="server" meta:resourcekey="lblContact"></asp:Label></p></td></tr></table></div><div runat="server" id="footerright" contenteditable="true" align="right"><asp:Label ID="lblCopyright" runat="server" Font-Names="Arial" Font-Size="7pt" ForeColor="#000000"></asp:Label></div></asp:Content>


Thanks,

T


How to fix "error MSB8008: Specified platform toolset (v120) is not installed" ?

$
0
0

Hi

I have opened a VS2010 C++ solution with VS2013.  I have set the PlatformToolset property of each configuration to 'v120':

<PlatformToolset>v120</PlatformToolset>

The second line of the vcxproj file reads:

<ProjectDefaultTargets="Build"ToolsVersion="4.0"xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

The top lines of the .sln file read:

MicrosoftVisualStudioSolutionFile,FormatVersion12.00# Visual Studio Express 2013 for Windows DesktopVisualStudioVersion=12.0.21005.1

When I try to build the solution from the command line using:

>c:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe MSVC\NemeSys2010.sln /p:Configuration="Debug"/p:useenv=true/flp:logfile=ZodiacOutput.log;verbosity=diagnostic /p:VisualStudioVersion=12.0

I see error:

error MSB8008:Specified platform toolset (v120)isnot installed or invalid

But I don't get that error for another solution, which is configured similarly.

How can I fix this please?

Best regards

David

ISPROJ file built with MSBuild does not include all necessary dependencies in the MSI.

$
0
0

Greetings,

I am using the InstallShiled LE Spring 2012 version.

I have several projects that are using some Third party controls. In order to use these controls we add some file references for a set of assemblies registered in the GAC, these references are added to the Main Exe project for the solution. These are registered as part of an SDK developer package.

When I build the Solution in Visual Studio 2012, the installer includes these registered files and the installed application will work without any issues. However, if I build the Solution through the MSBuild command line these third part DLLs are not present in the MSI and that causes the application to fail when installed with an installer created by this process.


It basically looks like builds within VS2012 run the .Net Dependency scan, and the others do not.

The issue is that the compiled MSI is DIFFERENT when built via the command line than it is when built via Visual Studio. Since the MSI output by Visual Studio is correct and has all of the necessary referenced DLLs embedded within the installer, I would have to assume the issue is with the way the MSBuild Command line builds the isproj files.

The project builds in both formats without error

The issue is not a failed build, but the fact that the output MSI package from a command line or TFS build does not include all of the necessary files for the application to run once installed. There is some major difference in how the isproj files are being built when using a command line build versus using the Visual Studio IDE to build.

Since I cannot find any method of increasing the verbosity level of an isproj build log in VS IDE, I cannot compare it against the more verbose command line build. All I can tell is that when it is building the MSI, the IDE successfully scans and detects the needed dependencies, but the command line builds don't detect all of the necessary dependencies from the primary output.

Using POGO from and outside of MSBUILD

$
0
0

I'm trying to use POGO (Profile Guided Optimization). I'm having two problems with it.

First, I'm not building within VS. The build is controlled by SCONS so all I'm using is whatever command line MSBuild tools that are on hand.

1) After building with "/LTCG:PGI" I copy everthing and run the application on another machine (a test performance server).  I'm expecting the .PGC files to be populated. But nothing happens to them at all. No new data is generated. What is the secret to getting the profile statistics?

2) When trying to use "/LTCG:PGO" is complains: "timestamp does not match file linked with /LTCG:PGINSTRUMENT" so I try "/LTCG:PGU" and it succeeds. I immediately try building again with "/LTCG:PGO" and it gives the same complaint. How do I get the optimized build even problem #1 is straightened out?

what does this mean?

$
0
0

what does this mean and does it make sense??

<ItemGroupCondition="'@(SelectedFiles)' != ''">

    <MBNFRemove="@(MBNF)"Condition="'%(Identity)' != '@(SelectedFiles)'" />

</ItemGroup>

first of all... the Condition of the ItemGroup... do I need it? I don't think so... what happens if I drop it? (I think it still works the same way round... am I wrong?)

and then... what does the next thing mean? remove everything from the item-group "MBNF" if %(Identity) ... I don't understand it... why %(Identity) ? is this the file I'm compiling? ... and what does the != mean in this situation? is not ... the group "SelectedFiles" is not the file I'm compiling' or the group "SelectedFiles" does not contain the file I'm compiling? ...

... does someone probably have a good website explaining the whole stuff? ... I'm so confused... I tryed to figure it out with the book "Inside the Microsoft Build Engine", but I still don't get it...

Precompiled header will be compiled for no reason

$
0
0
Hi there,

I have found out that a few of our projects were being rebuilt even with a single file change. These projects are all creating/using their own precompiled headers. To see if our solution/projects were corrupt (as we had upgraded them from VS2008), I wanted to see if I could replicate the same problem with a brand new solution that I could generate from the templates and I was able to reproduce it. Here are the steps I followed.

1. Open VS 2010
2. File->New->Project
3. Select "Visual C++"->"Win32 Console Application" in the "New Project" Dialog Box
4. Create the project anywhere and Hit Finish in the application wizard so that it creates one with a precompiled header
5. Build the generated solution
6. Right click the cpp file that is not stdafx.cpp and hit Compile
7. When you hit Build, you would expect it to not compile anything but just link whatever has been compiled. However, it will compile the precompiled header (stdafx.cpp) as well when there is no reason to do so. Hence, it will compile all the files that is including the precompiled header.
8. When I turn the diagnostic output from MSBuild, it tells me that "stdafx.cpp will be compiled as it was not found in the tracking log. (TaskId:15)"
9. I just checked and this is not happening with VS2008.

Any help will be appreciated,

Thanks,

Dogu


Custom Platform Missing Linker/Librarian Property Pages when opening Solution as Custom Platform

$
0
0

Our team here is working with Visual Studio 2013 and have created several custom Platforms for storing information about building our Projects on other platforms. Property Target files and PropertySheets have been setup to specify parameters and flags that are specific to each platform. The idea here being that one could use the IDE to update flags for building on other platforms which can be used by special scripts to run the projects on those platforms.

The Property Pages are showing up as intended when the solution is loaded while Win32 is the set platform, but they are not showing up when the platform is one of our new custom Platforms. In other words, if I open the solution and change the current Platform to Linux then close the solution, then open it again, the Linker and Librarian pages will be missing for 10/12 projects loaded, tho all other Property Pages will be as they are expected to be.

There is no discernible difference between the projects that show their Property Pages correctly and the projects that don't.

Loading a project by itself defaults the Platform to Win32 so I haven't been able to reproduce the issue except through loading the Solution.

Has anyone experienced this? Can anyone point me towards documentation that explains how the MSBuild files are loaded? I have been trying to figure out if we are missing any flags in our files but the fact that it works for most pathways makes it hard to pinpoint what we might be doing wrong.

Any help or information would be greatly appreciated. Thanks :)


Schema Compare task in MSBuild, VS2013

$
0
0

Hi,

We have automated process to create project builds with database updates.

Before we have used SQLServer 2005, VS2008.

To generate database update script for new build we have used MSBuild with VS Team System Database Edition Power Tools (DBPro tool, SqlSchemeCompareTask).

Now we moved to SQLServer2012, VS2013. And I can't find DBPro tool for these versions. Only SqlPackage.exe, but it generate update script for sqlcmd mode (but script need simple to be used in own updater tool).

Could you advice smth, please.

Thanks.

Installing a service using MSDeploy

$
0
0

Hi there,

I would like to use MSDeploy(or alternative) to install an executable file which installs a background service on a remote server, copy the config files to the directory where the service has been installed, then start the service.

After the service has started i would like to execute my coded unit tests.

I would like to intergrate this functionality into part of the overnight build.

Do you recommend i use MSDeploy to do this or should i use "exec" task instead?

Also are there any tutorials here that i  can refer to in regards to MSDeploy/intergrating it as part of the build as i couldnt find any that were related to what i am trying to do?

Thanks

.Error from TFS Build server while attempting to build VS2013 version of code for first time

$
0
0

We have been using TFS 2010, and are now testing with TFS 2013.

We have a custom build using UpgradeTemplate.xaml, and have tested with existing build definitions using VS2008 and VS2010 on the new converted tfs 2013, which is also the build server.

I am testing trying to use the build server to build it with VS2013 projects and receive the following error:

C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\x64\Microsoft.Cpp.x64.Targets(514,5): error MSB8008: Specified platform toolset (v120) is not installed or invalid.

The solutions and projects have been converted to vs2013 and tested building from visual studio, however it seems like the build server wants to use the dot net version of msbuild rather than the visual studio version that supports VS2013 projects.  

A registry changes is eluded to in this email, but have tried a simple change of changing it to V120 and it did not help.

Thanks!


Larry

Why doesn't the activity log show the TestSettings file use when /verbosity=diag is used?

$
0
0

Since updating to VS 2013, our Coded UI Tests are not running after a build.  We've determined that the TestSettings file works when manually kicking the test off.  However when we use /verbosity=diag parameter on the build, we can't determine what TestSettings file is getting used.

How can we know it's using the right file?


closl

Viewing all 2763 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>