Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ms test can not access source project even it has the dependency and is added to to the test prohect #3945

Closed
daCostaeurogard opened this issue Oct 15, 2024 · 1 comment

Comments

@daCostaeurogard
Copy link

Describe the bug

After adding a new prohect ms test either vb net or c#)

I add the source project as dependency

An error occured that he project has net7.0-windows10.0.22621 and can not be combined with net 7.

double clicking on the Testproject reveals a xml file where i change net 7 to net7.0-windows10.0.22621 and generate the test project new with no errors what so ever

The i add
using projct;

to get the public members of my project

i have simple test where i call a function that re4turns an int

and compare it.

i can go to the function by right clicking it and getting the definition,no problem

runing the test
i get the error



 Nachricht: 
Die Testmethode "TestProject2.TestProject2.UnitTest1.TestSub" hat eine Ausnahme ausgelöst: 
System.IO.FileNotFoundException: Could not load file or assembly 'CASMessprogramm, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null'. Das System kann die angegebene Datei nicht finden.

  Stapelüberwachung: 
UnitTest1.TestSub()
RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)



## Expected behavior
Test should run without a problem

## Actual behavior
error occures that the source project can not be found

## Additional context

i tested vb net Ms test and also c# ms test,

If you need more information please ask
@daCostaeurogard
Copy link
Author

Problem was, that the original project is tagged as x86.

After adding

<PlatformTarget>x86</PlatformTarget>

in the <PropertyGroup>
in the tests project file, the tests run as expexcted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant