Reputation: 2630
I tried to create a smart device project in Visual Studio 2008.
Target Platform: Windows Mobile 5.0 Pocket PC SDK.
.NET Compact Framework version: .NET Compact Framework 3.5
But I get the following error:
Upvotes: 37
Views: 33968
Reputation: 1
I had the same problem Old line:
> <Import
> Project="$(MSBuildBinPath)\Microsoft.CompactFramework.CSharp.targets"
> />
change into:
> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
it works
Upvotes: 0
Reputation: 5122
It also happened to me, and more than just once, with two projects for Visual Studio 2008 Professional.
It's quite easy for me to solve this problem: just re-install (I use the "Repair" option that seems to work great) the Power Toys for .NET Compact Framework 3.5. You can find this tool here: http://www.microsoft.com/en-us/download/details.aspx?id=13442
I think that sometimes, maybe after some Windows/.NET framework automatic updates, this problem can still occur. But the solution is quite easy in this case, and there is no need to edit the .vbproj/.csproj file!
Upvotes: 10
Reputation: 2638
For people landing here via a Google search and using Jetbrains Ryder:
I'm using both VS2008 and Jetbrains Ryder next to each other for development. My VS2008 was working fine whilst Ryder was not. I had to manually copy a few files from one folder to another to make it work.
To fix it you'll have to copy a few targets files from one folder to another.
Go to the folder C:\Windows\Microsoft.NET\Framework\v3.5 and copy the following files:
Now go to C:\Program Files (x86)\MSBuild\14.0\Bin and paste the copied files here.
Finally, restart Ryder and you're good to go!
The above steps did the trick for me for the Ryder IDE but if you're having the same troubles with VS2008 it might be worth a shot as well.
Upvotes: 1
Reputation: 63123
It is poorly documented.
Both .NET Compact Framework Redistributable and Power Toys must be installed for all necessary files (such as MSBuild targets files) to be available for compilation.
Upvotes: 72
Reputation: 1439
For all those who end up here as a result of the Windows 10 "anniversary update" note that the file Microsoft.Compactframework.CSharp.Targets can be found in the C:\Windows.old\WINDOWS\Microsoft.NET\Framework\v3.5 directory and copied back to where it belongs!
(Same with Microsoft.CompactFramework.Common.targets, Microsoft.CompactFramework.VisualBasic.targets)
Upvotes: 40
Reputation: 19
Open your csproj file in notepad and Find the below line:
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
and change it into
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
I hope this helped.
Upvotes: 0