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

known desugar bug in VS2017

$
0
0

I'm trying to build a Xamarin.Android project which references a DLL that I created by binding an AAR. I understand there is a known error in VS2017 where the desugaring processing isn't working properly.

From Github: "The first fix here is to add the `--classpath_entry` flag for every `--input`, for some reason `Desugar` is not treating `--input` jars as classpath entries".

From Stackoverflow: "The bug is already tracked and fixed in Visual Studio 2019 Preview 2."

My question: Does Microsoft plan to fix this bug in VS2017 also?
Thanks in advance.


VS Compiler Problem

$
0
0
In VS 2017 I have a class called "Common" that includes various useful functions to the rest of the classes.

If I extract one of the functions and include it in a new class, when I try to compile the class "Common" it tells me that the class that I have extracted does not exist.
The extracted class can not be compiled if I do not compile the "Common" class first.Solution?

VS Compact all the dlls in one

$
0
0
In VS 2017 I have a project with different dlls.When compiling I want all the dlls to be included in the compiled as a single dll.solution?

Visual Studio 2019 Join Session

$
0
0
Greeting everyone!  I am looking to get train in Visual Studio 2019. I never coded in my life. I watch the live demo of Visual Studio 2019 and love it. Is there anyone who can take the time and show me a few things to get started  in coding. Like making Radio buttons, buttons, text. If I have to pay there is options for that. Thank you all 

VB3 and KB 4493509 error

$
0
0
OPERATING SYSTEM: Windows 10 Home 32 bit
+ VB3 Runtime
UPDATE: KB 4493509 -> 2019.04.12
If this update is included in the windows then - any form that contains an MS (hscroll or vscroll) component will stop in the form_load event.
- In VB3, an error occurs immediately if you want to install a hscroll or vscroll component.
After removing the update, the error is resolved, but automaticly install back next update.

Driver menu option not visible in visual studio 2017

$
0
0

I have installed visual studio 2017 enterprise followed by WDK 10 installation. The driver menu is not appearing in the tool bar. Also I am not able to build my existing driver project which otherwise is working with Visual studio 2013. The error message I am receiving is 

ErrorMSB4019 The imported project "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.cpp.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.infraC:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\Microsoft.Cpp.Redirect.12.props

MSBuild for .Net Core 3.0 Preview

$
0
0

Hi ,

I am not able to generate a SonarQube report for .NET Core 3.0 preview, it is throwing errors. I have installed latest MSBuild from "Visual Studio Build Tools". Can anyone help me in this?

Thanks in advance

Srini

MS software VS2015 install the Qt VS Tools open Qt Project file(.pro) and Debug(F5) or build(Rebuild solution),then cpmpile error MSB8020

$
0
0

Hi everyone:

        As  the title write,I'll be brief!

        I know that we can chose to correct the project attribute and set Configuration properties-regualr-Platform Tools set :change to "Visual Studio 2015(v140)",make sure the configuration!!

       After these configuration,Debug(F5) or build(Rebuild solution) compile error:LNK1158 cannot run "rc.exe",Follow the net resource to copy WINSDK rc.exe and rcdll.dll file to the folder (c:\Program Files(x86)\Microsoft Visual Studio 14.0\VC\bin),but I found the compile error is still exist!!!


LNK1318: Unexpected PDB error; RPC (23)

$
0
0

MSBuild randomly keep producing these errors for us:

LINK : fatal error LNK1318: Unexpected PDB error; RPC (23) '(0x000006BA)'

If we recompile the same code, the error goes away. This is extremely problematic in our CI/CD setup since every once in a while we get a failed build that doesn't have any issues in the code. 

MSBuild actually still produces a binary despite the fatal error, but it an't be run. If you try to run it you get an error message stating the "This app can not run on your PC".

This seem to be a bug, so is there a patch or workaround? If not then is there any documentation on it so I can find out the cause?

SetEnv does not work

$
0
0

Hello

I use VS community 2017 15.9.12

I wish to set an environment variable

I put this target in a Project.

$(OracleBaseDir) is not empty (and I have tried with c:\temp, same result)

    <Target Name="SetMyTNSvar" BeforeTargets="ClCompile" >
        <SetEnv  Name="TNS_ADMIN" Prefix="false" Value="$(OracleBaseDir)" />
        <Message Importance="High"
                Text="TNS_ADMIN envar is $(TNS_ADMIN) " />
    </Target>

My variable TNS_ADMIN is always empty. (It does not exists in the computer env)

What do I do wrong ?

Thank you !

Customizing compile options based on an Item property associated to a source file

$
0
0

Hi,

I am trying to simplify C++ projects (.vcxproj) that have common patterns for properties associated with source files.

For example:

  <ItemGroup>
    <ClCompileInclude="SourceFile.cpp">
      <DisableLanguageExtensions>false</DisableLanguageExtensions>
      ... and many other settings ...
    </ClCompile>

