Installed CONNECT Update 4 and the SDK. I rebuilt all the SDK examples. The C++ examples build OK, but the .NET examples advise me that "warning MSB3644: The reference assemblies for framework ".NETFramework,Version=v4.5.2" 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"
I updated .NET Framework. Then I opened a .NET project in Viz Studio, chose Properties and selected a new Target framework for the project. That pops an error dialog with this message:
TargetFrameworkMoniker: The expression "[System.IO.Path]::Combine(G:\Program Files\Bentley\MicroStation CONNECT Edition\SDK\examples\Annotations\DescribeElementExample, G:\PROGRA~1\Bentley\MICROS~2\MICROS~1\mdlapps\ )" cannot be evaluated. Illegal characters in path. C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets
I have no idea what causes that error.
In Add/Remove Programs/Features, do you have listed: Microsoft .NET Framework 4.5.2 Multi-Targeting Pack (ENU)?If not, could you check to see if installing it from the package below resolves the issue?
Thank you,Bob
Unknown said:Check to see if installing .NET Framework 4.5.2 resolves the issue?
It removes the yellow error message when I build all example projects, and it fixes a similar problem in a C++ build.
However, when I attempt to change the .NET Framework version in a .NET project settings I still see the error dialog whose contents I copied above.
Regards, Jon Summers LA Solutions
In the .csproj file,
Original style:
<OutputPath> $(MS)mdlapps </OutputPath>
Turn it into:
<OutputPath>$(MS)mdlapps</OutputPath>
Unknown said:In the .csproj file
It's kind of you to respond, but I'm not sure what question you are answering.
One problem is that Viz Studio sometimes won't let us change the CLR framework version. A way around that is to define this Windows environment variable:
TargetFrameworkVersion=v4.6.1
Unknown said: <OutputPath> $(MS)mdlapps </OutputPath>
<
OutputPath
>
$(MS)mdlapps
</
Unknown said: <OutputPath>$(MS)mdlapps</OutputPath>
>$(MS)mdlapps</
Those two lines have the same meaning in XML.
Hi Jon
Try this:
Open folder containing project files with windows explorer
Find file with csproj extension csproj
Open this file using Notepad
Find in file this text "$(MS)mdlapps\" and delete it. You'll find this text 5-6 places.
Save file, open in VS and change framework
cheers
Nenad
Because in the "ManagedToolsExample" has the same error. And I spent lots of time to find out the "Illegal characters".
Unknown said: Those two lines have the same meaning in XML.
Yes, it looks the same but to computer it is different.
Error message you are receiving from TargetFrameworkMoniker has nothing to do with framework version.
It is simply message about illegal path name.
Path <OutputPath>$(MS)mdlapps</OutputPath:> is illegal name.
This path , normally, can be change by selecting project> properties> build> Output path, but in this case VS "refuse" to change path because original csproj contains illegal character
Apologies for the thread revival, I had the same issues trying to build the latest update 13 SDK examples. Same error and could not change the .Net framework so hopefully this will help others as well: If you open the .csproj file and add the following:<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion> under the top PropertyGroup it should work (it did for me). Simply replace v4.6.2 with whichever target framework you require. Credit to Jon for the info!
Answer Verified By: Jon Summers
FYI.NOTE: In addition to the recommended answer, MicroStation CONNECT Edition SDK Update 14 has removed most (static) TargetFrameworkVersion dependencies; simply preferring to synchronize with the latest dependent product framework requirements.