Unable to compile workflow-project - msbuild

I have a build-server running CC.Net. So far I never had any problems compiling projects on the build server (which has no VS installed, just use the .Net Framework).
But now I have a new projects and I get this message:
C:\Program Files\MSBuild\Microsoft\Windows Workflow Foundation\v3.5\Workflow.Targets(127,5): error : Compilation failed. Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
Has anyone any hint's on what's causing this problem?
What might be of some interest is the fact, that this is a SharePoint project wich includes a SharePoint workflow. But this shouldn't stop the project from being able to be compiled.

The problem with LoaderExceptions described here sounds like what you are seeing. Maybe targeting 3.0 instead of 3.5 does fix your issue too.

Related

asp mvc IIS deployment issue: Compilation Error

Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: The compiler failed with error code -2146232576.
Clean and Rebuild your solution (under Build menu). If it gives you any compilation errors, correct them and build it again. That worked for me.
Edit 3/12/18
It seems like you have read, or possibly write, locks on one or more files. Close the studio and verify that the source code repository don't have orphaned read/write locks. Also verify that any directories used for compilations don't have read locks. There used to be a weird Temporary ASP.NET-folder that was prone to locking files in the good old days.
Previous response
These are a few things that come to mind in my experience. I am assuming the deployment machine is a Windows Server of sorts.
Check the expected .NET version by checking project properties in Visual Studio (or the Project-files if another editor is used).
Compare with the installed version of .NET of the deployment machine. Framework on the deployment machine should equal to or greater than .
Verify the chosen app pool is running the expected version (or change it) and recycle it.
Make sure all the necessary assembly files (.DLLs) have been included on the deployment machine. A quick look into the BIN or DEBUG folder usually tells the story, but will generally also contains a whole lot more stuff. Sometimes too many assembly files removed during optimisation of the build.
A little bit of information about deployment OS and .NET versions would help.

Consuming WCF in Xamarin forms

I am generating a WCF proxy using add web referance in Xamarin Studio
yet genrated proxy create the following error:
The type or namespace name IExtensibleDataObject' does not exist in the namespaceSystem.Runtime.Serialization'. Are you missing an assembly reference? (CS0234) (infra)
I am using mono4.0.5
Can anybody help me solve this problem that gave me many sleepless nights.
PS: I tried to skip proxy generation to using slsvcutil.exe code generation
but the same error keeps happening
Right click on you project and select Edit references. Look for System.Runtime.Serialization and select it.
If you already set the reference of System.Runtime.Serailization and error is still persist then try following regular steps..
clean solution and rebuild solution
restart visual studio
I found a solution for your problem. The problem is Xamarin Portable Targets. The targets must not contain any Windows targets selected. After changing this as in the image below it will not give you any compile time errors for System.Runtime.Serialization.
I found that after reading this https://developer.xamarin.com/guides/android/under_the_hood/assemblies/
The System.Runtime.Serialization.dll is for the Silverlight package and when selecting windows targets it might be removing these dlls/code not supported in windows platform from the portable libraries.

MonoDevelop - Bug with SmartAssembly

I have my dlls (.NET4) build with msbuild and obfuscated with SmartAssembly 5.5.
After that i set them with reference for simple console application in the MonoDevelop (latest) on Mac (10.8).
Built ok, but when i ran that simple app, i have a message:
Unknown heap type: SmartAssembly
I asked SA support but no luck yet (the saproj have item blabla(supports Mono) checked.
I dont see how to attach a screenshot, but, when i run my application i see in the console that message twice. It appears before program stops on the breakpoint on the first line of code.
So maybe someone knows what to change in SmartAssembly or in MonoDevelop to remove this problem ? Thanks
Many .NET obfuscators change the assemblies such that they are not technically correct assemblies (they fall outside the .NET assembly specs) but such that they still run on the Microsoft .NET runtime by exploiting bugs specific to Microsoft's implementation. I suspect they do this to make it harder for assembly reader tools/libraries to load the assemblies. Unfortunately, this also prevents Mono runtime from loading the assemblies. In general Mono has a policy of not "fixing" support for this kind of invalid obfuscated code, so you'll need to ask SmartAssembly support for help.
If you're certain you're compiling with SmartAssembly's "Strictly valid" option and it's not working, perhaps you could perhaps try their "Basic" option.

What does "Predefined type 'System.TypedReference' is not defined or imported" mean on Metro project?

I am currently converting a library to be a Metro library for Windows 8. I've created a brand new project in Visual Studio 2012 using the "Class Library (Windows Store apps)" C# Template. I've been adding a lot of files and working through the compile errors, but the one that's confusing me is:
Error 2 Predefined type 'System.TypedReference' is not defined or
imported CSC MyNewProject
The "CSC" appears under the "File" column. Double-clicking the error does nothing. Googling only gives me this:
Do not specify the /nostdlib option from the command line compiler.
Make sure that the project refers to the correct mscorlib.dll.
Reinstall the .NET Framework common language runtime (if the previous
solutions do not solve the problem).
(source http://msdn.microsoft.com/en-us/library/f5c3ehka.aspx)
I'm not using a command line compiler, I don't know how to include or exclude mscorlib - because unlike previous .NET apps in Visual Studio, the only thing my project references is ".NET for Windows Store apps" and "Windows" (something I'm still getting used to).
Any thoughts/advise on this?
That Object is not available or has been relocated for the new ARM .NET architecture.
Here is the Full API for you to search, I would of searched for it, but it is missing a search func.
http://msdn.microsoft.com/en-us/library/windows/apps/br211369.aspx
For anyone else who encounters this, I experienced this while I was converting a project to run on metro. I continued to fix other issues (at the time this was one of hundreds of errors) and eventually this just simply disappeared. My plan was to eventually compare this to a new metro project in a text editor once I fixed all the other errors, but it solved itself before that could happen.

Strong name validation failed on VB.NET Assembly

I have a VB.Net 1.1 application works just fine after compiling in Visual Studio. However, I want to use ILMerge to combine all the referenced assemblies into a single executable just to make it easier to move around. After I send it through ILMerge and try to run it I get the error
"Strong name validation failed for assembly.exe" .....
But none of my stuff is strong named! I saw this post here: Strong Name Validation Failed and tried running it through 'sn.exe -Vr merged.exe' but that gives me this error:
"merged.exe does not represent a strongly named assembly"
Has anyone else had this problem before? How do I fix it?
UPDATE:
I'm starting to feel like Strong name validation isn't the real problem here. I'm building against .NET v1.1 and running on a machine where that is the only .NET version installed (happens to be Windows 2003). The merged executable appears to die with that error on every Windows 2003 machine I try, but if I try to run it on a more modern OS (Vista) it at least starts, but that's not really a good test since the environment isn't fit for a real test.
I have verified that my app.config has the correct settings (specifying required and supported runtime version of v1.1.4322)
I use the /targetplatform:v1.1 option when running my assemblies through ILMerge.
ILMerge is definitely causing the problem (i.e. it works fine before I merge), I just don't know how to fix it.
I had to find and download a very old version of ILMerge (v1.1) in order for my merged binary to work; there must be a bug in the way the current ILMerge application builds .NET 1.1 assemblies. Thankfully we had one internally because I would probably have never found it online.