Answered by:
The type or namespace name 'Xrm' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) when build for release

Question
-
I'm creating some .Net components that read/write CRM data, but during building it fails.
I've looked at some tutorials and started. All works fine, adding references no problem.
Changed target from '.Net framework 4 client profile' to '.Net fromework 4' and build in debug mode.
0 errors!!!!Now I changed it to release build and I get 29901 errors. The one that causes the problem in my opinion
is the message 'The type or namespace name 'Xrm' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)'Few questions:
- Can I build the custom workflow step in release mode
- If so, what causes my errors?Friday, June 7, 2013 9:47 AM
Answers
-
Thanks for the replies. I found the problem, it is somewhere in the references.
Don't ask me why, but reference to 'microsoft.xrm.sdk.dll', taken from shared folder, ended up in the
bin\debug directory of my project.Copied the dll's to the bin\Release and it all builds. Removed the reference (and emptied bin folder), added them again and build
succeeded.- Marked as answer by RobinBronsteede Monday, June 10, 2013 6:52 AM
Monday, June 10, 2013 6:52 AM
All replies
-
There is certainly no issue with Release mode!
Sometimes, VS will briefly show lots of errors when you change the compile profile - but they will then go away.
Check that you still have an assembly reference to Crm assemblies in your project.
hth
Scott Durow
Blog: www.develop1.netFollow Me
Rockstar365 Profile
If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"Friday, June 7, 2013 9:56 AMAnswerer -
Hi,
Add the assembly and namespace for your project and compile it again. it will work
VidhiyaM
Friday, June 7, 2013 10:10 AM -
Hi,
Here is the solution
All you have to solve this problem is right click the project, select Properties and change the Target Framework from “.NET Framework 4 Client Profile” to “.NET Framework 4”.
Regards,
Yusuf
If you find this post helpful then please "Vote as Helpful" and "Mark As Answer". Thanks and Regards, Mohammad Yusuf Ansari http://microxrm.blogspot.in
- Proposed as answer by Payman BiukaghazadehEditor Friday, June 7, 2013 3:04 PM
- Unproposed as answer by RobinBronsteede Monday, June 10, 2013 6:33 AM
- Proposed as answer by Deepak_Gangwar Friday, April 18, 2014 5:49 AM
Friday, June 7, 2013 11:32 AM -
Thanks for the replies. I found the problem, it is somewhere in the references.
Don't ask me why, but reference to 'microsoft.xrm.sdk.dll', taken from shared folder, ended up in the
bin\debug directory of my project.Copied the dll's to the bin\Release and it all builds. Removed the reference (and emptied bin folder), added them again and build
succeeded.- Marked as answer by RobinBronsteede Monday, June 10, 2013 6:52 AM
Monday, June 10, 2013 6:52 AM -
Hello I did it by your way but it is not working... When in the project there is not set target framework then not showing 'Xrm' assembly error but i canot add web service in that project.
Thanks in advance.
Ganesh
Tuesday, November 17, 2015 5:37 PM -
Tuesday, November 17, 2015 5:48 PM
-
Hey,
It is just because of compatibility issue with .net framework and dll's. Are you using CRM 2015? Please make sure target .net framework is 4.5.2.
Install .Net 4.5.2 Developer Pack.
If it doesn't work, Confirm CRM version and .net framweork version.
Thanks!
Kalim
- Proposed as answer by Mohammed Hameed Hussain Wednesday, June 15, 2016 4:08 AM
Thursday, November 19, 2015 7:50 PM -
Thanks Kalim. Installing .Net 4.5.2 Developer Pack fixed my issue.
Friday, November 20, 2015 2:46 PM -
Thanks, Kalim. This solved my error, too. I was using CRM 2016, and VS 2013 which had 4.5.1 . I installed 4.5.2 and the issue was resolved.
Wednesday, June 15, 2016 4:08 AM -
Cheers, that did the trick for meMonday, November 21, 2016 9:55 AM