本文介绍了x64警告CS1607的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想为x86和x64平台构建我的程序集C#.为此,我在C:\ WINDOWS \ Microsoft.NET \ Framework中具有32位框架,而在64位框架中具有64位框架.在C:\ WINDOWS \ Microsoft.NET \ Framework64中.

I would like to build my assembly C# for the platforms x86 and x64. For that, I have the 32bits Framework in C:\WINDOWS\Microsoft.NET\Framework and the 64bits Framework  in C:\WINDOWS\Microsoft.NET\Framework64.

当我为x86平台构建程序集时,就可以了. .dll来自32位框架:

When I build my assembly for the platforms x86, it's OK. The .dll came from the 32bits Framework:

C:\ WINDOWS \ Microsoft.NET \ Framework \ v2.0.50727 \ Csc.exe/noconfig/unsafe-/checked-/nowarn:1701,1702/nostdlib-/platform:x86/errorreport:prompt/warn:4 /baseaddress:285212672/define:DEBUG; TRACE /reference:C:\ WINDOWS \ Microsoft.NET \ Framework \ v2.0.50727 \ System.Data.dll /参考:C:\ WINDOWS \ Microsoft.NET \ Framework \ v2.0.50727 \ System.dll/参考:C:\ WINDOWS \ Microsoft.NET \ Framework \ v2.0.50727 \ System.Drawing.dll/reference:C:\ WINDOWS \ Microsoft.NET \ Framework \ v2.0.50727 \ System.Windows.Forms.dll/reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll/debug +/debug:full/filealign :4096/optimize-/out:obj\win32\Debug\ASCommun.dll/resource:obj\win32\Debug\ASCommun.AScComposant.resources/resource:obj\win32\Debug\ASCommun.AScComposantDispositif.resources/resource:obj \ win32 \ Debug \ ASCommun.AScComposantVirtuel.resources/resource:obj\win32\Debug\ASCommun.AScConnecteur.resources/resource:obj\win32\Debug\ASCommun.AScDlgCriteresRe cherche.resources/resource:obj\win32\Debug\ASCommun.AScDlgSelPropCatalog.resources/resource:obj\win32\Debug\ASCommun.AScGroupBoxAccessoires.resources/resource:obj\win32\Debug\ASCommun.AScPanelComposants.resources/resource:obj \ win32 \ Debug \ ASCommun.AScPanelProprietes.resources/resource:obj\win32\Debug\ASCommun.AScProgressBar.resources/resource:obj\win32\Debug\ASCommun.AScTabCatalog.resources/resource:obj\win32\Debug\ASCommun.TreeViewEx.资源/target:library/warnaserror- API.cs AScAccesBD.cs AScAccesLocale.cs AScBaseCompoGrpCts.cs AScCBoxItem.cs AScComposant.cs AScComposantDispositif.cs AScComposantVirtuel.cs AScConnecteur.cs AScConteneurp. AScEnumList.cs AScEnumListPN.cs AScEnvironnement.cs AScEvenement.cs AScFactory.cs AScGestionPropAction.cs AScGroupBoxAccessoires.cs AScInterfaceCatalogNet.cs AScInterfaceXML.cs AScMatrice2D.cs AScNoeud.cs AScPanelPaesCompesants.cs cs AScProgressBar.cs AScPropriete.cs AScPropTreeNode.cs AScTabCatalog.cs AScTabIdentification.cs AScUnites.cs ASiAccesBD.cs ASiCBoxItem.cs ASiComposant.cs ASiConnecteur.cs ASiConteneurProprietecscs ASiEvenement.cs ASiFaceSiSiSiSiBar.cs .cs ASiUnite.cs AssemblyInfo.cs GenericEventArgs.cs InterfaceCatalog.cs NomTypePropriete.cs PanelExt.cs PointRepere.cs TreeViewEx.cs

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Csc.exe /noconfig /unsafe- /checked- /nowarn:1701,1702 /nostdlib- /platform:x86 /errorreport:prompt /warn:4 /baseaddress:285212672 /define:DEBUG;TRACE /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Drawing.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Windows.Forms.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll /debug+ /debug:full /filealign:4096 /optimize- /out:obj\win32\Debug\ASCommun.dll /resource:obj\win32\Debug\ASCommun.AScComposant.resources /resource:obj\win32\Debug\ASCommun.AScComposantDispositif.resources /resource:obj\win32\Debug\ASCommun.AScComposantVirtuel.resources /resource:obj\win32\Debug\ASCommun.AScConnecteur.resources /resource:obj\win32\Debug\ASCommun.AScDlgCriteresRecherche.resources /resource:obj\win32\Debug\ASCommun.AScDlgSelPropCatalog.resources /resource:obj\win32\Debug\ASCommun.AScGroupBoxAccessoires.resources /resource:obj\win32\Debug\ASCommun.AScPanelComposants.resources /resource:obj\win32\Debug\ASCommun.AScPanelProprietes.resources /resource:obj\win32\Debug\ASCommun.AScProgressBar.resources /resource:obj\win32\Debug\ASCommun.AScTabCatalog.resources /resource:obj\win32\Debug\ASCommun.TreeViewEx.resources /target:library /warnaserror- API.cs AScAccesBD.cs AScAccesLocale.cs AScBaseCompoGrpCts.cs AScCBoxItem.cs AScComposant.cs AScComposantDispositif.cs AScComposantVirtuel.cs AScConnecteur.cs AScConteneurPropriete.cs AScDefComProp.cs AScDefinitions.cs AScDlgCriteresRecherche.cs AScDlgSelPropCatalog.cs AScEnumList.cs AScEnumListPN.cs AScEnvironnement.cs AScEvenement.cs AScFactory.cs AScGestionPropAction.cs AScGroupBoxAccessoires.cs AScInterfaceCatalogNet.cs AScInterfaceXML.cs AScMatrice2D.cs AScNoeud.cs AScPanelComposants.cs AScPanelProprietes.cs AScProgressBar.cs AScPropriete.cs AScPropTreeNode.cs AScTabCatalog.cs AScTabIdentification.cs AScUnites.cs ASiAccesBD.cs ASiCBoxItem.cs ASiComposant.cs ASiConnecteur.cs ASiConteneurPropriete.cs ASiEvenement.cs ASiFactory.cs ASiInterfaceXML.cs ASiNoeud.cs ASiProgressBar.cs ASiPropriete.cs ASiUnite.cs AssemblyInfo.cs GenericEventArgs.cs InterfaceCatalog.cs NomTypePropriete.cs PanelExt.cs PointRepere.cs TreeViewEx.cs

