Avatar billede japping Nybegynder
10. januar 2009 - 10:19 Der er 15 kommentarer og
1 løsning

VB.NET error 9009 mht mt.exe fil

Jeg har hentet noget vb.net kode fra en leverandør. Når jeg forsøger at køre programmet kommer der nedenstående fejl udskrift (se nederst i dette spørgsmål), hvilket gør det umuligt at generere eksekverbare filer.

Fra leverandøren har jeg fået at vide, at fejlen skyldes brugen af gratisprogrammet "MS VB 2005 Express Edition", idet den officiele version inkluderer den manglende fil mt.exe. Men hvis man installerer "MS Software Development Kit" (SDK) fra linket http://www.microsoft.com/downloads/details.aspx?FamilyId=F26B1AA4-741A-433A-9BE5-FA919850BDBF&displaylang=en, så vil fejlen ophøre.

Mit problem er nu, at fejlen ikke er ophørt efter installation af SDK, idet jeg stadigvæk får nedenstående fejl. Er der nogen der har et bud på dette ? Kan det evt være et spørgsmål om at pege på filen mt.exe i VB.NET 2005 programmet ? og hvordan gør man det ?


--START------FEJL UDSKRIFT----------------
Error    1    The command ""C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\..\..\SDK\v2.0\bin\mt.exe" -manifest "C:\Users\Public\Documents\National Instruments\NI-DAQ\Examples\DotNET2.0\Analog In\Measure Voltage\AcqOneVoltageSample\vb\AcqOneVoltageSample.exe.manifest" -outputresource:"C:\Users\Public\Documents\National Instruments\NI-DAQ\Examples\DotNET2.0\Analog In\Measure Voltage\AcqOneVoltageSample\vb\bin\AcqOneVoltageSample.exe";#1
    " exited with code 9009.    AcqOneVoltageSample.2005
---SLUT-----FEJL UDSKRIFT----------------
Avatar billede arne_v Ekspert
10. januar 2009 - 16:33 #1
Express Edition er skam også helt officiel.  :-)

.NET 2.0 SDK indeholder MT.EXE, men den ligger et andet sted.


Directory of C:\Program Files\Microsoft.NET\SDK\v2.0\Bin

23-09-2005  06:56          709.632 mt.exe
              1 File(s)        709.632 bytes

Så måske drejer det sig bare om at få rettet den sti i build filen.
Avatar billede japping Nybegynder
10. januar 2009 - 17:39 #2
Hej arne !
Ok, men hvordan retter jeg den sti i build filen ?
Avatar billede arne_v Ekspert
10. januar 2009 - 23:22 #3
Godt spørgsmål !

