sinterlkaas
New Member
- Joined
- Jan 17, 2012
- Messages
- 536
- Reaction score
- 14
When using WPF the bot fails to compile the sources for a plugin
[12:40:10.296 N] Compiler Error: g:\db\Plugins\Test\Window1.xaml.cs(23,13) : error CS0103: The name 'InitializeComponent' does not exist in the current context
but when building with VS2010 it build without any errors
Searched google for this problem and found some things but still does not fix it for DB
first thing I found and tried was: found here
Next I found this: found here/
What I did is build the profject with VS2010 and copied obj\debug\Window1.g.cs to the plugins folder and opened it to correct all paths
than start DB and that results in a crash when it tries to compile the plugins without any more info in logs
Conclusion I am stuck and need help
included the VS project and the plugin as I tested it with DB
[12:40:10.296 N] Compiler Error: g:\db\Plugins\Test\Window1.xaml.cs(23,13) : error CS0103: The name 'InitializeComponent' does not exist in the current context
but when building with VS2010 it build without any errors
Searched google for this problem and found some things but still does not fix it for DB
first thing I found and tried was: found here
what I did was edit the .csproj file and include it in the plugins folder with db (I dont think DB uses this file because it did not change anything)<Import Project=?..
It?s near the end of the file. and the only line that you have is probably this:
<Import Project=?$(MSBuildBinPath)\Microsoft.CSharp.targets? />
This tells Visual Studio to build the project as a .NET 2.0 project. What we want to do is to tell Visual Studio that this is actually a WPF project, so we have to add the following line:
<Import Project=?$(MSBuildBinPath)\Microsoft.WinFX.targets? />
This line will tell Visual Studio to build the project as a WPF project. Now your .csproj file bottom should look like this:
< Import Project=?$(MSBuildBinPath)\Microsoft.CSharp.targets? />
<Import Project=?$(MSBuildBinPath)\Microsoft.WinFX.targets? />
Save the .csproj file, right click it in the solution explorer and select ?Reload Project? Compile and that?s it, your all done!
Amit
Next I found this: found here/
The initializeComponent routine is created in the .g.cs file that is created during build. (see obj\debug\...)
Make sure your XAML file has a build action of "Page" to create that file.
Also, make sure that the partial classes in .xaml.cs and .g.cs match.
What I did is build the profject with VS2010 and copied obj\debug\Window1.g.cs to the plugins folder and opened it to correct all paths
than start DB and that results in a crash when it tries to compile the plugins without any more info in logs

Conclusion I am stuck and need help

included the VS project and the plugin as I tested it with DB
Last edited: