Page 1 of 1

Project does not compile after installing .net 4

Posted: Thu Jun 21, 2012 9:01 am
by anja
Hi,

I've got a solution with multiple project. At first it is compiling without any problems. (No .Net 4 installed).
The test is installing a software product - including the .Net 4 Client profile and the extended.
After the .Net is installed, all projects within the solution could not compile.
I get following warning:
The reference assemblies for framework ".NETFramework,Version=v4.0" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend. (MSB3644)
Additionally the following error occured:
Parameter "SearchPaths" has invalid value "{CandidateAssemblyFiles}%3b
%3b
{HintPathFromItem}%3b
{TargetFrameworkDirectory}%3b
{Registry:Software\Microsoft\.NETFramework,v4.0,AssemblyFoldersEx}%3b
%3b
{GAC}%3b
{RawFileName}%3b
bin\Debug\Microsoft.VisualBasic.dll". Illegal characters in path. (MSB3248)
Have I missed some settings?

Within another solution I, this problem does not occur... I have checked the settings of the project, but the only difference was the target architecture... I've changed this settings to the ones within the other projects and vice versa, but it is still the same problem..

Any ideas?

Thank you in advance..

Best regards
Anja

Re: Project does not compile after installing .net 4

Posted: Fri Jun 22, 2012 1:44 pm
by Support Team
Hi,

please reinstall Ranorex using the Setup.exe.
Doing so will fix your issue.

Regards,
Tobias
Ranorex Team

Re: Project does not compile after installing .net 4

Posted: Mon Jun 25, 2012 6:54 am
by anja
Hi,
thank you for your quick response, but I'm not sure if I understand it correctly.

I understand that I have to reinstall Ranorex after the .NET 4.0 is installed, to get my solution working again. Is this correct?

If yes, then I'm not sure why I have to do this... my solutions does not need any .NET 4.0 and the .NET will be installed during the testexecution. I do not like to have to install Ranorex everytime completely new after I executed the first Testcase of my solution....

Additionally this error only occurs with one of my testsolutions. Another solution compiles correctly before the installation of .NET 4.0 and afterwards, it is compiliong, too... So in my opinion this is some sort of configuration which makes this happen - I'm just not sure which one.

Thank you in advance...
Best regards
Anja

Re: Project does not compile after installing .net 4

Posted: Tue Jun 26, 2012 1:10 pm
by Support Team
Hi,

please make sure to have .Net Framework 3.5 chosen as target framework in compiling tab of projects settings.

In some cases it might be necessary to set the specific version of the reference.
Therefore make sure, that .Net 4.0 is not installed on the machine.
Open your solution and set "Specific Version" (which should be 2.0.0) to true for each not Ranorex specific reference in your project.
specific-version.png
Regards,
Tobias
Ranorex Team

Re: Project does not compile after installing .net 4

Posted: Tue Jul 24, 2012 7:06 am
by anja
Hi,

Thank you for this resolution... it works without any problems...

But just to understand:
I just checked the second solution, where this problem never occured... here the property of the not Ranorex specific References is not set to a fix version. --> Why is it working within this solution and not within the other?

Thanks again

Best regards
Anja

Re: Project does not compile after installing .net 4

Posted: Wed Jul 25, 2012 12:42 pm
by Support Team
Hi,
anja wrote:I just checked the second solution, where this problem never occured... here the property of the not Ranorex specific References is not set to a fix version. --> Why is it working within this solution and not within the other?
I'm sorry, but basically I do not know why in some cases it is working and in other cases it is necessary to set a fixed version.

Regards,
Tobias
Ranorex Team

Re: Project does not compile after installing .net 4

Posted: Wed Aug 08, 2012 12:06 pm
by zator
Hello,

I am writting because i used to have same problems with Ranorex. When i wrote class library in .NET 4.0 to use it as a base class of Ranorex Recording classes, my projects did not want to compile. I just have to compile this library under .NET 3.5 and everything was fine.

Paweł

Re: Project does not compile after installing .net 4

Posted: Wed Aug 08, 2012 1:41 pm
by Support Team
Hello Pawel,

Could it be that you just have the client version of the .Net 4.0 framework?
How did you include your library to the Ranorex Solution?
There should not be such problems, I also tested it on my machine and in my case everything worked as expected.

Regards,
Markus
Ranorex Support Team

Re: Project does not compile after installing .net 4

Posted: Wed Aug 08, 2012 2:51 pm
by zator
Hi,

I just add Reference via .NET Assembly Browser to my project. I use full version of .NET framework.

Paweł

Re: Project does not compile after installing .net 4

Posted: Wed Aug 08, 2012 4:02 pm
by Support Team
Hi,

Did you get an error when you tried to compile it?
Can you send us your Solution, this will help us analyze the issue faster?
If you want you can send it to our email address: [email protected].

Regards,
Markus
Ranorex Support Team

Re: Project does not compile after installing .net 4

Posted: Thu Aug 09, 2012 10:17 am
by zator
Hi,

As i perviously say it's not a big problem for me. I just have to compile my project under .NET 3.5.
Anyway here is a screen from the error log when my library is compiled whit target .NET 4.0.

Image


General template for this warning is " ... could not be resolved because it has an indirect dependency on the framework assembly <library_name> ... "

Paweł

Re: Project does not compile after installing .net 4

Posted: Thu Aug 09, 2012 12:46 pm
by Support Team
Hi Pawel,

In general such warnings are just shown if you reference a assembly which was built with a different .Net version.
Could it be that there are more projects in your library which were built with another version or that your library or project references another assembly which was built with another .Net version?

Regards,
Markus
Ranorex Support Team

Re: Project does not compile after installing .net 4

Posted: Thu Aug 09, 2012 2:15 pm
by zator
Haha! You are right, the target framework in RANOREX project was set to 3.5... :D
Now everything workd fine even with .NET 4.0.

Thanks
Paweł