Hvordan ser din .vbproj fil ud ?
Avatar billede japping Nybegynder
11. januar 2009 - 00:03 #4
Den ser således ud
----------- START -------------
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <ProjectType>Local</ProjectType>
    <ProductVersion>8.0.50727</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{6C93427D-B7BD-459A-8390-F978C0807450}</ProjectGuid>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ApplicationIcon>
    </ApplicationIcon>
    <AssemblyKeyContainerName>
    </AssemblyKeyContainerName>
    <AssemblyName>AcqGraphVoltage_MultiChannel_IntClk</AssemblyName>
    <AssemblyOriginatorKeyFile>
    </AssemblyOriginatorKeyFile>
    <AssemblyOriginatorKeyMode>None</AssemblyOriginatorKeyMode>
    <DefaultClientScript>JScript</DefaultClientScript>
    <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
    <DefaultTargetSchema>IE50</DefaultTargetSchema>
    <DelaySign>false</DelaySign>
    <OutputType>WinExe</OutputType>
    <OptionCompare>Binary</OptionCompare>
    <OptionExplicit>On</OptionExplicit>
    <OptionStrict>Off</OptionStrict>
    <RootNamespace>AcqGraphVoltage_MultiChannel_IntClk</RootNamespace>
    <StartupObject>AcqGraphVoltage_MultiChannel_IntClk.MainForm</StartupObject>
    <FileUpgradeFlags>
    </FileUpgradeFlags>
    <MyType>WindowsFormsWithCustomSubMain</MyType>
    <UpgradeBackupLocation>
    </UpgradeBackupLocation>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <OutputPath>bin\</OutputPath>
    <DocumentationFile>AcqGraphVoltage_MultiChannel_IntClk.xml</DocumentationFile>
    <BaseAddress>285212672</BaseAddress>
    <ConfigurationOverrideFile>
    </ConfigurationOverrideFile>
    <DefineConstants>
    </DefineConstants>
    <DefineDebug>true</DefineDebug>
    <DefineTrace>true</DefineTrace>
    <DebugSymbols>true</DebugSymbols>
    <Optimize>false</Optimize>
    <RegisterForComInterop>false</RegisterForComInterop>
    <RemoveIntegerChecks>false</RemoveIntegerChecks>
    <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
    <WarningLevel>1</WarningLevel>
    <NoWarn>42016,42017,42018,42019,42032</NoWarn>
    <DebugType>full</DebugType>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <OutputPath>bin\</OutputPath>
    <DocumentationFile>AcqGraphVoltage_MultiChannel_IntClk.xml</DocumentationFile>
    <BaseAddress>285212672</BaseAddress>
    <ConfigurationOverrideFile>
    </ConfigurationOverrideFile>
    <DefineConstants>
    </DefineConstants>
    <DefineDebug>false</DefineDebug>
    <DefineTrace>true</DefineTrace>
    <DebugSymbols>false</DebugSymbols>
    <Optimize>true</Optimize>
    <RegisterForComInterop>false</RegisterForComInterop>
    <RemoveIntegerChecks>false</RemoveIntegerChecks>
    <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
    <WarningLevel>1</WarningLevel>
    <NoWarn>42016,42017,42018,42019,42032</NoWarn>
    <DebugType>none</DebugType>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="NationalInstruments.Common">
      <Name>NationalInstruments.Common</Name>
      <HintPath>..\..\..\..\..\..\..\Program Files\National Instruments\MeasurementStudioVS2003\DotNET\Assemblies\Current\NationalInstruments.Common.dll</HintPath>
      <AssemblyFolderKey>hklm\nationalinstruments</AssemblyFolderKey>
    </Reference>
    <Reference Include="NationalInstruments.DAQmx">
      <Name>NationalInstruments.DAQmx</Name>
      <HintPath>..\..\..\..\..\..\..\Program Files\National Instruments\MeasurementStudioVS2003\DotNET\Assemblies\Current\NationalInstruments.DAQmx.dll</HintPath>
      <AssemblyFolderKey>hklm\nationalinstruments</AssemblyFolderKey>
    </Reference>
    <Reference Include="NationalInstruments.UI">
      <Name>NationalInstruments.UI</Name>
      <HintPath>..\..\..\..\..\..\..\Program Files\National Instruments\MeasurementStudioVS2003\DotNET\Assemblies\Current\NationalInstruments.UI.dll</HintPath>
      <AssemblyFolderKey>hklm\nationalinstruments</AssemblyFolderKey>
    </Reference>
    <Reference Include="NationalInstruments.UI.WindowsForms">
      <Name>NationalInstruments.UI.WindowsForms</Name>
      <HintPath>..\..\..\..\..\..\..\Program Files\National Instruments\MeasurementStudioVS2003\DotNET\Assemblies\Current\NationalInstruments.UI.WindowsForms.dll</HintPath>
      <AssemblyFolderKey>hklm\nationalinstruments</AssemblyFolderKey>
    </Reference>
    <Reference Include="System">
      <Name>System</Name>
    </Reference>
    <Reference Include="System.Data">
      <Name>System.Data</Name>
    </Reference>
    <Reference Include="System.Drawing">
      <Name>System.Drawing</Name>
    </Reference>
    <Reference Include="System.Windows.Forms">
      <Name>System.Windows.Forms</Name>
    </Reference>
    <Reference Include="System.Xml">
      <Name>System.XML</Name>
    </Reference>
  </ItemGroup>
  <ItemGroup>
    <Import Include="Microsoft.VisualBasic" />
    <Import Include="NationalInstruments" />
    <Import Include="NationalInstruments.UI" />
    <Import Include="System" />
    <Import Include="System.Collections" />
    <Import Include="System.Data" />
    <Import Include="System.Diagnostics" />
    <Import Include="System.Drawing" />
    <Import Include="System.Windows.Forms" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="AssemblyInfo.vb">
      <SubType>Code</SubType>
    </Compile>
    <Compile Include="MainForm.vb">
      <SubType>Form</SubType>
    </Compile>
    <EmbeddedResource Include="licenses.licx" />
    <EmbeddedResource Include="MainForm.resx">
      <DependentUpon>MainForm.vb</DependentUpon>
      <SubType>Designer</SubType>
    </EmbeddedResource>
  </ItemGroup>
  <Import Project="$(MSBuildBinPath)\Microsoft.VisualBasic.targets" />
  <PropertyGroup>
    <PreBuildEvent>
    </PreBuildEvent>
    <PostBuildEvent>
    </PostBuildEvent>
  </PropertyGroup>
