What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal
RebornBuddy Forums

Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

VS2013 project headache

buddyfu

New Member
Joined
Aug 27, 2014
Messages
24
I created a new plugin using the VS2013 project from the guide "How to Debug Your Bot/Plugin/Routine Code In Visual Studio".

Everything worked fine, until i tried to bind my user interface (SettingsGui.xaml) to my JsonSettings implementation (DeathLoggerSettings.cs).

This is the line that causes me problems (line 10 of SettingsGui.xaml) :
Code:
<Grid x:Name="Root" DataContext="{x:Static settingsPath:DeathLoggerSettings.Instance}">

Visual studio tells me that "The name "DeathLoggerSettings" does not exist in the namespace "clr-namespace:DeathLogger"." I can not seem to find how to solve this error.

Exilebuddy gives me this error:
Code:
[OnStartup] A top-level exception has been caught.System.Windows.Markup.XamlParseException: Could not load file or assembly 'VS2013, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified. ---> System.IO.FileNotFoundException: Could not load file or assembly 'VS2013, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
   at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.Assembly.Load(AssemblyName assemblyRef)
   at System.Windows.Baml2006.Baml2006SchemaContext.ResolveAssembly(BamlAssembly bamlAssembly)
   at System.Windows.Baml2006.Baml2006SchemaContext.ResolveBamlTypeToType(BamlType bamlType)
   at System.Windows.Baml2006.Baml2006SchemaContext.ResolveBamlType(BamlType bamlType, Int16 typeId)
   at System.Windows.Baml2006.Baml2006SchemaContext.GetXamlType(Int16 typeId)
   at System.Windows.Baml2006.Baml2006SchemaContext.GetPropertyDeclaringType(Int16 propertyId)
   at System.Windows.Baml2006.Baml2006Reader.GetStaticExtensionValue(Int16 valueId, Type& memberType, Object& providedValue)
   at System.Windows.Baml2006.Baml2006Reader.Process_PropertyWithExtension()
   at System.Windows.Baml2006.Baml2006Reader.Process_OneBamlRecord()
   at System.Windows.Baml2006.Baml2006Reader.Process_BamlRecords()
   at System.Windows.Baml2006.Baml2006Reader.Read()
   at System.Windows.Markup.WpfXamlLoader.TransformNodes(XamlReader xamlReader, XamlObjectWriter xamlWriter, Boolean onlyLoadOneNode, Boolean skipJournaledProperties, Boolean shouldPassLineNumberInfo, IXamlLineInfo xamlLineInfo, IXamlLineInfoConsumer xamlLineInfoConsumer, XamlContextStack`1 stack, IStyleConnector styleConnector)
   at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
   --- End of inner exception stack trace ---
   at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
   at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri)
   at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
   at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
   at DeathLogger.SettingsGui.InitializeComponent() in c:\Users\olibe_000\Desktop\PoEBot\Plugins\DeathLogger\SettingsGui.xaml:line 1
   at DeathLogger.SettingsGui..ctor() in c:\Users\olibe_000\Desktop\PoEBot\Plugins\DeathLogger\SettingsGui.xaml.cs:line 25
   at DeathLogger.DeathLogger.get_Control() in c:\Users\olibe_000\Desktop\PoEBot\Plugins\DeathLogger\DeathLogger.cs:line 260
   at BotGui.Windows.MainWindow.HandleInterfaces(Object obj)
   at BotGui.Windows.MainWindow.<OnStartup>b__19()
   at System.Windows.Threading.DispatcherOperation.InvokeDelegateCore()
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Windows.Threading.DispatcherOperation.Wait(TimeSpan timeout)
   at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherOperation operation, CancellationToken cancellationToken, TimeSpan timeout)
   at System.Windows.Threading.Dispatcher.Invoke(Action callback, DispatcherPriority priority, CancellationToken cancellationToken, TimeSpan timeout)
   at System.Windows.Threading.Dispatcher.Invoke(Action callback)
   at BotGui.Windows.MainWindow.<OnStartup>b__6(Object o)

But my DateContext line can autocomplete just fine, which makes things even weirder.
Why does the compiler tell me that DeathLoggerSettings does not exist when IntelliSense can see it without any problems?
OHW0ItZ.jpg


I think that my plugin got somehow linked to the VS2013 project and I don't know how to separate it.
When I use auto complete on the settingsPath, I see (VS2013) beside the namespace, should it be there?
DZw3TUr.jpg


The files in my project are all "File Links", as shown in the guide "How to Debug Your Bot/Plugin/Routine Code In Visual Studio".

Also, the SettingsGui.g.i.cs file that is generated keeps giving me the line
Code:
System.Uri resourceLocater = new System.Uri("/VS2013;component/plugins/deathlogger/settingsgui.xaml", System.UriKind.Relative);
in it's InitializeComponent() method but it should be
Code:
System.Uri resourceLocater = new System.Uri("/DeathLogger;component/settingsgui.xaml", System.UriKind.Relative);
I think it is probably linked to my problem.
 

Attachments

Last edited:
Right click on your project -> Properties -> Target Framework
Ensure that it is 4.5.1
 
Have you tried to rebuild the project after setting it to 4.5.1?

It was always set to 4.5.1 and i have tried rebuilding the project, restarting visual studio, rebooting my computer and copying the code in a whole new project. I always get the same error.
 
Weird. I always get that error in new EB project, but setting target framework to 4.5.1 always fixes it.
Your zip in first post contains only plugin files. Can you attach the whole project?
 
You attached something wrong. That contains a lot of default plugins, routines, bots.
And folder with your plugin is empty.
 
I followed the guide and it is what I had already done. Making a new project didn't help. The error is still there. I wonder if it's an issue with my visual studio setup or something.

I linked the new project. The old project was working by the way, you just needed to insert it in your exilebuddy folder. My plugin folder in the project was a direct reference to the folder in the exilbuddyfolder which actually contained the plugin. The content of the folder is in the zip of my original post.
 

Attachments

I followed the guide and it is what I had already done. Making a new project didn't help. The error is still there. I wonder if it's an issue with my visual studio setup or something.

I linked the new project. The old project was working by the way, you just needed to insert it in your exilebuddy folder. My plugin folder in the project was a direct reference to the folder in the exilbuddyfolder which actually contained the plugin. The content of the folder is in the zip of my original post.
It compiles for me just fine.
I mean your "normal" project, not that "buddy debug thing" (I've never used that, just did not feel the need).
 
Last edited:
So it's something wrong with my visual studio installation.
Thank you for taking the time to test the project.
 
Okay, sorry for digging out that old thread, but I got exactly the same problem, and no solution worked i found here or on stackoverflow. Seems to be a known problem, but like I said. Nothing worked. I used the provided guides to setup my exilebuddy vs project. Tried with VS 2015 Community Edition and with VS 2013 Express, always the same problem. Even if I setup a new project with a premade Plugin (like the Stats or GemLeveler Plugin), the xaml Editor always tells me the property StatsSettings (when using the Stats Plugin) must be under the same namespace as Stats, could not be found bla bla.
Anyone else got this problem and could solve it?

Just to make sure, everything compiles without errors and works, it's just that I cant use the DataContext stuff inside XAML to use the Visual Editor :(
 
Check out the How to Use Code-Behind/XAML for your WPF Guis thread for the latest model on handling this stuff.

All of the updated stuff with the bot now uses that model. The only places where it's not used yet are for things that are getting planned rewrites (Scheduler plugin, Routine, GrindBot).

Don't worry so much about what XAML editor is telling you if everything actually compiles and is loaded by the bot. It's really finicky, and sometimes it gives errors for things that are actually fine. Make sure to run your VS in admin, as that seems to help get over a path in your protected program files being used.

Main thing to look at, is your naming of the gui and the core files themselves. If you follow the same model all the plugins do, that is your gui is named Gui, and then you have PluginSettings, then Plugin for the main file, you should avoid any namespace conflicts with the names themselves. While there are no csprojs for the plugins included, the files you have access to are exactly the files that are part of the EB project; they don't get compiled into the bot, but they simply get included with them.
 
Back
Top