And replace it with something like:

  <ImportProject="BuildSettings.props"/>
  <ItemGroup>
    <ClCompileInclude="SourceFile.cpp">
      <CustomBuildProperty>ABC</CustomBuildProperty>
    </ClCompile>

Where "BuildSettings.props" can handle all the settings when this CustomBuildProperty is set to ABC.

I thought I could do something like this in BuildSettings.props:

  <ItemDefinitionGroup>
    <ClCompileCondition="'%(ClCompile.CustomBuildProperty)' == 'ABC'">
      <DisableLanguageExtensions>false</DisableLanguageExtensions>
      ... and many other settings ...
    </ClCompile>
  </ItemDefinitionGroup>

But this doesn't seem to work?

Is this something that MSBuild can do? Is there something wrong with the approach above?

Thanks
Brian

Access is denied on .CoreCompileInputs.Cache

$
0
0

Using Visual Studio 2019 on Windows 7.  Same issue happens on VS 2015 and 2017 as well.

I can create a project and build it once, subsequent build yields this error....

ErrorCould not write lines to file "obj\Debug\ConverterTester.csproj.CoreCompileInputs.cache". Access to the path 'C:\Users\Jeff\Contracting\Brightbean\Projects\DocConverter\ConverterTester\obj\Debug\ConverterTester.csproj.CoreCompileInputs.cache' is denied.

I am an ADMIN on the box, and I run VS 'As Administrator' for good measure.  If I reboot, I can build once and the cycle repeats.  Something is holding this file open for some reason, but I can't find it.

I have read other things about permissions, and if the project is under source control.  Permissions is not an issue and I am using no source control at all.


JAE

VS 2019 VB How to save a DataTable into sql Database

$
0
0

Hi team

I have a datatable and or dataset that have been filled from a csv file which is working fine.

This I display in a unbound data Grid. So I can see the data.

I need to insert the data in the datatable or dataset into an Sql Database.

I can use either the datatable OR dataset which ever is the best. 

The SQL Column headers match the Column headers in the datatable that was in the csv file.

I delete the contents of the SQL Database just before inserting and reset the Key back to 1

Note the Datatable do's not have the Key ID which is in the SQL Database.

So all I need is a simple way to insert this data into the SQL Database.

My Code I have tryed:

    Protected Sub UpdateDriversLicence(dt As DataTable)
        Dim connectionString As String = MySQLString
        Dim queryString As String = "SELECT ID, ValidCompetitionLicence,ValidOfficialLicence, LicenceNumber, LastName, FirstName, DateValidated, CompetitionLicenceExpiryDate, OfficialLicenceExpiryDate, CompetitionLicenceSuspended, OfficialLicenceSuspended, LicenceDescription EventID  FROM CAMScsvFileData"

        Using connection As SqlConnection = New SqlConnection(connectionString)
            connection.Open()
            Dim adapter As SqlDataAdapter = New SqlDataAdapter()
            adapter.SelectCommand = New SqlCommand(queryString, connection)
            Dim builder As SqlCommandBuilder = New SqlCommandBuilder(adapter)
            builder.RefreshSchema()
            Try
                adapter.Fill(dt)
                adapter.InsertCommand = builder.GetUpdateCommand()
                '' adapter.UpdateCommand = builder.GetUpdateCommand()
                adapter.Update(dt)

            Catch ex As Exception
                MsgBox("The Error : " & ex.ToString)
            End Try

        End Using

    End Sub

Regards

Ron B






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

$
0
0

after adding my custom plugin in WIRESHARK I am getting this error.

  "C:\Development\wsbuild64\Wireshark.sln" (default target) (1) ->
       "C:\Development\wsbuild64\plugins\epan\homematic\homematic.vcxproj.metaproj" (default target) (28) ->
       "C:\Development\wsbuild64\plugins\epan\homematic\homematic.vcxproj" (default target) (133) ->
       (CustomBuild target) ->
         C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(209,5): error MSB6006: "cmd.exe"
        exited with code 1. [C:\Development\wsbuild64\plugins\epan\homematic\homematic.vcxproj]


Kindly help. Code is in C

"cmd.exe" could not be run.

$
0
0

Yesterday security was messing around with McAfee settings and all of a sudden I could not build my solution. I had the following one error:

