Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Missing reference

Tags:

c#

reference

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);

...

enter image description here

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

like image 306
Andriy Khrystyanovich Avatar asked Feb 01 '26 05:02

Andriy Khrystyanovich


2 Answers

Check the target framework of your application, might be you´re building for the client profile but the referenced assembly requires the full framework.

like image 110
Dominik Avatar answered Feb 03 '26 19:02

Dominik


Try changing the "Target Framework" to be ".NET Framework 4" instead of ".NET Framework 4 Client Profile".

Project Properties -> Application Tab -> Target Framework

enter image description here

like image 30
JohnD Avatar answered Feb 03 '26 19:02

JohnD



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!