Error in referencing a dll

Posted by Chaithragm under ASP.NET on 3/5/2013 | Points: 10 | Views : 1842 | Status : [Member] | Replies : 7
Error 8 Cannot embed interop type 'Microsoft.Office.Core.MsoLineDashStyle' found in both assembly 'c:\Users\Infocrew_sys2\AppData\Local\Temp\Temporary ASP.NET Files\grid\2782ad8b\d630cd7b\assembly\dl3\f9559043\0086f2c0_6cb8cc01\office.DLL' and 'c:\Windows\assembly\GAC\office\12.0.0.0__71e9bce111e9429c\OFFICE.DLL'. Consider setting the 'Embed Interop Types' property to false.



using Microsoft.Office.Core;

using Microsoft.Office.Interop.PowerPoint;

using ppt = Microsoft.Office.Interop.PowerPoint;

using System.Runtime.InteropServices;

i have reffered this files after that when i run the website its giving error as above
How to resolve this




Responses

Posted by: Sakthi.Singaravel on: 3/5/2013 [Member] Silver | Points: 25

Up
0
Down
When this error throws...?

Regards,
Singaravel M

Chaithragm, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Chaithragm on: 3/5/2013 [Member] Starter | Points: 25

Up
0
Down
after referencing i build the solution then it throws error

Chaithragm, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sakthi.Singaravel on: 3/5/2013 [Member] Silver | Points: 25

Up
0
Down
place the dll in startUp path...

Regards,
Singaravel M

Chaithragm, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Raj.Trivedi on: 3/5/2013 [Member] [MVP] Starter | Points: 25

Up
0
Down
Hello Chaithgram,

Try cleaning the temporary folder of your project and then try to refer.

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files

The version can depend on your project basis

Regard's
Raj.Trivedi
"Sharing is Caring"
Please mark as answer if your Query is resolved

Chaithragm, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Chaithragm on: 3/6/2013 [Member] Starter | Points: 25

Up
0
Down
i have tried..that folder is empty as im trying to do the article you have uploaded ..(uploading ppt)
but its giving error

Chaithragm, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vuyiswamb on: 3/6/2013 [Member] [MVP] [Administrator] NotApplicable | Points: 25

Up
0
Down
Why do you want to reference a dll from the temp directory?

Thank you for posting at Dotnetfunda
[Administrator]

Chaithragm, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Chaithragm on: 3/6/2013 [Member] Starter | Points: 25

Up
0
Down


using Microsoft.Office.Core;

using Microsoft.Office.Interop.PowerPoint;

using ppt = Microsoft.Office.Interop.PowerPoint;

using System.Runtime.InteropServices;

To add these namespaces

solution Folder right Click - > Add ASP_NET Folder -> Bin -> Then Again right Click Bin Folder -> Add Reference -> .NET Tab Search for above dll's and added it.


after this error has thrown as i posted above


Chaithragm, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response