当我为x64平台构建程序集时,.dll也来自32位框架:

C:\ WINDOWS \ Microsoft.NET \ Framework \ v2.0.50727 \ Csc.exe/noconfig/nowarn:1701,1702/platform:x64/errorreport:提示/baseaddress:285212672/define:DEBUG; TRACE /reference:C:\ WINDOWS \ Microsoft.NET \ Framework \ v2.0.50727 \ System.Data.dll /reference:C:\WINDOWS\Microsoft.NET\Framework \ v2.0.50727 \ System.dll/reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Drawing.dll/reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System .Windows.Forms.dll/reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll/debug +/debug:full/out:obj\x64\Debug\ASCommun.dll/resource: obj \ x64 \ Debug \ ASCommun.AScComposant.resources/resource:obj\x64\Debug\ASCommun.AScComposantDispositif.resources/resource:obj\x64\Debug\ASCommun.AScComposantVirtuel.resources/resource:obj \ x64 \ Debug \ ASCommunun. AScConnecteur.resources/resource:obj\x64\Debug\ASCommun.AScDlgCriteresRecherche.resources/resource:obj\x64\Debug\ASCommun.AScDlgSelPropCatalog.resou rces/resource:obj\x64\Debug\ASCommun.AScGroupBoxAccessoires.resources/resource:obj\x64\Debug\ASCommun.AScPanelComposants.resources/resource:obj\x64\Debug\ASCommun.AScPanelProprietes.resources/resource:obj \ x64 \ Debug \ ASCommun.AScProgressBar.resources/resource:obj\x64\Debug\ASCommun.AScTabCatalog.resources/resource:obj\x64\Debug\ASCommun.TreeViewEx.resources/target:library API.cs AScAccesBD.cs AScAccesLocale.cs AScBaseCompoGrpCts cs AScCBoxItem.cs AScComposant.cs AScComposantDispositif.cs AScComposantVirtuel.cs AScConnecteur.cs AScConteneurPropriete.cs AScDefComProp.cs AScDefinitions.cs AScDlgCriteresRecherche.cs AScvenccscscsc .cs AScInterfaceCatalogNet.cs AScInterfaceXML.cs AScMatrice2D.cs AScNoeud.cs AScPanelComposants.cs AScPanelProprietes.cs AScProgressBar.cs AScPropriete.cs AScPropTreeNode.cs AScTabcatalog.cs AScTabIdentification.cs s.cs ASiAccesBD.cs ASiCBoxItem.cs ASiComposant.cs ASiConnecteur.cs ASiConteneurPropriete.cs ASiEvenement.cs ASiFactory.cs ASiInterfaceXML.cs ASiNoeud.cs ASiProgressBar.cs ASiPropriete.cs ASiUnite.cs AssemblyInfo.cs NoricTypeProprisProlog cs PanelExt.cs PointRepere.cs TreeViewEx.cs

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Csc.exe /noconfig /nowarn:1701,1702 /platform:x64 /errorreport:prompt /baseaddress:285212672 /define:DEBUG;TRACE /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Drawing.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Windows.Forms.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll /debug+ /debug:full /out:obj\x64\Debug\ASCommun.dll /resource:obj\x64\Debug\ASCommun.AScComposant.resources /resource:obj\x64\Debug\ASCommun.AScComposantDispositif.resources /resource:obj\x64\Debug\ASCommun.AScComposantVirtuel.resources /resource:obj\x64\Debug\ASCommun.AScConnecteur.resources /resource:obj\x64\Debug\ASCommun.AScDlgCriteresRecherche.resources /resource:obj\x64\Debug\ASCommun.AScDlgSelPropCatalog.resources /resource:obj\x64\Debug\ASCommun.AScGroupBoxAccessoires.resources /resource:obj\x64\Debug\ASCommun.AScPanelComposants.resources /resource:obj\x64\Debug\ASCommun.AScPanelProprietes.resources /resource:obj\x64\Debug\ASCommun.AScProgressBar.resources /resource:obj\x64\Debug\ASCommun.AScTabCatalog.resources /resource:obj\x64\Debug\ASCommun.TreeViewEx.resources /target:library API.cs AScAccesBD.cs AScAccesLocale.cs AScBaseCompoGrpCts.cs AScCBoxItem.cs AScComposant.cs AScComposantDispositif.cs AScComposantVirtuel.cs AScConnecteur.cs AScConteneurPropriete.cs AScDefComProp.cs AScDefinitions.cs AScDlgCriteresRecherche.cs AScDlgSelPropCatalog.cs AScEnumList.cs AScEnumListPN.cs AScEnvironnement.cs AScEvenement.cs AScFactory.cs AScGestionPropAction.cs AScGroupBoxAccessoires.cs AScInterfaceCatalogNet.cs AScInterfaceXML.cs AScMatrice2D.cs AScNoeud.cs AScPanelComposants.cs AScPanelProprietes.cs AScProgressBar.cs AScPropriete.cs AScPropTreeNode.cs AScTabCatalog.cs AScTabIdentification.cs AScUnites.cs ASiAccesBD.cs ASiCBoxItem.cs ASiComposant.cs ASiConnecteur.cs ASiConteneurPropriete.cs ASiEvenement.cs ASiFactory.cs ASiInterfaceXML.cs ASiNoeud.cs ASiProgressBar.cs ASiPropriete.cs ASiUnite.cs AssemblyInfo.cs GenericEventArgs.cs InterfaceCatalog.cs NomTypePropriete.cs PanelExt.cs PointRepere.cs TreeViewEx.cs

并且有一些警告CS1607:

警告CS1607:程序集生成-引用的程序集'System.Data.dll'针对其他处理器

警告CS1607:程序集生成-引用的程序集"mscorlib.dll"针对其他处理器

那我如何在.csproj中指示在哪里找到权限.dll?我尝试使用属性"HintPath".但是我无法使用"mscorlib.dll"来执行此操作,并且此属性仅在"ItemGroup"中可用,而在"PropertyGroup"中不可用!

< ItemGroup >

< 参考 包含 = "系统" >

< 名称 > 系统</ 名称 >

< HintPath > C:\ WINDOWS \ Microsoft.NET \ Framework64 \ v2.0.50727 \ System.dll </ HintPath >

<HintPath>C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\System.dll</HintPath>

</ 参考 >

</Reference>

...

</ ItemGroup >

</ItemGroup>

预先感谢

推荐答案

也许是,我必须在预构建或de.csproj中更改环境上下文,例如vsvars32.bat或sdkvars.bat以指示良好的csc.exe.

May be, I have to change context of the environment in the pre-build or in de .csproj like vsvars32.bat or sdkvars.bat to indicate the good csc.exe.

但是,我不知道如何!

有什么主意吗?

谢谢


这篇关于x64警告CS1607的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-11 20:01