Reputation: 1452
In project i have reference to Microsoft.Office.Word.Server and in code i have method that takes argument of type ConversionJob, but when i try to compile it i have an errors
The type or namespace name 'Office' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
The type or namespace name 'ConversionJob' could not be found (are you missing a using directive or an assembly reference?)
but when a press f12 on ConversionJob it tooks me to the class defenition
using Microsoft.Office.Word.Server.Service;
using Microsoft.SharePoint;
using System;
namespace Microsoft.Office.Word.Server.Conversions
{
public class ConversionJob
{
public ConversionJob(WordServiceApplicationProxy serviceApplicationProxy, ConversionJobSettings settings);
public ConversionJob(WordServiceApplicationProxy serviceApplicationProxy);
...
what is wrong?
target framework is .Net framework 3.5
Solution
Ive solve the problem. I look to the output and there was message:
Microsoft.Common.targets(1360,9): warning MSB3268: The primary reference "<assembly reference>" could not be resolved because it has an indirect dependency on the framework assembly "<assembly" which could not be resolved in the currently targeted framework. ".NETFramework,Version=v3.5". To resolve this problem, either remove the reference "<assembly>" or retarget your application to a framework version which contains "<assembly>"
i try to find solution in google and - > http://www.sanderstechnology.com/2011/warning-msb3268-you-are-about-to-experience-pain/10646/#.TtYrXGP20Z8
Upvotes: 3
Views: 12104
Reputation: 1899
Probably you have a namespace or class with the name Office somewhere in your code. The compiler uses your namespace instead Office. In other words I think you have a name collision with your project or any of the references you have in it.
Please investigate for overlapping namespaces / classes.
Upvotes: 0
Reputation: 4741
1.Try to delete and then manualy add the reference (sometimes it helps - VS losting needed dll but not show it with another sign if not clean)
Upvotes: 0
Reputation: 5825
If you look at the project references, is it finding the assembly? The icon will look different if it can't resolve it.
Upvotes: 0
Reputation: 12375
You likely need to delete (MAKE SURE TO BACK IT UP) the 12.x.x.x .dll in your GAC folder, and make sure you are referencing the 14.x.x.x in your solution.
Upvotes: 0
Reputation: 14787
Try changing the "Target Framework" to be ".NET Framework 4" instead of ".NET Framework 4 Client Profile".
Project Properties -> Application Tab -> Target Framework
Upvotes: 2
Reputation: 3372
Check the target framework of your application, might be you´re building for the client profile but the referenced assembly requires the full framework.
Upvotes: 6