簡體   English   中英

Windows Phone 7:構建netmodule和dll

[英]Windows Phone 7 : build netmodule and dll

在我的Windows Phone 7項目中,我嘗試在模塊中分離源文件。

這是我在做什么:

我使用命令行從源代碼構建一個netmodule:

"%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\csc.exe" /out:log.netmodule /t:module /noconfig /nowarn:1701,1702 /nostdlib+ /errorreport:prompt /warn:4 /define:DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE /nostdlib /noconfig /r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\Profile\WindowsPhone\mscorlib.dll";"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\Profile\WindowsPhone\system.dll";"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\Profile\WindowsPhone\System.Net.dll";"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\Profile\WindowsPhone\System.Windows.dll";"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\Profile\WindowsPhone\System.Xml.dll"; CLog.cs

然后我用netmodule輸入建立一個DLL:

"%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\csc.exe" /out:tools.dll /t:library /noconfig /nowarn:1701,1702 /nostdlib+ /errorreport:prompt /warn:4 /define:DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE /nostdlib /noconfig /r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\Profile\WindowsPhone\mscorlib.dll";"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\Profile\WindowsPhone\system.dll";"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\Profile\WindowsPhone\System.Net.dll";"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\Profile\WindowsPhone\System.Windows.dll";"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\Profile\WindowsPhone\System.Xml.dll"; /addmodule:log.netmodule AssemblyInfo.cs

但是,當我在Windows Phone 7參考中添加我的dll“ tools.dll”時,出現此錯誤:

Reference cannot be added [...] because it was not built using the windows phone runtime. windows phone project will work only with windows phone assemblies.

我不明白此錯誤,因為我在建築命令行中僅使用Windows Phone引用。

一個有趣的信息:如果我不構建netmodule,而是dll“ log.dll”(第一個命令行),則可以在Windows Phone項目中添加log.dll參考。

提前致謝。

編譯netmodule時,有一個錯誤的引用指向:

"C:\Program Files (x86)\Reference Adll";

同樣適用於第二個DLL。 嘗試先更正。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM