2013-06-03 51 views
0

我有一個項目,我的源不在我的.csproj旁邊。更改源目錄Visual C#

我已經通過添加鏈接的所有來源,但該項目不編譯......這是我的錯誤:

CoreCompile: 
    C:\Windows\Microsoft.NET\Framework\v4.0.30319\Csc.exe /noconfig /nowarn:1701,1702,2008 /nostdlib+ /platform:x86 /errorreport:prompt /warn:4 /define:DEBUG;TRACE /errorendlocation /preferreduilang:en-US /highentropyva- /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.0\PresentationCore.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.0\PresentationFramework.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.5\System.Core.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.5\System.Data.DataSetExtensions.dll" /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:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.0\System.Runtime.Serialization.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.0\System.ServiceModel.dll" /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.5\System.Xml.Linq.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.0\UIAutomationProvider.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.0\WindowsBase.dll" /debug+ /debug:full /filealign:512 /out:obj\x86\Debug\MyApp.exe /target:winexe /utf8output /win32icon:MyIcon.ico my_path\App.xaml.cs my_path\MainWindow.xaml.cs build_path\App.g.cs build_path\MainWindow.g.cs 
CSC : error CS5001: Program 'my.exe' does not contain a static 'Main' method suitable for an entry point 

我想知道是否有可能告訴給我的解決辦法:「我的消息來源是在my_path目錄下?「

我認爲這是錯誤,因爲它沒有發現我的App.xaml一些參考引起的:

<Application x:Class="MyApp.App" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    StartupUri="MainWindow.xaml" 
    > 

回答

2

你需要確保你有你的App.xaml正確的文件屬性。
在Visual Studio中,右鍵單擊App.xaml並選擇「屬性」。 應該這樣寫:

生成操作:ApplicationDefinition
自定義工具:的MSBuild:編譯

+0

這是問題。我忘了檢查... –