Unity : I can't reference my managed plugin into my test project - visual-studio

Beginning at Unity.
I have made my unity project.
I have added a C# SimAnt.dll project of mine as a managed project into the unity project.
I have created an EditMode test Asset into the unity project.
At this stage, if I can make a test and run it OK.
I can instantiate classes from SimAnt project into the unity project scripts.
But I do not manage to reference SimAnt project into the test project.
I understand where I should do it into the UI:
But the SimAnt project is not available into the list of projects that I can reference :(
I have also tried to add the reference directly into the test project via VS.
If I do so, the test project correctly sees the Simant Dll classes as I would expect into VS UI, but the Unity interface still complains about the reference:
error CS0246: The type or namespace name 'SimAnt' could not be found (are you missing a using directive or an assembly reference?)
I tried including my SimAnt dll into the .asmdef file of the test project via VS. I am not sure about the syntax though:
My Assets directory is like this:
I closed / reopened Unity after adding the reference from VS, no luck.
Any idea?
EDIT: requested screenshots of the editor:

I Got it!!!!
I was trying to add the plugin into the wrong box.
The plugins (copy pasted DLL) need to be added into the "Assembly references" tab. (2 in screenshot below).
The other projects assemblies need to be added into the "Assembly Definitions References" tab (1 in screenshot below).
PS : You can add as a plugin the dll file compiled in Debug. It does not have to be the Release compiled file. I had a doubt about this part.

Related

Missing namespace of existing library, Xamarin Android

I have an auxiliar project that contains Java libraries used in the project. That project contains a folder with a mbwaysdk.jar and a WheelPicker-1.1.1.aar in it.
After building that project, it generates the .NET classes for the mbwaysdk.jar without any problem, but the classes of WheelPicker-1.1.1.aar don't show up. I've checked and the obj/Debug/generated/src folder contains the file classes for the mbwaysdk.jar and WheelPicker-1.1.1.aar libraries.
Within Visual Studio, the namespace Com.Aigestudio.Wheelpicker isn't recognized, although the project succesfully builds and deploys to devices, and any usage of the Com.Aigestudio.Wheelpicker views and methods works. While in debug I'm able to inspect the object, but unable to navigate to the class.
What can be causing this issue?

The target "GetBuiltProjectOutputRecursive" does not exist in the project when referencing netstandard library

I have a Xamarin Android project, and I am trying to add a reference to my own netstandard1.4 class library. When I add the reference, my Android application will no longer build. I get error MSB4057: The target "GetBuiltProjectOutputRecursive" does not exist in the project.
If I remove the reference, my android project builds fine.
The class library is a brand new library that I just created. It doesn't contain any actual code yet.
I am using Visual Studio 2017.
UPDATE: If I add a reference to my dll using the "Browse" function, it works. I only get the error when I add the reference to the project in my solution.
This appears to be fixed in 15.4

Binding Eclipse Library Project with Xamarin: At least one Java library is required for binding, this must be either 'EmbeddedJar'...for build action

We need to bind the Pulltoloadmoreandrefresh Eclipse Library Project in our Xamarin Android project as mentioned in Binding an Eclipse Library Project.
We created the Eclipse library project, added the respective files (screenshot for reference), and created the zip files with res and bin folders as mentioned in the above link.
Created the Android Library Project in Visual Studio and added the the zip file. But it shows error "At least one Java library is required for binding, this must be either 'EmbeddedJar', 'InputJar' (for jar), 'LibraryProjectZip' (for aar or zip) or 'LibraryProjectProperties' (project.properties) build action" for build action "LibraryProjectZip"
Kindly suggest on how to resolve this.
I solved this problem by swapping in Build Action.
For me the solution came with the type InputJar in the project that generates the library for Xamarin.

Build creation fails in Visual Studio for test written using selenium references

When i create build after creating a build definition for a test project developed using selenium references it throws me an error as follows.
"The type or namespace name 'OpenQA' could not be found (are you missing a using directive or an assembly reference?)"
Even though i have used appropriate references in my project and it does not throw any error while running the test.
Error remains the same on adding reference as.
Using OpenQA;
What i am planning to do is to create a test a project using selenium references and execute it using Test Manager.
Please Help!!!
Thanks in advance.
As #Arran stated.. The evidence suggests that you really do not have the appropriate assembly references.
Excerpt from the WebDriver Documentation -
As of Selenium 2.2.0, the C# bindings are distributed as a set of signed dlls along with other dependency dlls. Prior to 2.2.0, all Selenium dll’s were unsigned. To include Selenium in your project, simply download the latest selenium-dotnet zip file from https://code.google.com/p/selenium/downloads/list. If you are using Windows Vista or above, you should unblock the zip file before unzipping it: Right click on the zip file, click “Properties”, click “Unblock” and click “OK”.
Unzip the contents of the zip file, and add a reference to each of the unzipped dlls to your project in Visual Studio (or your IDE of choice).
Problem resolved.
While creating a build definition, under 'Process', in 'items to build' we need to set proper 'configurations'. Using 'Configurations' as 'release' and platform as 'x86' or according to your CPU will resolve the problem.

Unable To Reference Wizard Assembly in VSIX Deployed Template

I am trying to create a VISX extension for Visual Studio 2010 that contains a few project templates. These templates aren't very complex, but I want to expose some additional configuration for them during creation via a wizard. I have successfully set up my VISX package to deploy the templates to the directory structure I want in VS2010, but as soon as I try to configure and run a wizard, I receive an error when I create the template along the lines of:
Error: this template attempted to load component assembly
'My.Assembly, Version 1.0.0.0, Culture=neutral, PublicKeyToken=...
My current configuration is as follows:
All the projects live in the same solution.
The VISX project includes project references to the project containing the wizards and to each template.
Each template is built from a project template template (...confusing terminology).
They are added through the .vsixmanifest designer as content, referencing the projects.
Each .vstemplate file has a WizardExtension element pointing to the IWizard implementation and containing assembly.
The wizard assembly is signed.
The .vstemplate files point to their wizards like this:
<WizardExtension>
<Assembly>My.Assembly, Version=1.0.0.1, Culture=neutral, PublicKeyToken=a494da9e6e53f845, Custom=null
</Assembly>
<FullClassName>My.Assembly.Wizard</FullClassName>
</WizardExtension>
This, as far as I can tell, is how I'm supposed to do it. What exactly is going wrong? It looks like it can't find the assembly. Are there any other steps I need to take in order to get the assembly visible to the templates? The assembly is deployed to the extension folder when it is installed (I verified this), so it is at least making it out. Is there something special I need to do to the .vstemplate files to tell them to look in the extensions folder vs the GAC? Did I just miss something?
Note that I have found several pages on the internet stating that I have to GAC the assembly manually or with a script. However, few had my exact scenario (Project template templates being referenced by a VISX project, most examples are using a regular project exported via the project template wizard and having their packages dumped into the VISX folder structure). The only one I found that matched my scenario was an example from Microsoft. I tried to match that, but alas it still does not work. I tried relocating the project I downloaded to reference in this question but I cannot find it again, though.
Using scripts is how we've done this before, but I want to try and make things a little cleaner using VISX packages. I would like to avoid this, but if it's mandatory to script the VISX to install the template to GAC, I can do that.
When deploy the wizard based project template by VSIX Extension, it is better to use Short-Named assembly in .vstemplate. This can avoid the GAC deployment.
In your case, it should be:
<WizardExtension>
<Assembly>My.Assembly</Assembly>
<FullClassName>My.Assembly.Wizard</FullClassName>
</WizardExtension>
I am using VS2015 and faced this issue on and off. When I started building VSIX project with Wizard implementation, everything worked fine for sometime (4-6 weeks) and suddenly it stopped working. After a couple of weeks it would start working again and stop working without notice. Took me long time to find a workaround (still don't know why it suddenly stops).
This is how my VSIX project is built
I have VSIX project, project template and Wizard implementation in
the same solution.
VSIX and Wizard implementation are in the same project.
Added VSIX project dll and project template as Assets in VSIX project source.extension.vsixmanifest.
Project template *.vstemplate has Wizard section which refers to VSIX project with strong name:
<<<<<<<<<<<<<<<<<<<<<<
<WizardExtension>
<Assembly>Test.Template.TemplateInstallerWizard, Version=1.0.0.0, Culture=neutral, PublicKeyToken=30ab381f68dc4f5e</Assembly>
<FullClassName>Test.Template.TemplateInstallerWizard.WizardImplementation</FullClassName>
</WizardExtension>
None of these worked for me
Uninstalled extension from VS regular instance via Tools->Extensions
and Updates..
Uninstalled extension from VS experimental instance by
launching VS exp instance from VS2015 command prompt as Administrator:
devenv.exe /rootsuffix exp
and then uninstalling the extension via Tools->Extensions and Updates..
Using short named assembly as explained by #Ethan Wu.
Installing templates via this command from VS2015 command prompt launched as administrator:
devenv /installvstemplates
Rebooting VS2015, my machine several times during this process.
This is what worked for me (thanks to #Ethan Wu)
Remove certificate from VSIX project.
Remove strong name from Project Template *.vstemplate
file
<WizardExtension>
<Assembly>Test.Template.TemplateInstallerWizard, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</Assembly>
<FullClassName>Test.Template.TemplateInstallerWizard.WizardImplementation
Clean and build the project.
Remove extension from VS regular instance and close VS2015 (not
absolutely required)
Install the extension.
Open new VS2015 instance and try to create the project with
wizard.
Couple of things to help debug
When VSIX project is build, in bin\debug folder a file is
created -extension.vsixmanifest which has the assets type.
Look for Asset Type="Microsoft.VisualStudio.Assembly":
AssemblyName value is what is expected in project template's
*.vstemplate WizardExtension section - they should match exactly.
After installing extension, go to VS2015 extension location on
local box:
%appdata%\..\Local\Microsoft\VisualStudio\14.0\Extensions\<some_temp_folder>
open extension.vsixmanifest to ensure that Asset
Type="Microsoft.VisualStudio.Assembly" AssemblyName value is
correctly populated. If required, you can change this value and
restart VS2015 to make this in effect.
Hope this will help someone and save tons of time as there is very little help on Wizard and custom project templates.
Thanks,
RDV
I run into the same problem, but mine came to light when I updated the AssemblyVersion of my wizard project. I checked and the versions in the manifest files matched as they should.
I simply went into C:\Users\Albert\AppData\Local\Microsoft\VisualStudio\16.0_c340331cExp\Extensions, found my extension and deleted it there. Now it works again.
(Note that I did find a few others since I've since changed the company name etc, in the AssemblyInfo file, so it could be the old ones laying around that also caused this)

Resources