The specified task executable "cmd.exe" could not be run. System.IO.IOException: Failed to create a temporary file. Temporary files folder is full or its path is incorrect. Access to the path 'C:\Users\hsimpson\AppData\Local\Temp\tmp77de4b0230e0494787ccfe80380a149a.exec.cmd' is denied. ---> System.UnauthorizedAccessException: Access to the path 'C:\Users\hsimpson\AppData\Local\Temp\tmp77de4b0230e0494787ccfe80380a149a.exec.cmd' is denied.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.StreamWriter.CreateFile(String path, Boolean append, Boolean checkHost)
   at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize, Boolean checkHost)
   at System.IO.File.InternalWriteAllText(String path, String contents, Encoding encoding, Boolean checkHost)
   at System.IO.File.WriteAllText(String path, String contents)
   at Microsoft.Build.Shared.FileUtilities.GetTemporaryFile(String directory, String extension, Boolean createFile)
   --- End of inner exception stack trace ---
   at Microsoft.Build.Shared.FileUtilities.GetTemporaryFile(String directory, String extension, Boolean createFile)
   at Microsoft.Build.Tasks.Exec.CreateTemporaryBatchFile()
   at Microsoft.Build.Tasks.Exec.AddCommandLineCommands(CommandLineBuilderExtension commandLine)
   at Microsoft.Build.Tasks.ToolTaskExtension.GenerateCommandLineCommands()
   at Microsoft.Build.Utilities.ToolTask.Execute() SaleSuggestions   

There was another file too created and it contained:

UNHANDLED EXCEPTIONS FROM PROCESS 22552:
=====================
5/31/2019 7:54:20 AM
System.IO.IOException: Pipe is broken.
   at System.IO.Pipes.PipeStream.WinIOError(Int32 errorCode)
   at System.IO.Pipes.PipeStream.BeginWriteCore(Byte[] buffer, Int32 offset, Int32 count, AsyncCallback callback, Object state)
   at System.IO.Pipes.PipeStream.WriteCore(Byte[] buffer, Int32 offset, Int32 count)
   at System.IO.Pipes.PipeStream.Write(Byte[] buffer, Int32 offset, Int32 count)
   at Microsoft.Build.BackEnd.NodeEndpointOutOfProcBase.RunReadLoop(Stream localReadPipe, Stream localWritePipe, ConcurrentQueue`1 localPacketQueue, AutoResetEvent localPacketAvailable, AutoResetEvent localTerminatePacketPump)
===================

I cleaned up the Temp file and that didn't help.  It's like there is still a permissions error.

Any Ideas?  Anyone else running into this McAfee issue?


Question

$
0
0
How i can create a searching machine with visual studio community 2019?

I am trying to run a python script before I compile a C++ project

$
0
0

From what I understand from:
https://docs.microsoft.com/en-us/visualstudio/ide/specifying-custom-build-events-in-visual-studio?view=vs-2019
https://docs.microsoft.com/en-us/cpp/build/specifying-build-events?view=vs-2019
https://docs.microsoft.com/en-us/cpp/build/understanding-custom-build-steps-and-build-events?view=vs-2019
I should right click the project and add the line 

call 'py $(ProjectDir)precompile.py $(ProjectDir)'

in build events but I cannot get it to work.
I managed to remove the errors dissiperar by wrapping a bat file around it and having the line

cmd '$(ProjectDir)precompile.bat $(ProjectDir)'

in the pre build event.

The bat file is this:

echo "Calling the python file"
C:\Windows\py.exe %1precompile.py %1
echo "After the python file"

What it comes down to is I want to execute a python file before I compile the C++ code and I cannot figure out how to do it. And the Python code need to know the path to the project. 

(I know I could just run the script in a shell outside Visual Studio but I should not need to.)

How to build C# program from command line for VS 2019?

$
0
0

I build my VS 2019 C++ projects with a script that looks like this:

call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Auxiliary\Build\vcvarsall.bat" x64
msbuild.exe  Viewer2.sln /t:Clean,Build /p:Configuration=Release /p:Platform=x64

if NOT ["%errorlevel%"]==["0"] pause

On another machine, I only have VS 2019 installed with C# tooling. On that machine there is no vcvarsall.bat file under Visual Studio 2019 directories, so I'm not sure how to script building the project so that I know that the version of msbuild.exe which is being used is correct. Do I have to just hard code the path the msbuild.exe on that machine? That doesn't seem correct.

How to upgrade from D14REL to Update 3

$
0
0

When I take a look at my Visual Studio to confirm which update version it is, it said "D14REL" as below. It is my understanding there are update 1, 2 and 3. What does the "D14REL" means? I do need to upgrade it to update 3 for security reason, but it is installed on stand-alone workstation. No internet access allowed. How can I upgrade it manually?

 

An error occurred when merging assemblies,VS 2017 web deploy

$
0
0

Hello

I am using visual studio 2017 to build and publish my website.

I bought a new laptop and moved my website code to it and installed visual studio.On the new laptop when i publish using web deploy and merge output into one assembly I am getting this error on preview

An error occurred when merging assemblies: Object reference not set to an instance of an object.

Nothing have changed in my code.It publishes successfully on old laptop using same visual studio.

I tried to create a new website and tried to do the publish I noticed that I get the error once i add .vb class or .aspx.vb file to the website.Build is successful

These are the solution i found online and i tried but with no luck:

- disabled antivirus,McAfee firewall,windows defender firewall.

- removed dlls under Bin folder

- running visual studio as administrator

- uninstalled  and reinstalled visual studio again



Viewing all 2763 articles
Browse latest View live


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