</Project>
---------- SLUT -------------------
Avatar billede arne_v Ekspert
11. januar 2009 - 00:12 #5
Mystisk - der er ingen ref til mt.exe eller manifest i det.
Avatar billede japping Nybegynder
11. januar 2009 - 15:22 #6
Jeg har fundet ud af, at hvis jeg kigger i filen "My Project" hørende til projektet, åbner fanen "Publish" og trykker på knappen "Application Files..", så får jeg følgende liste frem:
------ LISTE START -------
App.ico                          Include (Auto)          (Required)
mt.exe                        Include (Auto)          (Required)
My Project\Application.myapp  Include (Auto)          (Required)
NationalInstruments.Common.dll Prerequisite (Auto)    (None)
NationalInstruments.Common.Native.dll    Prerequisite (Auto)    (None)
NationalInstruments.DAQmx.dll    Prerequisite (Auto)    (None)
------ LISTE SLUT --------
Så her er mt.exe altså påkrævet. Men hvordan fortæller jeg MS VB.NET hvor filen er installeret ? Og giver dette mening ?
Avatar billede arne_v Ekspert
11. januar 2009 - 15:34 #7
Godt spørgsmål.

Tools
External tools

måske
Avatar billede japping Nybegynder
11. januar 2009 - 15:43 #8
Jeg har denne vejledning fra National Instrument:
------------ START VEJLEDNING ------------
Here is a summary of the changes we made to get your Visual Basic Express Edition development environment up and running.

1) Error code 9009: The issue in this case is that the Visual Studio Express Editions don't install this mt.exe tool required by our examples and thus our examples fail when building since that tool can't be found.
This tool does come with the official version of Visual Studio 2005. To resolve this issue, download the Microsoft Windows Software Development Kit
(SDK) from the Microsoft Web site. The Windows SDK for Windows Server and .NET Framework 3.5 contains the mt.exe tool.
(http://www.microsoft.com/downloads/details.aspx?FamilyId=F26B1AA4-741A-433A-9BE5-FA919850BDBF&displaylang=en)

2) Warning "Referenced assembly targets a different processor than the application. " This problem is due to 32bit/64bit application target and driver incompatibilities. Quoted from MSDN: "Most existing COM components are only available for 32-bit platforms and will not run in a 64-bit process on a 64-bit platform (although they will run correctly in a 32-bit process on a 64-bit platform). VB and C# applications that reference these 32bit COM components will not run by default on a 64-bit platform because by default the application will launch as a 64-bit process.

The problem appears when a project with one or more COM references is:
1. Migrated to Visual Studio 2005 and executed on 64-bit platforms

