Project does not compile after installing .net 4

Ask general questions here.
anja
Posts: 67
Joined: Fri Nov 26, 2010 3:39 pm

Project does not compile after installing .net 4

Post by anja » Thu Jun 21, 2012 9:01 am

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

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Project does not compile after installing .net 4

Post by Support Team » Fri Jun 22, 2012 1:44 pm

Hi,

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

Regards,
Tobias
Ranorex Team

anja
Posts: 67
Joined: Fri Nov 26, 2010 3:39 pm

Re: Project does not compile after installing .net 4

Post by anja » Mon Jun 25, 2012 6:54 am

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

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Project does not compile after installing .net 4

Post by Support Team » Tue Jun 26, 2012 1:10 pm

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
You do not have the required permissions to view the files attached to this post.

anja
Posts: 67
Joined: Fri Nov 26, 2010 3:39 pm

Re: Project does not compile after installing .net 4

Post by anja » Tue Jul 24, 2012 7:06 am

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

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Project does not compile after installing .net 4

Post by Support Team » Wed Jul 25, 2012 12:42 pm

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

zator
Posts: 53
Joined: Wed Jul 04, 2012 1:44 pm
Location: Kraków, POLAND

Re: Project does not compile after installing .net 4

Post by zator » Wed Aug 08, 2012 12:06 pm

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ł

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Project does not compile after installing .net 4

Post by Support Team » Wed Aug 08, 2012 1:41 pm

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

zator
Posts: 53
Joined: Wed Jul 04, 2012 1:44 pm
Location: Kraków, POLAND

Re: Project does not compile after installing .net 4

Post by zator » Wed Aug 08, 2012 2:51 pm

Hi,

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

Paweł

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Project does not compile after installing .net 4

Post by Support Team » Wed Aug 08, 2012 4:02 pm

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

zator
Posts: 53
Joined: Wed Jul 04, 2012 1:44 pm
Location: Kraków, POLAND

Re: Project does not compile after installing .net 4

Post by zator » Thu Aug 09, 2012 10:17 am

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ł

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Project does not compile after installing .net 4

Post by Support Team » Thu Aug 09, 2012 12:46 pm

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

zator
Posts: 53
Joined: Wed Jul 04, 2012 1:44 pm
Location: Kraków, POLAND

Re: Project does not compile after installing .net 4

Post by zator » Thu Aug 09, 2012 2:15 pm

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ł