-or-
2. Created using Visual Studio 2005 on 64-bit platforms.
In Visual Studio 2005, the VB and C# compilers use the platform target property to determine if the.exe or .dll should run in 32-bit or 64-bit CPU architecture mode. The default setting for this property in Visual Studio
2005 is set to 'AnyCPU', which indicates that the application can run in either 32-bit or 64-bit mode, depending on the host platform. In this situation you may see a message such as "Cannot instantiate class..." when you debug or run these applications."

To resolve this issue, "The VB and C# Express products do not expose the Target property inside the development environment. You will need to carefully modify the project file using a text or XML editor.
1. Close the project and/or solution
2. Select Open File from the File menu
3. Navigate to the project directory, and highlight the project file 4. Press the Open button, the project file should open in the XML editor 5. Locate the first section and add the following line:
x86
6. Save the project file
7. Reopen the project and/or solution using Open Project/Solution from the File menu 8. Continue with development, debugging, and testing"

Hope this is what you needed. I will leave this service request open for an additional five days to make sure you can get a direct line to me in the event you need more information. Have a great weekend!
------------- SLUT VEJLEDNING ------------
Avatar billede japping Nybegynder
11. januar 2009 - 16:57 #9
Efter at have slået "Warnings" til i VB.NET får jeg følgende warning før fejlen:
---------- START -----------
Warning    1    Could not read state file "obj\Release\ResolveAssemblyReference.cache". Unable to cast object of type 'Microsoft.Build.Tasks.SystemState' to type 'Microsoft.Build.Tasks.StateFileBase'.    AcqOneVoltageSample.2005
----------------------------

Giver det noget ?

Jeg har forsøgt at tilføje mt.exe til external tools, men det hjælper ikke.
Avatar billede japping Nybegynder
11. januar 2009 - 16:59 #10
tilføjelse af "x86" som nævnes i National Instrument vejledningen, kan jeg ikke finde ud af, hvor skal placeres.
Avatar billede japping Nybegynder
11. januar 2009 - 17:39 #11
Der fulgte 2 versioner af test-programmet med da jeg købte National Instrument softwaren. Der var en DotNET1.1 og en DotNET2.0, og i ovenstående indlæg har jeg kun beskæftiget mig med DotNET2.0.

Men efte at have prøvet DotNET1.1 versionen, kan jeg godt lave en "build" uden fejl. Nu får jeg kun følgende 3 stk. "Warnings":
------------ START ----------------
Warning    1    Referenced assembly 'C:\Program Files\National Instruments\MeasurementStudioVS2005\DotNET\Assemblies\Current\NationalInstruments.Common.Native.dll' targets a different processor than the application.    AcqOneVoltageSample
Warning    2    Referenced assembly 'C:\Program Files\National Instruments\NI-DAQmx Base 3.0\MeasurementStudioVS2005\DotNET\Assemblies\Current\NationalInstruments.DAQmx.dll' targets a different processor than the application.    AcqOneVoltageSample
Warning    3    Found conflicts between different versions of the same dependent assembly.    AcqOneVoltageSample
------------ STOP ----------------

Har du nogle gode råd mht. disse warnings ?
Avatar billede arne_v Ekspert
11. januar 2009 - 20:50 #12
Det betyder at der er nogle forskellige typer kode: .NET, native x86, native x86-64.

Virker det ?
Avatar billede japping Nybegynder
11. januar 2009 - 23:33 #13
Ja, DotNet1.1 koden virker.
Ved du hvorfor DotNet2.0 koden ikke virker ?

Læg et svar for din indsats.
Avatar billede arne_v Ekspert
12. januar 2009 - 04:11 #14
Det virker som om at den leder efter MT.EXE i det forkerte dir. En mulighed var at oprette
det dir hvor den søger og kopiere den derover.

Alternativet er at finde ud af hvor placeringen er angivet.

Meget svært at troubleshoote remote.

Og et svar.
Avatar billede arne_v Ekspert
12. januar 2009 - 04:12 #15
om igen
Avatar billede japping Nybegynder
12. januar 2009 - 23:49 #16
tak for input. det vil jeg prøve.
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Kurser inden for grundlæggende programmering

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester